We have an application, in which we have requirement after clicking on Conent Paneit should be Pinned in the half of the area of Form and the other Pane/Control should be shrinked. Like it happend after clicking on Pin button. We need the same behavior after clicking on the bottom Docked Pane.
Also, how Content Pane height should be automatically adjusted to 50%.
Note: We have set UnpinnedTabHoverAction="None" in our application.
Please find the attached Sample for your refernece.
XamDockManagerCloseBtnCase.rar
Hello Narendra,
I am reattaching the sample project with an if-check around the code that recreates/clones the content panes only if the pane exists in the DocumentContentHost. This prevents the pane from auto-closing each time, as the tabs at the bottom are also PaneTabItems and as such will fire the PreviewMouseUp event in the sample.
Please let me know if you have any other questions or concerns on this matter.
0755.XamDockManagerPinnedClickTest.zip
Thanks for the response.
But in the Sample, I am unable to Pin/Unpin Pane1/Pane2. As after clicking on it at Bottom it's opening and closing automatically.
The expected behavior is that if we click in the bottom docked pane they should Pin automatically.
Thank you for your update(s) on this matter.
Unfortunately, there does not exist a way to bind the Height of the ContentPane to a mathematical operation directly, as XAML bindings cannot do mathematical operations in that way. You could potentially use a converter and bind to the XamDockManager.ActualHeight and then return half of that value, though.
Regarding the pinning of the pane on click of its header from the DocumentContentHost, I would recommend first defining a Style for PaneTabItem with an EventSetter for PreviewMouseUp, as this will allow you to detect the click. There, you can get the Pane from the PaneTabItem to get the ContentPane and cache its Content as there does not exist a way to really move the pane programmatically. Instead, I would recommend you essentially clone the pane, close the old one, and then move the Content of the old one to the new one and add it to the XamDockManager.
After adding the cloned pane, you can execute the ContentPaneCommands.TogglePinnedState via the ExecuteCommand method of the pane to pin it.
I was unfortunately unable to use your sample project to demonstrate this as it would not compile due to missing files from the Properties folder, and so I created a new one to demonstrate the above. I am attaching this sample here.
XamDockManagerPinnedClickTest.zip
Can we set the height of Content pane in .xaml file as xamDockManager.ActualHeight/2?
Yes correct, I want to pin it to Bottom after clicking on it's header. If this docked in Left and Right, in that it should be pin to Left and Right.
Also, in which event we can set the height for Content/Split pane so that it will work in each case. Can you provide the solution in tha Sample.