public void DockDragEnter(object sender, DockDragDropEventArgs e) { Point center = new Point(ActualWidth / 2, ActualHeight / 2); int space = (int)Root.DockIconSize.Width / 4; ResourceDictionary rd = new ResourceDictionary(); rd.Source = new Uri("/Atf.Gui.Wpf;component/Resources/DockIcons.xaml", UriKind.Relative); if (m_dockLeftIcon == null) { m_dockLeftIcon = new DockIcon((Style)rd["DockLeftIcon"], Root.DockIconSize); m_dockRightIcon = new DockIcon((Style)rd["DockRightIcon"], Root.DockIconSize); m_dockTopIcon = new DockIcon((Style)rd["DockTopIcon"], Root.DockIconSize); m_dockBottomIcon = new DockIcon((Style)rd["DockBottomIcon"], Root.DockIconSize); m_dockTabIcon = new DockIcon((Style)rd["DockTabIcon"], Root.DockIconSize); } Window owner = Window.GetWindow(this); Point offset = ((UIElement)Root).PointFromScreen(PointToScreen(new Point(0, 0))); m_dockLeftIcon.Offset = new Point(offset.X + center.X - Root.DockIconSize.Width / 2 - Root.DockIconSize.Width - space, offset.Y + center.Y - Root.DockIconSize.Height / 2); m_dockRightIcon.Offset = new Point(offset.X + center.X + Root.DockIconSize.Width / 2 + space, offset.Y + center.Y - Root.DockIconSize.Height / 2); m_dockTopIcon.Offset = new Point(offset.X + center.X - Root.DockIconSize.Width / 2, offset.Y + center.Y - Root.DockIconSize.Height / 2 - Root.DockIconSize.Height - space); m_dockBottomIcon.Offset = new Point(offset.X + center.X - Root.DockIconSize.Width / 2, offset.Y + center.Y + Root.DockIconSize.Height / 2 + space); m_dockTabIcon.Offset = new Point(offset.X + center.X - Root.DockIconSize.Width / 2, offset.Y + center.Y - Root.DockIconSize.Height / 2); DocklingsWindow dockIconLayer = Root.DockIconsLayer; dockIconLayer.AddChild(m_dockLeftIcon); dockIconLayer.AddChild(m_dockRightIcon); dockIconLayer.AddChild(m_dockTopIcon); dockIconLayer.AddChild(m_dockBottomIcon); dockIconLayer.AddChild(m_dockTabIcon); }
public void DockDragLeave(object sender, DockDragDropEventArgs e) { DocklingsWindow dockIconLayer = Root.DockIconsLayer; dockIconLayer.RemoveChild(m_dockLeftIcon); dockIconLayer.RemoveChild(m_dockRightIcon); dockIconLayer.RemoveChild(m_dockTopIcon); dockIconLayer.RemoveChild(m_dockBottomIcon); dockIconLayer.RemoveChild(m_dockTabIcon); if (m_dockPreviewShape != null) { Root.DockIconsLayer.RemoveChild(m_dockPreviewShape); m_dockPreviewShape = null; } dockIconLayer.CloseIfEmpty(); }
void Docklings_Closing(object sender, System.ComponentModel.CancelEventArgs e) { m_docklings = null; }