예제 #1
0
        /// <exclude/>
        protected override void OnPreviewMouseDown(MouseButtonEventArgs e)
        {
            base.OnPreviewMouseDown(e);

            if (DockItem != null)
                DockItem.Show(DockItemShowMethod.Activate);
        }
 private static void SetAutoHideSize(DockItem dockItem, SplitterDistance value)
 {
     dockItem.AutoHideSize = value;
     if (DockPositionHelper.IsAutoHide(dockItem.DockPosition) && !dockItem.IsSelected)
     {
         dockItem.Show(DockItemShowMethod.Select);
     }
 }
예제 #3
0
        internal sealed override void Run(DockItem dockItem, DockPane targetPane)
        {
            DockPaneNode targetPaneNode = targetPane;

            for (int i = 0; i < AncestorLevel; i++)
            {
                targetPaneNode = targetPaneNode.Parent;
            }
            dockItem.Show(targetPaneNode, IsAutoHide, Side, Size, IsSizeForTarget, ShowMethod);
        }
예제 #4
0
 private static void OnMakeFloatingExecuted(object sender, ExecutedRoutedEventArgs e)
 {
     DockItem dockItem = ((AutoHideWindow)sender).DockItem;
     DockControl dockControl = dockItem.DockControl;
     FloatingWindow floatingWindow = GetFloatingWindow(dockItem);
     Rect floatingWindowBounds;
     if (floatingWindow != null)
         floatingWindowBounds = new Rect(floatingWindow.Left, floatingWindow.Top, floatingWindow.Width, floatingWindow.Height);
     else
         floatingWindowBounds = new Rect(new Point(double.NaN, double.NaN), dockControl.DefaultFloatingWindowSize);
     dockItem.Show(dockItem.DockControl, floatingWindowBounds);
 }
예제 #5
0
        private void OnTimerTick(object sender, EventArgs e)
        {
            DockItem selectedItem = SelectedItem;

            if (selectedItem == null)
            {
                _timer.Stop();
            }
            else if (!selectedItem.IsActiveItem)
            {
                if (_closingItem != null)
                {
                    _closingItem.Show(DockItemShowMethod.Deselect);
                }
                else if (!IsMouseOver && !GetIsMouseOverTab(selectedItem))
                {
                    BeginClose();
                }
            }
        }
        void OnWorkspacesChanged(object sender, NotifyCollectionChangedEventArgs e)
        {
            if (e.NewItems != null && e.NewItems.Count != 0)
            {
                foreach (WorkspaceViewModel workspace in e.NewItems)
                {
                    DockItem dockItem = new DockItem();
                    dockItem.HideOnPerformClose       = false;
                    dockItem.Content                  = workspace;
                    dockItem.AllowedDockTreePositions = AllowedDockTreePositions.Document;
                    dockItem.TabText                  = workspace.DisplayName;
                    dockItem.Show(this, DockPosition.Document);
                    _dockItems.Add(workspace, dockItem);
                }
            }

            if (e.OldItems != null && e.OldItems.Count != 0)
            {
                foreach (WorkspaceViewModel workspace in e.OldItems)
                {
                    _dockItems.Remove(workspace);
                }
            }
        }
예제 #7
0
 private void Select()
 {
     DockItem.Show(DockItemShowMethod.Select);
     IsMouseOverTab = true;
 }
예제 #8
0
 internal sealed override void Run(DockItem dockItem, DockPane targetPane)
 {
     dockItem.Show(targetPane, Index, ShowMethod);
 }
예제 #9
0
 internal sealed override void Run(DockItem dockItem, DockControl dockControl)
 {
     dockItem.Show(dockControl, DockPosition, ShowMethod);
 }
예제 #10
0
 internal sealed override void Run(DockItem dockItem, DockControl dockControl)
 {
     dockItem.Show(dockControl, new Rect(Left, Top, Width, Height), ShowMethod);
 }