I was wondering if the RadPane supports child application window handles. That is, i'm starting a new child process within my application and I want it to live inside one of the panes i've created. I can create the application and set the parent as the main window, but can't figure out how to make it live inside the pane. Any idea?
5 Answers, 1 is accepted
RadPane is basically ContentControl, so you should be able to that is should be done if working with ContentControl. However as I'm not completely sure what is the exact scenario you are trying to achieve - if you share a sample project with a sample implementation we can check it and let you know if there is anything special that needs to be done in the context of RadDocking.
I'm looking forward to hearing from you.
This snippet of code gets the process created and sets the parent as the main window. It looks like the child application lives within the pane, but when switch to other RadPanes (tabs) via mouse click, the child application is still the foremost view.
testChildapp = System.Diagnostics.Process.Start(process);
_appWin = testChildapp.MainWindowHandle;
var parent = new WindowInteropHelper(Window.GetWindow((TestAppPane.Content));
SetWindowLongA(_appWin, GWL_STYLE, WS_VISIBLE);
MoveWindow(_appWin, 200, 100, 200, 200, true);
I assume the problem is that the new process runs inside of Window placed above the RadDocking control and this causes the observed behavior. Basically if you manage to run this process in place it inside WPF TabControl - it should be possible to achieve the same with RadDocking. If you can share sample project demonstrating how this is implemented and displayed inside TabControl, we would be able investigate what is the reason to behave differently inside RadDocking.
As another solution you could try to collapse the window of the external application when the active Pane of the current group changes.
Hope this helps - if you have any other questions, please let me know.
What I can suggest you would be to hook to the ToolWindowCreated event of RadDocking (for more info about all the events check this article) and then hook to the LocationChanged event of the new ToolWindow. This way you would be able to move as the floating window moves. Please check the following snippet:
Hope this will help you.