示例#1
0
        private bool Validate(Point point, DockOperation operation, DragAction dragAction, IVisual relativeTo)
        {
            if (_dragControl == null || _dropControl == null)
            {
                return(false);
            }

            if (_dragControl.DataContext is IDockable sourceDockable && _dropControl.DataContext is IDockable targetDockable)
            {
                DockManager.Position       = DockHelpers.ToDockPoint(point);
                DockManager.ScreenPosition = DockHelpers.ToDockPoint(relativeTo.PointToScreen(point).ToPoint(1.0));
                return(DockManager.ValidateDockable(sourceDockable, targetDockable, dragAction, operation, bExecute: false));
            }

            return(false);
        }
示例#2
0
        private bool Execute(Point point, DockOperation operation, DragAction dragAction, IVisual relativeTo)
        {
            if (_dragControl == null || _dropControl == null)
            {
                return(false);
            }

            if (_dragControl.DataContext is IDockable sourceDockable && _dropControl.DataContext is IDockable targetDockable)
            {
                Debug.WriteLine($"Execute : {point} : {operation} : {dragAction} : {sourceDockable.Title} -> {targetDockable.Title}");
                _dockManager.Position       = DockHelpers.ToDockPoint(point);
                _dockManager.ScreenPosition = DockHelpers.ToDockPoint(relativeTo.PointToScreen(point).ToPoint(1.0));
                return(_dockManager.ValidateDockable(sourceDockable, targetDockable, dragAction, operation, bExecute: true));
            }

            return(false);
        }
示例#3
0
        private bool Validate(Point point, DockOperation operation, DragAction dragAction, IVisual relativeTo)
        {
            if (_targetDropControl == null)
            {
                return(false);
            }

            var layout = _hostWindow.Window.Layout;

            if (layout?.ActiveDockable is IDockable sourceDockable && _targetDropControl.DataContext is IDockable targetDockable)
            {
                _dockManager.Position       = DockHelpers.ToDockPoint(point);
                _dockManager.ScreenPosition = DockHelpers.ToDockPoint(relativeTo.PointToScreen(point).ToPoint(1.0));
                return(_dockManager.ValidateDockable(sourceDockable, targetDockable, dragAction, operation, bExecute: false));
            }

            return(false);
        }