Hi we are currently allowing floating windows to be minimized, I'd like to be able to restore the window from code. I've tried calling activate on the content and that will bring the window forward if it's not minimized but nothing otherwise.
Is there any way of doing this?
Thanks.
Hi Mark,
What you can do is get the PaneToolWindow of your choice and set its WindowState property to System.Windows.WindowState.Normal.
Hope this helps.
Thanks for the response Galina, I did think that but how do I get the PaneToolWindow? If i use the XamDockManager.Panes property i get back a ContentPane.
Thanks, Mark.
Mark,
There are 2 options here:
1. If you know which SplitPane is contained in the floating window you need restored, you can use your XamDockManager's "Panes" property, which will give you a collection of all SplitPanes. Once you find the desired SplitPane you can get the PaneToolWindow which would be the SplitPane's parent, e.g.
PaneToolWindow yourWindow = (PaneToolWindow)yourSplitPane.Parent;
2. If you know only a content pane that is situated in the floating window, you'll need to dig more into its parents. The XamDockManager GetPanes() method would give you a collection of all ContentPanes. After you've found the desired one, you just need to get to the SplitPane the content pane is descendant of, and then get the PaneToolWindow as mentioned in the first option.
Let me know if one of these works for you.
There is also an attached inherited property on ToolWindow so you can use the ToolWindow.GetToolWindow() to get the ToolWindow from any element within it.
Great thanks, I ended up using ToolWindow.GetToolWindow() makes the code smaller, nicer!