示例#1
0
        public void Drop(Point dropLocation, out bool dropHandled)
        {
            dropHandled = false;

            UpdateMouseLocation(dropLocation);

            var floatingWindowModel = _floatingWindow.Model as LayoutFloatingWindow;

            if (floatingWindowModel != null)
            {
                var root = floatingWindowModel.Root;

                _currentHost?.HideOverlayWindow();

                if (_currentDropTarget != null)
                {
                    _currentWindow.DragDrop(_currentDropTarget);
                    root.CollectGarbage();
                    dropHandled = true;
                }
            }


            _currentWindowAreas.ForEach(a => _currentWindow.DragLeave(a));

            if (_currentDropTarget != null)
            {
                _currentWindow.DragLeave(_currentDropTarget);
            }
            _currentWindow?.DragLeave(_floatingWindow);
            _currentWindow = null;

            _currentHost = null;
        }
示例#2
0
        public void Drop(Point dropLocation, out bool dropHandled)
        {
            dropHandled = false;
            bool itemDropped = true;

            UpdateMouseLocation(dropLocation);

            var floatingWindowModel = _floatingWindow.Model as LayoutFloatingWindow;
            var root = floatingWindowModel.Root;

            if (_currentHost != null)
            {
                _currentHost.HideOverlayWindow();
            }

            if (_currentDropTarget != null)
            {
                //BodyArchitect START
                itemDropped = _manager.OnFloatingPaneDropping((DropTargetBase)_currentDropTarget, floatingWindowModel);

                if (itemDropped)
                {
                    _currentWindow.DragDrop(_currentDropTarget);
                    root.CollectGarbage();
                    dropHandled = true;
                }
            }

            _currentWindowAreas.ForEach(a => _currentWindow.DragLeave(a));
            if (_currentDropTarget != null)
            {
                _currentWindow.DragLeave(_currentDropTarget);
            }
            if (_currentWindow != null)
            {
                _currentWindow.DragLeave(_floatingWindow);
            }

            ////BodyArchitect END
            _currentWindow = null;

            _currentHost = null;
        }
示例#3
0
        /// <summary>
        /// Method is invoked by the <see cref="LayoutFloatingWindowControl"/> to indicate that the
        /// <see cref="LayoutFloatingWindowControl"/> (and its content) should be dropped/docked at
        /// the current mouse position.
        ///
        /// The drop/dock behavior depends on whether the current mouse position is an actual drop target
        /// the item being dragged, and the item being docked (if any) etc.
        /// </summary>
        /// <param name="dropLocation">The screen coordinates of the drop/dock position.</param>
        /// <param name="dropHandled">Indicates whether the drop was handled such that the
        /// dropped <see cref="LayoutFloatingWindowControl"/> can be removed now (since it content
        /// is docked into a new visual tree position).</param>
        internal void Drop(Point dropLocation, out bool dropHandled)
        {
            // TODO - pass in without DPI adjustment, screen co-ords, adjust inside the target window
            dropHandled = false;

            UpdateMouseLocation(dropLocation);

            var floatingWindowModel = _floatingWindow.Model as LayoutFloatingWindow;
            var root = floatingWindowModel.Root;

            if (_currentHost != null)
            {
                _currentHost.HideOverlayWindow();
            }

            if (_currentDropTarget != null)
            {
                _currentWindow.DragDrop(_currentDropTarget);
                root.CollectGarbage();
                dropHandled = true;
            }

            _currentWindowAreas.ForEach(a => _currentWindow.DragLeave(a));

            if (_currentDropTarget != null)
            {
                _currentWindow.DragLeave(_currentDropTarget);
            }

            if (_currentWindow != null)
            {
                _currentWindow.DragLeave(_floatingWindow);
            }

            _currentWindow = null;
            _currentHost   = null;
        }