public void ShowAutoHideWindow(LayoutAnchorControl anchor) { StopCloseTimer(); _currentAutohiddenAnchor = new WeakReference(anchor); _manager.AutoHideWindow.Show(anchor); StartCloseTimer(); }
public void ShowAutoHideWindow(LayoutAnchorControl anchor) { if (_currentAutohiddenAnchor.GetValueOrDefault <LayoutAnchorControl>() != anchor) { StopCloseTimer(); _currentAutohiddenAnchor = new WeakReference(anchor); _manager.AutoHideWindow.Show(anchor); StartCloseTimer(); } }
public void HideAutoWindow(LayoutAnchorControl anchor = null) { if (anchor == null || anchor == _currentAutohiddenAnchor.GetValueOrDefault<LayoutAnchorControl>()) { StopCloseTimer(); } else System.Diagnostics.Debug.Assert(false); }
public void HideAutoWindow(LayoutAnchorControl anchor = null) { if (anchor == null || anchor == _currentAutohiddenAnchor.GetValueOrDefault <LayoutAnchorControl>()) { StopCloseTimer(); } else { System.Diagnostics.Debug.Assert(false); } }
private void CreateChildrenViews() { var manager = _model.Root.Manager; foreach (var childModel in _model.Children) { var lac = new LayoutAnchorControl(childModel); lac.SetBinding(LayoutAnchorControl.TemplateProperty, new Binding(DockingManager.AnchorTemplateProperty.Name) { Source = manager }); _childViews.Add(lac); } }
internal void Hide() { if (_model == null) { return; } _model.PropertyChanged -= new System.ComponentModel.PropertyChangedEventHandler(_model_PropertyChanged); RemoveInternalGrid(); _anchor = null; _model = null; _manager = null; Visibility = System.Windows.Visibility.Hidden; }
internal LayoutAutoHideWindowControl(LayoutAnchorControl anchor) { _anchor = anchor; _model = anchor.Model as LayoutAnchorable; _side = (anchor.Model.Parent.Parent as LayoutAnchorSide).Side; this.Unloaded += (s, e) => { if (_closeTimer != null) { _closeTimer.Stop(); _closeTimer = null; } _manager.HideAutoHideWindow(_anchor); }; }
internal void Show(LayoutAnchorControl anchor) { if (_model != null) throw new InvalidOperationException(); _anchor = anchor; _model = anchor.Model as LayoutAnchorable; _side = (anchor.Model.Parent.Parent as LayoutAnchorSide).Side; _manager = _model.Root.Manager; CreateInternalGrid(); _model.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(_model_PropertyChanged); Visibility = System.Windows.Visibility.Visible; InvalidateMeasure(); UpdateWindowPos(); Debug.WriteLine("LayoutAutoHideWindowControl.Show()"); }
internal void Show(LayoutAnchorControl anchor) { if (_model != null) { throw new InvalidOperationException(); } _anchor = anchor; _model = anchor.Model as LayoutAnchorable; _side = (anchor.Model.Parent.Parent as LayoutAnchorSide).Side; _manager = _model.Root.Manager; CreateInternalGrid(); _model.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(_model_PropertyChanged); Visibility = System.Windows.Visibility.Visible; InvalidateMeasure(); UpdateWindowPos(); Win32Helper.BringWindowToTop(_internalHwndSource.Handle); }
internal void Show(LayoutAnchorControl anchor) { if (_model != null) { throw new InvalidOperationException(); } _anchor = anchor; _model = anchor.Model as LayoutAnchorable; _side = (anchor.Model.Parent.Parent as LayoutAnchorSide).Side; _manager = _model.Root.Manager; CreateInternalGrid(); _model.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(_model_PropertyChanged); Visibility = System.Windows.Visibility.Visible; InvalidateMeasure(); UpdateWindowPos(); Debug.WriteLine("LayoutAutoHideWindowControl.Show()"); }
private void OnModelChildrenCollectionChanged(System.Collections.Specialized.NotifyCollectionChangedEventArgs e) { if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Remove || e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Replace) { if (e.OldItems != null) { { foreach (var childModel in e.OldItems) { _childViews.Remove(_childViews.First(cv => cv.Model == childModel)); } } } } if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Reset) { _childViews.Clear(); } if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Add || e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Replace) { if (e.NewItems != null) { var manager = _model.Root.Manager; int insertIndex = e.NewStartingIndex; foreach (LayoutAnchorable childModel in e.NewItems) { var lac = new LayoutAnchorControl(childModel); lac.SetBinding(LayoutAnchorControl.TemplateProperty, new Binding(DockingManager.AnchorTemplateProperty.Name) { Source = manager }); _childViews.Insert(insertIndex++, lac); } } } }
internal void ShowAutoHideWindow(LayoutAnchorControl anchor) { _autoHideWindowManager.ShowAutoHideWindow(anchor); //if (_autohideArea == null) // return; //if (AutoHideWindow != null && AutoHideWindow.Model == anchor.Model) // return; //Debug.WriteLine("ShowAutoHideWindow()"); //_currentAutohiddenAnchor = new WeakReference(anchor); //HideAutoHideWindow(anchor); //SetAutoHideWindow(new LayoutAutoHideWindowControl(anchor)); //AutoHideWindow.Show(); }
internal void HideAutoHideWindow(LayoutAnchorControl anchor) { _autoHideWindowManager.HideAutoWindow(anchor); }
internal void Hide() { if (_model == null) return; _model.PropertyChanged -= new System.ComponentModel.PropertyChangedEventHandler(_model_PropertyChanged); RemoveInternalGrid(); _anchor = null; _model = null; _manager = null; Visibility = System.Windows.Visibility.Hidden; Debug.WriteLine("LayoutAutoHideWindowControl.Hide()"); }
internal void ShowAutoHideWindow(LayoutAnchorControl anchor) { if (_autohideArea == null) return; if (AutoHideWindow != null && AutoHideWindow.Model == anchor.Model) return; Debug.WriteLine("ShowAutoHideWindow()"); _currentAutohiddenAnchor = new WeakReference(anchor); HideAutoHideWindow(anchor); SetAutoHideWindow(new LayoutAutoHideWindowControl(anchor)); }
internal void HideAutoHideWindow(LayoutAnchorControl anchor) { if (AutoHideWindow != null) { if (anchor == _currentAutohiddenAnchor.GetValueOrDefault<LayoutAnchorControl>()) { Debug.WriteLine("AutoHideWindow()"); AutoHideWindow.Dispose(); SetAutoHideWindow(null); } } }