tags:

views:

163

answers:

4

Hi,

I need to have yes No Cancel confirmation window in my silverlight app. I am trying to use child window for this purpose. But this.Show(); doesn't wait till the user gives his input.

Any help ?

Thanks

PS: i m new to silverlight

A: 

If you want to wait for user input until the application continues, you need to think about implementing a modal dialog, you can search google for many many implementations on this, bit if you would like more help, I can give you some pointers :)

Mark
A: 

From the Silverlights forums: http://forums.silverlight.net/forums/p/86341/200660.aspx

Reuben Mallaby
+1  A: 

If you'd be fine just with OK and Cancel buttons you could also use the Messagebox although it doesn't look so fancy.

MessageBoxResult result = MessageBox.Show("Lorem ipsum doso mitus dasam ...", 
    "The title", MessageBoxButton.OKCancel);

if (result == MessageBoxResult.OK) {
    MessageBox.Show("You clicked OK");
}
texmex5
+2  A: 

Use a child form as you are currently just rearrange the code where Show is called:-

void SomeMethod()
{
   var dialog = new YesNoCancelDialog();
   dialog.Closed += (s, args) =>
   {
     switch (dialog.Result)
     {
        //Handle resulting user choice
     }
   }
   dialog.Show();
}
AnthonyWJones