In the existing Telerik RadControls there is no way to programmatically set the window a RadWindow appears in. They always appear in the Main Window. This is an issue for Silverlight 5 Out-of-Browser (OOB) applications making use of multiple windows.
Please introduce a SetWindow function on WindowBase so that the Window the RadWindow appears in can be set. As per the new Silverlight 5 Popup.SetWindow instance method.
For example the following should be possible:
The value passed to the SetWindow function should be used to determine the RootVisual of the RadWindow using Silverlight 5's new Window.GetWindow static method. It should also be used to set the window of any Popup controls related to the RadWindow.
Alternatively at the very least please honour the Owner property in a multi-window environment.
The following steps describe how this can be achieved against the 2011_3_1220 Silverlight RadControls source:
Files: WindowBase.cs, WindowHostFactory.cs, MultiplePopupWindowHost.cs
Add a window field which defaults to the main window:
Add a public SetWindow method (with comments):
Edit the ShowWindow method to additionally pass the _window field:
Edit the GetWindowHost method, adding a windowWindow argument and call CreateHost with it:
Edit the CreateHost method, adding a window argument and use it to construct the MultiplePopupWindowHost instance:
Add a window field:
Add a constructor to take the window as an argument:
Edit the GetHostManager method to use the window field:
Edit the constructor to call SetWindow on the popup:
When the Owner property value is set so should the window be set:
Finally with multiple windows now supported the behaviour of the WindowStartupLocation property when set to CenterScreen needs to be defined. I suggest that it defaults to the center of it's owner's window (rather than appear in a secondary window with the center position from the main window), i.e.: