// dragPoint相对于屏幕 public bool Drag(Controls.DockAbleTabItem dragedElement, Point dragPoint, Point mouseDownPoint) { if (!IsMouseCaptured) { //this.Show(); //CaptureMouse(); if (CaptureMouse()) { var parentDockContainer = EditorCommon.Program.GetParent(dragedElement, typeof(Controls.DockAbleContainerControl)) as Controls.DockAbleContainerControl; if (parentDockContainer != null) { if (string.IsNullOrEmpty(dragedElement.DockGroup)) { dragedElement.DockGroup = parentDockContainer.Group; } } RemoveFromParent(dragedElement); mMouseWin.DockElement = dragedElement; mDeltaMoveX = -mouseDownPoint.X; mDeltaMoveY = -mouseDownPoint.Y; StartDrag(dragPoint); return(true); } } return(false); }
public void SetContent(IDockAbleControl control) { var tabItem = new Controls.DockAbleTabItem(); tabItem.Header = control.KeyValue; tabItem.DockGroup = control.DockGroup; tabItem.Content = control; tabItem.IsTopLevel = true; SetContent(tabItem); }
public void SetContent(Controls.DockAbleTabItem element) { MainGrid.Children.Clear(); if (element == null) { return; } EditorCommon.Program.RemoveElementFromParent(element); var dockCtrl = new DockControl.Controls.DockAbleContainerControl(this) { //Style = FindResource("ControlStyle_DockContainer") as System.Windows.Style, Group = element.DockGroup, }; // mContainDropSurfaces.Add(dockCtrl); DockManager.Instance.AddDropSurface(dockCtrl); if (element is Controls.DockAbleTabItem) { var tabItem = element as Controls.DockAbleTabItem; tabItem.IsTopLevel = true; var tabCtrl = new DockControl.Controls.DockAbleTabControl(); dockCtrl.Content = tabCtrl; tabCtrl.Items.Add(tabItem); tabCtrl.SelectedIndex = 0; tabCtrl.IsTopLevel = true; MainGrid.Children.Add(dockCtrl); } else { dockCtrl.Content = element; MainGrid.Children.Add(dockCtrl); } }
public virtual void AddChild(Controls.DockAbleTabItem element) { }