/// <summary> /// Called when state is changed /// </summary> /// <param name="d">Dependency object</param> /// <param name="e">The <see cref="System.Windows.DependencyPropertyChangedEventArgs"/> instance containing the event data.</param> private static void OnDockPaneStateChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { DockPane pane = d as DockPane; DockPaneState state = (DockPaneState)e.NewValue; OnDockPaneStateChange(pane, state); }
/// <summary> /// Called when dock pane's state is changed /// </summary> /// <param name="sender">Event source</param> /// <param name="e">The <see cref="System.Windows.DependencyPropertyChangedEventArgs"/> instance containing the event data.</param> private void OnDockPaneStateChanged(object sender, DependencyPropertyChangedEventArgs e) { DockPane pane = sender as DockPane; Validate.Assert <ArgumentException>(pane != null); IgnoreStateChangeForDockPane(pane); DockPaneState state = (DockPaneState)e.NewValue; if (state == DockPaneState.AutoHide) { DockPanel logicalParentDockPanel = LogicalTreeHelper.GetParent(pane) as DockPanel; RemovePinnedWindow(pane); CondenceDockPanel(pane, DockPanel.GetDock(logicalParentDockPanel)); } else if (state == DockPaneState.Docked) { PopupArea.Children.Remove(pane); RemoveCondencedDockPanel(pane.CondencedDockPanel); AddPinnedWindowInner(pane, DockPanel.GetDock(pane)); } MonitorStateChangeForDockPane(pane); }
/// <summary> /// Called when dock pane state has changed /// </summary> /// <param name="pane">Dock pane.</param> /// <param name="state">New state (may not be current yet)</param> private static void OnDockPaneStateChange(DockPane pane, DockPaneState state) { switch (state) { case DockPaneState.Docked: pane.ClearAdornerLayer(); if (pane.PinButton != null) { pane.PinButton.Visibility = Visibility.Visible; pane.PinButton.IsChecked = false; } break; case DockPaneState.AutoHide: pane.ClearAdornerLayer(); if (pane.PinButton != null) { pane.PinButton.Visibility = Visibility.Visible; pane.PinButton.IsChecked = true; } break; case DockPaneState.Floating: pane.AddResizingAdorner(); if (pane.PinButton != null) { pane.PinButton.Visibility = Visibility.Collapsed; } break; case DockPaneState.Content: pane.ClearAdornerLayer(); break; default: break; } }
protected override void OnClick() { var pane = FrameworkApplication.DockPaneManager.Find("GestureGis2_Dockpane1"); // determine visibility bool visible = pane.IsVisible; // activate it pane.Activate(); // determine dockpane state DockPaneState state = pane.DockState; // pin it pane.Pin(); // hide it // pane.Hide(); }
public void Dockpane2() { #region Dockpane properties and methods // in order to find a dockpane you need to know it's DAML id var pane = FrameworkApplication.DockPaneManager.Find("esri_core_ProjectDockPane"); // determine visibility bool visible = pane.IsVisible; // activate it pane.Activate(); // determine dockpane state DockPaneState state = pane.DockState; // pin it pane.Pin(); // hide it pane.Hide(); #endregion }