Esempio n. 1
0
        public DragService(LayoutFloatingWindowControl floatingWindow)
        {
            _floatingWindow = floatingWindow;
            _manager = floatingWindow.Model.Root.Manager;

            GetOverlayWindowHosts();
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        public DragService(LayoutFloatingWindowControl floatingWindow)
        {
            _floatingWindow = floatingWindow;
            _manager        = floatingWindow.Model.Root.Manager;


            GetOverlayWindowHosts();
        }
Esempio n. 4
0
 void IOverlayWindow.DragEnter(LayoutFloatingWindowControl floatingWindow)
 {
     _floatingWindow = floatingWindow;
     if (_host.Manager.CanRelocateWindow)
     {
         EnableDropTargets();
     }
 }
Esempio n. 5
0
        IOverlayWindow IOverlayWindowHost.ShowOverlayWindow(LayoutFloatingWindowControl draggingWindow)
        {
            CreateOverlayWindow();
            _overlayWindow.Owner = draggingWindow;
            _overlayWindow.EnableDropTargets();
            _overlayWindow.Show();

            return(_overlayWindow);
        }
Esempio n. 6
0
        private void OnLoaded(object sender, RoutedEventArgs e)
        {
            base.Loaded -= new RoutedEventHandler(this.OnLoaded);
            this.SetParentToMainWindowOf(this.Model.Root.Manager);
            this._hwndSrc = PresentationSource.FromDependencyObject(this) as HwndSource;
            LayoutFloatingWindowControl layoutFloatingWindowControl = this;

            this._hwndSrcHook = new HwndSourceHook(layoutFloatingWindowControl.FilterMessage);
            this._hwndSrc.AddHook(this._hwndSrcHook);
            this.UpdateMaximizedState(this.Model.Descendents().OfType <ILayoutElementForFloatingWindow>().Any <ILayoutElementForFloatingWindow>((ILayoutElementForFloatingWindow l) => l.IsMaximized));
        }
Esempio n. 7
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);
            }
        IEnumerable <IDropArea> IOverlayWindowHost.GetDropAreas(LayoutFloatingWindowControl draggingWindow)
        {
            if (_dropAreas != null)
            {
                return(_dropAreas);
            }

            var draggingWindowManager = draggingWindow.Model.Root.Manager;

            _dropAreas = new List <IDropArea>();

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

            var rootVisual = this.Content as System.Windows.Media.Visual;

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

            return(_dropAreas);
        }
Esempio n. 9
0
 public FloatingWindowContentHost(LayoutFloatingWindowControl owner)
 {
     _owner = owner;
     var manager = _owner.Model.Root.Manager;
 }
Esempio n. 10
0
 IOverlayWindow Xceed.Wpf.AvalonDock.Controls.IOverlayWindowHost.ShowOverlayWindow(LayoutFloatingWindowControl draggingWindow)
 {
     this.CreateOverlayWindow();
     this._overlayWindow.Owner = draggingWindow;
     this._overlayWindow.EnableDropTargets();
     this._overlayWindow.Show();
     return(this._overlayWindow);
 }
 void IOverlayWindow.DragEnter(LayoutFloatingWindowControl floatingWindow)
 {
     _floatingWindow = floatingWindow;
     EnableDropTargets();
 }
 internal void RemoveFloatingWindow(LayoutFloatingWindowControl floatingWindow)
 {
     _fwList.Remove(floatingWindow);
 }
Esempio n. 13
0
 void Xceed.Wpf.AvalonDock.Controls.IOverlayWindow.DragLeave(LayoutFloatingWindowControl floatingWindow)
 {
     base.Visibility      = System.Windows.Visibility.Hidden;
     this._floatingWindow = null;
 }
Esempio n. 14
0
 void Xceed.Wpf.AvalonDock.Controls.IOverlayWindow.DragEnter(LayoutFloatingWindowControl floatingWindow)
 {
     this._floatingWindow = floatingWindow;
     this.EnableDropTargets();
 }
Esempio n. 15
0
 public FloatingWindowContentHost(LayoutFloatingWindowControl owner)
 {
     this._owner = owner;
     DockingManager manager = this._owner.Model.Root.Manager;
 }
Esempio n. 16
0
 void IOverlayWindow.DragEnter(LayoutFloatingWindowControl floatingWindow)
 {
     _floatingWindow = floatingWindow;
     EnableDropTargets();
 }
Esempio n. 17
0
 void IOverlayWindow.DragLeave(LayoutFloatingWindowControl floatingWindow)
 {
     Visibility      = System.Windows.Visibility.Hidden;
     _floatingWindow = null;
 }
        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;
        }
 void IOverlayWindow.DragLeave(LayoutFloatingWindowControl floatingWindow)
 {
     Visibility = System.Windows.Visibility.Hidden;
     _floatingWindow = null;
 }
 IOverlayWindow IOverlayWindowHost.ShowOverlayWindow(LayoutFloatingWindowControl draggingWindow)
 {
     //Trace.WriteLine("ShowOverlayWindow");
     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;
        }
        IOverlayWindow IOverlayWindowHost.ShowOverlayWindow(LayoutFloatingWindowControl draggingWindow)
        {
            CreateOverlayWindow();
            _overlayWindow.Owner = draggingWindow;
            _overlayWindow.EnableDropTargets();
            _overlayWindow.Show();

            return _overlayWindow;
        }
Esempio n. 24
0
        IEnumerable <IDropArea> Xceed.Wpf.AvalonDock.Controls.IOverlayWindowHost.GetDropAreas(LayoutFloatingWindowControl draggingWindow)
        {
            if (this._dropAreas != null)
            {
                return(this._dropAreas);
            }
            this._dropAreas = new List <IDropArea>();
            if (draggingWindow.Model is LayoutDocumentFloatingWindow)
            {
                return(this._dropAreas);
            }
            Visual rootVisual = (base.Content as LayoutFloatingWindowControl.FloatingWindowContentHost).RootVisual;

            foreach (LayoutAnchorablePaneControl layoutAnchorablePaneControl in rootVisual.FindVisualChildren <LayoutAnchorablePaneControl>())
            {
                this._dropAreas.Add(new DropArea <LayoutAnchorablePaneControl>(layoutAnchorablePaneControl, DropAreaType.AnchorablePane));
            }
            foreach (LayoutDocumentPaneControl layoutDocumentPaneControl in rootVisual.FindVisualChildren <LayoutDocumentPaneControl>())
            {
                this._dropAreas.Add(new DropArea <LayoutDocumentPaneControl>(layoutDocumentPaneControl, DropAreaType.DocumentPane));
            }
            return(this._dropAreas);
        }