private void OnSelectedItemChanged(DockItem oldValue, DockItem newValue) { SelectedItem = newValue; if (_closingItem != null) { _closingItem = null; } if (oldValue != null) { oldValue.StateChanged -= new EventHandler <DockItemStateEventArgs>(OnSelectedItemStateChanged); } if (newValue != null) { if (_timer == null) { _timer = new DispatcherTimer(); _timer.Interval = TimerInterval; _timer.Tick += new EventHandler(OnTimerTick); } _timer.Start(); if (DockPositionHelper.IsAutoHide(newValue.DockPosition)) { newValue.StateChanged += new EventHandler <DockItemStateEventArgs>(OnSelectedItemStateChanged); } } else { if (_timer != null) { _timer.Stop(); } } }
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(); } }
/// <exclude/> public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { DockPosition dockPosition = (DockPosition)value; return(DockPositionHelper.IsAutoHide(dockPosition)); }