Home > Silverlight > ModalDialog

ModalDialog

Displaying a ModalDialog in Silverlight is simple, thanks to Karen Corby for providing a reusable class
you can download sample code for ModalDialog here

how to use it

copy the code for class into the project
Create a page(“ModalPage”) with the content we want to be displayed in ModalDialog
when it is time to display the dialog, all we need to do is add couple of lines of code

ModalDialog.Closed += new EventHandler<ModalDialogClosedEventArgs>(ModalDialog_Closed);
//”ModalPage” is the name of the page we created
ModalDialog.Show(new SolidColorBrush(Colors.LightGray), .5, new ModalPage());
 void ModalDialog_Closed(object sender, ModalDialogClosedEventArgs e)
 {
    if (e.Result == DialogResult.OK)
        //do something
    else
  //do something
 }

Categories: Silverlight Tags:
  1. Fernando Lopez Jr.
    October 14, 2008 at 7:57 pm | #1

    screenshot?

  1. No trackbacks yet.