Skip to main content

Microsoft Silverlight

Answered Question Dialog simulation HELPRSS Feed

(0)

caperaven
caperaven

Member

Member

133 points

107 Posts

Dialog simulation HELP

Ok, i got this very nice form stuff working in silverlight and now I am developing a simple message dialog system also for our business application.

What i would like to happen is that when you call for example "MessageBox.Show("Message")" the code does not continue on the calling method until you click ok on the silverlight control that shows the message.

Example:

if (some condition)
{

MessageBox.Show("Ooops");
DoSomething();

}

now MessageBox.Show creates a user control that displays the message.
but I don't want the code DoSomething() to execute until you click on a "OK" button on the ui displaying the message.

How can I put the system in a loop that will prevent the code on continueing with out locking the UI thread?

kwatts
kwatts

Contributor

Contributor

2129 points

436 Posts

Answered Question

Re: Dialog simulation HELP

You need to use a modal dialog to accomplish this, and these are not currently available in Silverlight.  There are solutions that others have developed though which seem to get around this issue.  Check this link:

http://blogs.msdn.com/devdave/archive/2008/06/08/using-popup-to-create-a-dialog-class.aspx 

There's a whole thread that explores this issue here:

http://silverlight.net/forums/p/16831/55929.aspx

I hope that this helps!  If this answers your question, please mark it as such.  Thanks!

-Ken 


http://kenwatts.blogspot.com/


Please select "Mark as Answer" for posts that are helpful. Thanks!

caperaven
caperaven

Member

Member

133 points

107 Posts

Re: Re: Dialog simulation HELP

Jaaa, that puts a real damper on things.

Thanks dude. In short i guess they say, :p can't be done buddy.

kwatts
kwatts

Contributor

Contributor

2129 points

436 Posts

Re: Re: Dialog simulation HELP

I'm not sure why modal support isn't there yet.  But I think some of these workarounds could work for you.  If I come accross a better solution, I'll post it here.

Good luck!

-Ken

 


http://kenwatts.blogspot.com/


Please select "Mark as Answer" for posts that are helpful. Thanks!
  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities