Пример #1
0
 public void HideAutoWindow(LayoutAnchorControl anchor = null)
 {
     if (anchor == null || anchor == this._currentAutohiddenAnchor.GetValueOrDefault <LayoutAnchorControl>())
     {
         this.StopCloseTimer();
     }
 }
Пример #2
0
 public void ShowAutoHideWindow(LayoutAnchorControl anchor)
 {
     StopCloseTimer();
     _currentAutohiddenAnchor = new WeakReference(anchor);
     _manager.AutoHideWindow.Show(anchor);
     StartCloseTimer();
 }
Пример #3
0
 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);
 }
Пример #6
0
        internal void Show(LayoutAnchorControl anchor)
        {
            if (!(anchor.Model.Parent.Parent is LayoutAnchorSide))
            {
                //var root = Root;
                if (anchor.Model is LayoutAnchorable &&
                    anchor.Model.Parent is LayoutRoot)
                {
                    var model          = anchor.Model as LayoutAnchorable;
                    var root           = anchor.Model.Parent as LayoutRoot;
                    var newAnchorGroup = new LayoutAnchorGroup();
                    newAnchorGroup.Children.Add(model);
                    AnchorSide anchorSide = LayoutSetting.GetDefaultSideAnchorable(model.Title);

                    switch (anchorSide)
                    {
                    case AnchorSide.Right:
                        root.RightSide.Children.Add(newAnchorGroup);
                        break;

                    case AnchorSide.Left:
                        root.LeftSide.Children.Add(newAnchorGroup);
                        break;

                    case AnchorSide.Top:
                        root.TopSide.Children.Add(newAnchorGroup);
                        break;

                    case AnchorSide.Bottom:
                        root.BottomSide.Children.Add(newAnchorGroup);
                        break;
                    }
                }
                else
                {
                    return;
                }
            }

            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();
            Trace.WriteLine("LayoutAutoHideWindowControl.Show()");
        }
Пример #7
0
 public void ShowAutoHideWindow(LayoutAnchorControl anchor)
 {
     if (_currentAutohiddenAnchor.GetValueOrDefault <LayoutAnchorControl>() != anchor)
     {
         StopCloseTimer();
         _currentAutohiddenAnchor = new WeakReference(anchor);
         _manager.AutoHideWindow.Show(anchor);
         StartCloseTimer();
     }
 }
Пример #8
0
 public void HideAutoWindow(LayoutAnchorControl anchor = null)
 {
     if (anchor == null ||
         anchor == _currentAutohiddenAnchor.GetValueOrDefault <LayoutAnchorControl>())
     {
         StopCloseTimer();
     }
     else
     {
         System.Diagnostics.Debug.Assert(false);
     }
 }
Пример #9
0
 internal void Hide()
 {
     if (this._model == null)
     {
         return;
     }
     this._model.PropertyChanged -= new PropertyChangedEventHandler(this._model_PropertyChanged);
     this.RemoveInternalGrid();
     this._anchor    = null;
     this._model     = null;
     this._manager   = null;
     base.Visibility = System.Windows.Visibility.Hidden;
 }
        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);
            }
        }
Пример #11
0
 internal void Show(LayoutAnchorControl anchor)
 {
     if (this._model != null)
     {
         throw new InvalidOperationException();
     }
     this._anchor  = anchor;
     this._model   = anchor.Model as LayoutAnchorable;
     this._side    = (anchor.Model.Parent.Parent as LayoutAnchorSide).Side;
     this._manager = this._model.Root.Manager;
     this.CreateInternalGrid();
     this._model.PropertyChanged += new PropertyChangedEventHandler(this._model_PropertyChanged);
     base.Visibility              = System.Windows.Visibility.Visible;
     base.InvalidateMeasure();
     base.UpdateWindowPos();
 }
        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();
        }
        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();
        }
        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;

              //Trace.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;

            Trace.WriteLine("LayoutAutoHideWindowControl.Hide()");
        }
Пример #18
0
		internal void ShowAutoHideWindow(LayoutAnchorControl anchor)
		{
			_autoHideWindowManager.ShowAutoHideWindow(anchor);
			Debug.WriteLine("ShowAutoHideWindow()");
		}