My code:
IsPinned="False" Margin="5,0,5,5" AllowFloatingOnly ="False">
When click PaneTabItem, Contentpane will flyout, and XamDockManager.GetPaneLocation(paneItem) is PaneLocation.Unpinned. When I flyin Contentpane, XamDockManager.GetPaneLocation(paneItem) is still PaneLocation.Unpinned.
I want to know which property is used to distinguish flyout and flyin status.
My task is left click PaneTabItem, flyout the pane, left click agian, flyin the pane.
EventManager.RegisterClassHandler( typeof(PaneTabItem), Control.MouseLeftButtonDownEvent, new MouseButtonEventHandler(OnPaneTabItemMouseLeftButtonDown));
private void OnPaneTabItemMouseLeftButtonDown(object sender, MouseButtonEventArgs e) { PaneTabItem paneItem = sender as PaneTabItem; ContentPane pane = paneItem.Pane;
if (pane != null) { if (pane.IsPinned == false) { //I can not distinguish flyout and flyin status, if in flyout status, just fly in if (XamDockManager.GetPaneLocation(paneItem) == PaneLocation.Unpinned) { pane.ExecuteCommand(ContentPaneCommands.FlyIn); }
//if in flyin status, just flyout else { pane.ExecuteCommand(ContentPaneCommands.Flyout); } } } }
But it does not work, because I can not distinguish flyout and flyin status.
Hi Brandon,
In that case you can try using the CurrentFlyoutPane property that returns the pane which is currently within the UnpinnedTabFlyout. The property value is null if the flyout is not displayed. Since this is not a dependency property there will be no change notifications though it seems to be helpful in this scenario.
Please note that if the user click the pane tab while it is flying (the pane is still the CurrentFlyoutPane while it is flying in) the proper command will not execute.
I have updated the sample application to use the code snippet below:
if (pane != XamDockManager.GetDockManager(pane).CurrentFlyoutPane) { pane.ExecuteCommand(ContentPaneCommands.Flyout); }
else { pane.ExecuteCommand(ContentPaneCommands.FlyIn); }
Please feel free to let me know if you have any questions or concerns.
Hello,
But in my application UnpinnedTabHoverAction property is set to Flyout, and if click other pane control, the flyout pane will flyin.
So shouldFlyout is not a right flag to flyout or flyin the pane.
Hello Brandon,
Thank you for posting!
The default behavior of the XamDockManager will cause the pane to flyout on hover or when active when UnpinnedTabHoverAction is set to “Flyout”. Currently there is not an exposed property for the content pane that returns its flyin/flyout status. I have put together a small sample application that could be helpful if you would like to change that status on mouse event. It illustrates how the ContentPaneCommands.Flyout and ContentPaneCommands.FlyIn commands could be executed in the PreviewMouseDown event handler. Please note that in this scenario the XamDockManager UnpinnedTabHoverAction property is "None" so the panes do not flyout on mouse hover.
Please feel free to let me know if you have any questions.