Silverlight 3 SaveAs Dialog debugging quirk
I have been playing with the new SaveAs dialog in Silverlight 3 and discovered an odd quirk. While debugging I was getting the following exception:
Hope this helps anyone banging their head against the wall on this one...
(BTW...thanks Silverlight team... this was a much needed control.)
System.Security.SecurityException was unhandled by user code
Message="Dialogs must be user-initiated."
From all appearances, my SaveAs dialog was being initiated from a user-initiated event. The code to open the dialog was being executed in the Click event handler of a button on my Silverlight control. The problem was... I had a breakpoint set on the line of code that performed the ShowDialog(). Once I moved the breakpoint to the next line of code everything worked.Hope this helps anyone banging their head against the wall on this one...
(BTW...thanks Silverlight team... this was a much needed control.)
Labels: SaveAs, Silverlight