Saturday, February 11, 2012

Silverlight 4 ChildWindow leaves parent disabled after closing

A Silverlight 4 childWindow will close correctly at the first time, but in a second time it closes but leaves the UI parent disabled. Don’t be afraid, it’s a known issue.

While Microsoft don’t resolve it, you can enable the RootVisual in the OnClosed method of your childWindow.

protected override void OnClosed(EventArgs e)
{
     base.OnClosed(e);
     Application.Current.RootVisual.SetValue(Control.IsEnabledProperty, true);
}

No comments:

Post a Comment