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
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
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 :)
From the Silverlights forums: http://forums.silverlight.net/forums/p/86341/200660.aspx
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");
}
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();
}