示例#1
0
        public DragService(LayoutFloatingWindowControl floatingWindow)
        {
            _floatingWindow = floatingWindow;
            _manager = floatingWindow.Model.Root.Manager;

            GetOverlayWindowHosts();
        }
        IEnumerable <IDropArea> IOverlayWindowHost.GetDropAreas(LayoutFloatingWindowControl draggingWindow)
        {
            if (_dropAreas != null)
            {
                return(_dropAreas);
            }

            _dropAreas = new List <IDropArea>();

            if (draggingWindow.Model is LayoutDocumentFloatingWindow)
            {
                return(_dropAreas);
            }

            var rootVisual = (Content as FloatingWindowContentHost).RootVisual;

            foreach (var areaHost in rootVisual.FindVisualChildren <LayoutAnchorablePaneControl>())
            {
                _dropAreas.Add(new DropArea <LayoutAnchorablePaneControl>(
                                   areaHost,
                                   DropAreaType.AnchorablePane));
            }
            foreach (var areaHost in rootVisual.FindVisualChildren <LayoutDocumentPaneControl>())
            {
                _dropAreas.Add(new DropArea <LayoutDocumentPaneControl>(
                                   areaHost,
                                   DropAreaType.DocumentPane));
            }

            return(_dropAreas);
        }
示例#3
0
        /// <summary>
        /// Class constructor from <see cref="LayoutFloatingWindow"/> control that is using this
        /// service to implement its drag and drop (dock) behavior.
        /// </summary>
        /// <param name="floatingWindow"></param>
        public DragService(LayoutFloatingWindowControl floatingWindow)
        {
            _floatingWindow = floatingWindow;
            _manager        = floatingWindow.Model.Root.Manager;

            GetOverlayWindowHosts();
        }
        IOverlayWindow IOverlayWindowHost.ShowOverlayWindow(LayoutFloatingWindowControl draggingWindow)
        {
            CreateOverlayWindow();
            _overlayWindow.Owner = draggingWindow;
            _overlayWindow.EnableDropTargets();
            _overlayWindow.Show();

            return(_overlayWindow);
        }
示例#5
0
            public FloatingWindowContentHost(LayoutFloatingWindowControl owner)
            {
                _owner = owner;
                var manager = _owner.Model.Root.Manager;

                var binding = new Binding("SizeToContent")
                {
                    Source = _owner
                };

                BindingOperations.SetBinding(this, FloatingWindowContentHost.SizeToContentProperty, binding);
            }
示例#6
0
        IEnumerable<IDropArea> IOverlayWindowHost.GetDropAreas(LayoutFloatingWindowControl draggingWindow)
        {
            if (_areas != null)
                return _areas;

            bool isDraggingDocuments = draggingWindow.Model is LayoutDocumentFloatingWindow;

            _areas = new List<IDropArea>();

            if (!isDraggingDocuments)
            {
                _areas.Add(new DropArea<DockingManager>(
                    this,
                    DropAreaType.DockingManager));

                foreach (var areaHost in this.FindVisualChildren<LayoutAnchorablePaneControl>())
                {
                    if (areaHost.Model.Descendents().Any())
                    {
                        _areas.Add(new DropArea<LayoutAnchorablePaneControl>(
                            areaHost,
                            DropAreaType.AnchorablePane));
                    }
                }
            }

            foreach (var areaHost in this.FindVisualChildren<LayoutDocumentPaneControl>())
            {
                _areas.Add(new DropArea<LayoutDocumentPaneControl>(
                    areaHost,
                    DropAreaType.DocumentPane));
            }

            foreach (var areaHost in this.FindVisualChildren<LayoutDocumentPaneGroupControl>())
            {
                var documentGroupModel = areaHost.Model as LayoutDocumentPaneGroup;
                if (documentGroupModel.Children.Where(c => c.IsVisible).Count() == 0)
                {
                    _areas.Add(new DropArea<LayoutDocumentPaneGroupControl>(
                        areaHost,
                        DropAreaType.DocumentPaneGroup));
                }
            }

            return _areas;
        }
示例#7
0
 internal void RemoveFloatingWindow(LayoutFloatingWindowControl floatingWindow)
 {
     _fwList.Remove(floatingWindow);
 }
示例#8
0
 /// <inheritdoc cref="IOverlayWindow"/>
 void IOverlayWindow.DragLeave(LayoutFloatingWindowControl floatingWindow)
 {
     Visibility      = System.Windows.Visibility.Hidden;
     _floatingWindow = null;
 }
示例#9
0
 /// <inheritdoc cref="IOverlayWindow"/>
 void IOverlayWindow.DragEnter(LayoutFloatingWindowControl floatingWindow)
 {
     _floatingWindow = floatingWindow;
     EnableDropTargets();
 }
示例#10
0
 void IOverlayWindow.DragLeave(LayoutFloatingWindowControl floatingWindow)
 {
     Visibility = System.Windows.Visibility.Hidden;
     _floatingWindow = null;
 }
示例#11
0
 void IOverlayWindow.DragEnter(LayoutFloatingWindowControl floatingWindow)
 {
     _floatingWindow = floatingWindow;
     EnableDropTargets();
 }
        IOverlayWindow IOverlayWindowHost.ShowOverlayWindow(LayoutFloatingWindowControl draggingWindow)
        {
            CreateOverlayWindow();
            _overlayWindow.Owner = draggingWindow;
            _overlayWindow.EnableDropTargets();
            _overlayWindow.Show();

            return _overlayWindow;
        }
 public FloatingWindowContentHost(LayoutFloatingWindowControl owner)
 {
     _owner = owner;
     var manager = _owner.Model.Root.Manager;
 }
        IEnumerable<IDropArea> IOverlayWindowHost.GetDropAreas(LayoutFloatingWindowControl draggingWindow)
        {
            if (_dropAreas != null)
                return _dropAreas;

            _dropAreas = new List<IDropArea>();

            if (draggingWindow.Model is LayoutDocumentFloatingWindow)
                return _dropAreas;

            var rootVisual = (Content as FloatingWindowContentHost).RootVisual;

            foreach (var areaHost in rootVisual.FindVisualChildren<LayoutAnchorablePaneControl>())
            {
                _dropAreas.Add(new DropArea<LayoutAnchorablePaneControl>(
                    areaHost,
                    DropAreaType.AnchorablePane));
            }
            foreach (var areaHost in rootVisual.FindVisualChildren<LayoutDocumentPaneControl>())
            {
                _dropAreas.Add(new DropArea<LayoutDocumentPaneControl>(
                    areaHost,
                    DropAreaType.DocumentPane));
            }

            return _dropAreas;
        }
示例#15
0
 IOverlayWindow IOverlayWindowHost.ShowOverlayWindow(LayoutFloatingWindowControl draggingWindow)
 {
     //Debug.WriteLine("ShowOverlayWindow");
     CreateOverlayWindow();
     _overlayWindow.Owner = draggingWindow;
     _overlayWindow.EnableDropTargets();
     _overlayWindow.Show();
     return _overlayWindow;
 }
 public FloatingWindowContentHost(LayoutFloatingWindowControl owner)
 {
     _owner = owner;
     var manager = _owner.Model.Root.Manager;
 }
示例#17
0
 void IOverlayWindow.DragEnter(LayoutFloatingWindowControl floatingWindow)
 {
     _floatingWindow = floatingWindow;
     //Visibility = System.Windows.Visibility.Visible;
     EnableDropTargets();
 }