internal DocumentPaneControlOverlayArea(
     IOverlayWindow overlayWindow,
     LayoutDocumentPaneControl documentPaneControl)
     : base(overlayWindow)
 {
     _documentPaneControl = documentPaneControl;
     base.SetScreenDetectionArea(new Rect(_documentPaneControl.PointToScreenDPI(new Point()), _documentPaneControl.TransformActualSizeToAncestor()));
 }
Example #2
0
        internal DocumentPaneControlOverlayArea(IOverlayWindow overlayWindow, LayoutDocumentPaneControl documentPaneControl) : base(overlayWindow)
        {
            this._documentPaneControl = documentPaneControl;
            LayoutDocumentPaneControl layoutDocumentPaneControl = this._documentPaneControl;
            Point point = new Point();

            base.SetScreenDetectionArea(new Rect(layoutDocumentPaneControl.PointToScreenDPI(point), this._documentPaneControl.TransformActualSizeToAncestor()));
        }
 internal DocumentPaneControlOverlayArea(
     IOverlayWindow overlayWindow,
     LayoutDocumentPaneControl documentPaneControl)
     : base(overlayWindow)
 {
     _documentPaneControl = documentPaneControl;
     base.SetScreenDetectionArea(new Rect(
         _documentPaneControl.PointToScreenDPI(new Point()),
         _documentPaneControl.TransformActualSizeToAncestor()));
 }
Example #4
0
 /// <summary>
 /// Cette méthode est excécuté lorsqu'on fait un click droit sur l'entête
 /// d'une page de l'éditeur.
 /// La page en question est activée.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void OnRightClick(object sender, System.Windows.Input.MouseButtonEventArgs e)
 {
     if (e.OriginalSource != null && e.OriginalSource is TextBlock)
     {
         string title = ((TextBlock)e.OriginalSource).Text;
         if (string.IsNullOrEmpty(title))
         {
             return;
         }
         if (e.Source is Xceed.Wpf.AvalonDock.Controls.LayoutDocumentPaneControl)
         {
             Xceed.Wpf.AvalonDock.Controls.LayoutDocumentPaneControl source = (Xceed.Wpf.AvalonDock.Controls.LayoutDocumentPaneControl)e.Source;
             if (source.Model == null)
             {
                 return;
             }
             if (source.Model is IEditor)
             {
                 ((IEditor)source.Model).selectePage(title);
             }
         }
     }
 }
        internal UIElement CreateUIElementForModel(ILayoutElement model)
        {
            if (model is LayoutPanel)
                return new LayoutPanelControl(model as LayoutPanel);
            if (model is LayoutAnchorablePaneGroup)
                return new LayoutAnchorablePaneGroupControl(model as LayoutAnchorablePaneGroup);
            if (model is LayoutDocumentPaneGroup)
                return new LayoutDocumentPaneGroupControl(model as LayoutDocumentPaneGroup);

            if (model is LayoutAnchorSide)
            {
                var templateModelView = new LayoutAnchorSideControl(model as LayoutAnchorSide);
                templateModelView.SetBinding(LayoutAnchorSideControl.TemplateProperty, new Binding("AnchorSideTemplate") { Source = this });
                return templateModelView;
            }
            if (model is LayoutAnchorGroup)
            {
                var templateModelView = new LayoutAnchorGroupControl(model as LayoutAnchorGroup);
                templateModelView.SetBinding(LayoutAnchorGroupControl.TemplateProperty, new Binding("AnchorGroupTemplate") { Source = this });
                return templateModelView;
            }

            if (model is LayoutDocumentPane)
            {
                var templateModelView = new LayoutDocumentPaneControl(model as LayoutDocumentPane);
                templateModelView.SetBinding(LayoutDocumentPaneControl.StyleProperty, new Binding("DocumentPaneControlStyle") { Source = this });
                return templateModelView;
            }
            if (model is LayoutAnchorablePane)
            {
                var templateModelView = new LayoutAnchorablePaneControl(model as LayoutAnchorablePane);
                templateModelView.SetBinding(LayoutAnchorablePaneControl.StyleProperty, new Binding("AnchorablePaneControlStyle") { Source = this });
                return templateModelView;
            }

            if (model is LayoutAnchorableFloatingWindow)
            {
                if (DesignerProperties.GetIsInDesignMode(this))
                    return null;
                var modelFW = model as LayoutAnchorableFloatingWindow;
                var newFW = new LayoutAnchorableFloatingWindowControl(modelFW)
                {
                    //Owner = Window.GetWindow(this)
                };
                newFW.SetParentToMainWindowOf(this);

                var paneForExtensions = modelFW.RootPanel.Children.OfType<LayoutAnchorablePane>().FirstOrDefault();
                if (paneForExtensions != null)
                {
                    //ensure that floating window position is inside current (or nearest) monitor
                    paneForExtensions.KeepInsideNearestMonitor();

                    newFW.Left = paneForExtensions.FloatingLeft;
                    newFW.Top = paneForExtensions.FloatingTop;
                    newFW.Width = paneForExtensions.FloatingWidth;
                    newFW.Height = paneForExtensions.FloatingHeight;
                }

                newFW.ShowInTaskbar = false;
                newFW.Show();
                // Do not set the WindowState before showing or it will be lost
                if( paneForExtensions != null && paneForExtensions.IsMaximized )
                {
                  newFW.WindowState = WindowState.Maximized;
                }
                return newFW;
            }

            if (model is LayoutDocumentFloatingWindow)
            {
                if (DesignerProperties.GetIsInDesignMode(this))
                    return null;
                var modelFW = model as LayoutDocumentFloatingWindow;
                var newFW = new LayoutDocumentFloatingWindowControl(modelFW)
                {
                    //Owner = Window.GetWindow(this)
                };
                newFW.SetParentToMainWindowOf(this);

                var paneForExtensions = modelFW.RootDocument;
                if (paneForExtensions != null)
                {
                    //ensure that floating window position is inside current (or nearest) monitor
                    paneForExtensions.KeepInsideNearestMonitor();

                    newFW.Left = paneForExtensions.FloatingLeft;
                    newFW.Top = paneForExtensions.FloatingTop;
                    newFW.Width = paneForExtensions.FloatingWidth;
                    newFW.Height = paneForExtensions.FloatingHeight;
                }

                newFW.ShowInTaskbar = false;
                newFW.Show();
                // Do not set the WindowState before showing or it will be lost
                if( paneForExtensions != null && paneForExtensions.IsMaximized )
                {
                  newFW.WindowState = WindowState.Maximized;
                }
                return newFW;
            }

            if (model is LayoutDocument)
            {
                var templateModelView = new LayoutDocumentControl() { Model = model as LayoutDocument };
                return templateModelView;
            }

            return null;
        }