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()"); }