private void OnSelectedItemStateChanged(object sender, DockItemStateEventArgs e)
        {
            DockItem selectedItem = SelectedItem;

            Debug.Assert(DockPositionHelper.IsAutoHide(selectedItem.DockPosition));
            if (e.StateChangeMethod == DockItemStateChangeMethod.ToggleAutoHide && e.ShowMethod == DockItemShowMethod.Select)
            {
                BeginClose();
            }
            else
            {
                SetupShowAnimation();
            }
        }
        protected override void OnDockItemStateChanged(DockItemStateEventArgs e)
        {
            base.OnDockItemStateChanged(e);
            WorkspaceViewModel workspace = e.DockItem.Content as WorkspaceViewModel;

            if (workspace != null)
            {
                if (e.NewDockPosition == DockPosition.Unknown)  // DockItem closed
                {
                    workspace.CloseCommand.Execute(null);
                }
                else if (e.NewDockPosition == DockPosition.Document && e.DockItem.IsSelected)
                {
                    _workspacesView.MoveCurrentTo(workspace);
                }
            }
        }
Beispiel #3
0
 private string GetString(DockItemStateEventArgs e)
 {
     if (e.OldDockPosition == e.NewDockPosition)
     {
         return(string.Format("DockItem={0}, StateChangeMethod={1}, ShowMethod={2}",
                              GetString(e.DockItem),
                              e.StateChangeMethod,
                              e.ShowMethod));
     }
     else
     {
         return(string.Format("DockItem={0}, StateChangeMethod={1}, DockPosition={2}->{3}, ShowMethod={4}",
                              GetString(e.DockItem),
                              e.StateChangeMethod,
                              e.OldDockPosition,
                              e.NewDockPosition,
                              e.ShowMethod));
     }
 }
Beispiel #4
0
 private void OnDockItemStateChanged(object sender, DockItemStateEventArgs e)
 {
     output.AppendLog(string.Format("DockItemStateChanged: {0}", GetString(e)));
 }