26 January 2011

Silverlight - Child window

In Silverlight, you can create a child window using Add > New Item > Silverlight Child Window. Such window creates a class and doesn't need to be embedded in the XAML from which you want to open it. You open it in code with a simple:

new frmLeadEdit().Show();

The window overlays the entire Silverlight area and blocks underlaying controls. I customized it's style. Make sure the styles TargetType has the proper prefix. I had a browser crash without it.

The window can return a 'DialogResult' of True or False. To receive it, you must handle the windows 'Closed' event.

No comments:

Post a Comment