Пример #1
0
        /// <inheritdoc/>
        public override IDock CreateLayout()
        {
            // Documents

            var document1 = new Document1
            {
                Id     = "Document1",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "Document1"
            };

            var document2 = new Document2
            {
                Id     = "Document2",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "Document2"
            };

            var document3 = new Document3
            {
                Id     = "Document3",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "Document3"
            };

            // Left / Top

            var leftTopTool1 = new LeftTopTool1
            {
                Id     = "LeftTop1",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "LeftTop1"
            };

            var leftTopTool2 = new LeftTopTool2
            {
                Id     = "LeftTop2",
                Width  = 200,
                Height = 200,
                Title  = "LeftTop2"
            };

            var leftTopTool3 = new LeftTopTool3
            {
                Id     = "LeftTop3",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "LeftTop3"
            };

            // Left / Bottom

            var leftBottomTool1 = new LeftBottomTool1
            {
                Id     = "LeftBottom1",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "LeftBottom1"
            };

            var leftBottomTool2 = new LeftBottomTool2
            {
                Id     = "LeftBottom2",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "LeftBottom2"
            };

            var leftBottomTool3 = new LeftBottomTool3
            {
                Id     = "LeftBottom3",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "LeftBottom3"
            };

            // Right / Top

            var rightTopTool1 = new RightTopTool1
            {
                Id     = "RightTop1",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "RightTop1"
            };

            var rightTopTool2 = new RightTopTool2
            {
                Id     = "RightTop2",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "RightTop2"
            };

            var rightTopTool3 = new RightTopTool3
            {
                Id     = "RightTop3",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "RightTop3"
            };

            // Right / Bottom

            var rightBottomTool1 = new RightBottomTool1
            {
                Id     = "RightBottom1",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "RightBottom1"
            };

            var rightBottomTool2 = new RightBottomTool2
            {
                Id     = "RightBottom2",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "RightBottom2"
            };

            var rightBottomTool3 = new RightBottomTool3
            {
                Id     = "RightBottom3",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "RightBottom3"
            };

            // Left Pane

            var leftPane = new LayoutDock
            {
                Id          = "LeftPane",
                Dock        = "Left",
                Width       = 200,
                Height      = double.NaN,
                Title       = "LeftPane",
                CurrentView = null,
                Views       = CreateList <IView>
                              (
                    new ToolDock
                {
                    Id          = "LeftPaneTop",
                    Dock        = "Top",
                    Width       = double.NaN,
                    Height      = 340,
                    Title       = "LeftPaneTop",
                    CurrentView = leftTopTool1,
                    Views       = CreateList <IView>
                                  (
                        leftTopTool1,
                        leftTopTool2,
                        leftTopTool3
                                  )
                },
                    new SplitterDock()
                {
                    Id    = "LeftPaneTopSplitter",
                    Dock  = "Top",
                    Title = "LeftPaneTopSplitter"
                },
                    new ToolDock
                {
                    Id          = "LeftPaneBottom",
                    Dock        = "Bottom",
                    Width       = double.NaN,
                    Height      = double.NaN,
                    Title       = "LeftPaneBottom",
                    CurrentView = leftBottomTool1,
                    Views       = CreateList <IView>
                                  (
                        leftBottomTool1,
                        leftBottomTool2,
                        leftBottomTool3
                                  )
                }
                              )
            };

            // Right Pane

            var rightPane = new LayoutDock
            {
                Id          = "RightPane",
                Dock        = "Right",
                Width       = 240,
                Height      = double.NaN,
                Title       = "RightPane",
                CurrentView = null,
                Views       = CreateList <IView>
                              (
                    new ToolDock
                {
                    Id          = "RightPaneTop",
                    Dock        = "Top",
                    Width       = double.NaN,
                    Height      = 340,
                    Title       = "RightPaneTop",
                    CurrentView = rightTopTool1,
                    Views       = CreateList <IView>
                                  (
                        rightTopTool1,
                        rightTopTool2,
                        rightTopTool3
                                  )
                },
                    new SplitterDock()
                {
                    Id    = "RightPaneTopSplitter",
                    Dock  = "Top",
                    Title = "RightPaneTopSplitter"
                },
                    new ToolDock
                {
                    Id          = "RightPaneBottom",
                    Dock        = "Bottom",
                    Width       = double.NaN,
                    Height      = double.NaN,
                    Title       = "RightPaneBottom",
                    CurrentView = rightBottomTool1,
                    Views       = CreateList <IView>
                                  (
                        rightBottomTool1,
                        rightBottomTool2,
                        rightBottomTool3
                                  )
                }
                              )
            };

            // Documents

            var documentsPane = new DocumentDock
            {
                Id          = "DocumentsPane",
                Dock        = "",
                Width       = double.NaN,
                Height      = double.NaN,
                Title       = "DocumentsPane",
                CurrentView = document1,
                Views       = CreateList <IView>
                              (
                    document1,
                    document2,
                    document3
                              )
            };

            // Main

            var mainLayout = new LayoutDock
            {
                Id          = "MainLayout",
                Dock        = "",
                Width       = double.NaN,
                Height      = double.NaN,
                Title       = "MainLayout",
                CurrentView = null,
                Views       = CreateList <IView>
                              (
                    leftPane,
                    new SplitterDock()
                {
                    Id    = "LeftSplitter",
                    Dock  = "Left",
                    Title = "LeftSplitter"
                },
                    rightPane,
                    new SplitterDock()
                {
                    Id    = "RightSplitter",
                    Dock  = "Right",
                    Title = "RightSplitter"
                },
                    documentsPane
                              )
            };

            var mainView = new MainView
            {
                Id          = "Main",
                Width       = double.NaN,
                Height      = double.NaN,
                Title       = "Main",
                CurrentView = mainLayout,
                Views       = CreateList <IView>
                              (
                    mainLayout
                              )
            };

            // Home

            var homeView = new HomeView
            {
                Id     = "Home",
                Width  = double.NaN,
                Height = double.NaN,
                Title  = "Home"
            };

            // Root

            var root = new RootDock
            {
                Id          = "Root",
                Width       = double.NaN,
                Height      = double.NaN,
                Title       = "Root",
                CurrentView = homeView,
                DefaultView = homeView,
                Views       = CreateList <IView>(homeView, mainView)
            };

            return(root);
        }
Пример #2
0
        public override IDock CreateLayout()
        {
            var document1 = new Document1
            {
                Id    = "Document1",
                Title = "Document1"
            };

            var document2 = new Document2
            {
                Id    = "Document2",
                Title = "Document2"
            };

            var document3 = new Document3
            {
                Id    = "Document3",
                Title = "Document3"
            };

            var leftTopTool1 = new LeftTopTool1
            {
                Id    = "LeftTop1",
                Title = "LeftTop1"
            };

            var leftTopTool2 = new LeftTopTool2
            {
                Id    = "LeftTop2",
                Title = "LeftTop2"
            };

            var leftTopTool3 = new LeftTopTool3
            {
                Id    = "LeftTop3",
                Title = "LeftTop3"
            };

            var leftBottomTool1 = new LeftBottomTool1
            {
                Id    = "LeftBottom1",
                Title = "LeftBottom1"
            };

            var leftBottomTool2 = new LeftBottomTool2
            {
                Id    = "LeftBottom2",
                Title = "LeftBottom2"
            };

            var leftBottomTool3 = new LeftBottomTool3
            {
                Id    = "LeftBottom3",
                Title = "LeftBottom3"
            };

            var rightTopTool1 = new RightTopTool1
            {
                Id    = "RightTop1",
                Title = "RightTop1"
            };

            var rightTopTool2 = new RightTopTool2
            {
                Id    = "RightTop2",
                Title = "RightTop2"
            };

            var rightTopTool3 = new RightTopTool3
            {
                Id    = "RightTop3",
                Title = "RightTop3"
            };

            var rightBottomTool1 = new RightBottomTool1
            {
                Id    = "RightBottom1",
                Title = "RightBottom1"
            };

            var rightBottomTool2 = new RightBottomTool2
            {
                Id    = "RightBottom2",
                Title = "RightBottom2"
            };

            var rightBottomTool3 = new RightBottomTool3
            {
                Id    = "RightBottom3",
                Title = "RightBottom3"
            };

            var mainLayout = new LayoutDock
            {
                Id          = "MainLayout",
                Title       = "MainLayout",
                Proportion  = double.NaN,
                Orientation = Orientation.Horizontal,
                CurrentView = null,
                Views       = CreateList <IView>
                              (
                    new LayoutDock
                {
                    Id          = "LeftPane",
                    Title       = "LeftPane",
                    Proportion  = double.NaN,
                    Orientation = Orientation.Vertical,
                    CurrentView = null,
                    Views       = CreateList <IView>
                                  (
                        new ToolDock
                    {
                        Id          = "LeftPaneTop",
                        Title       = "LeftPaneTop",
                        Proportion  = double.NaN,
                        CurrentView = leftTopTool1,
                        Views       = CreateList <IView>
                                      (
                            leftTopTool1,
                            leftTopTool2,
                            leftTopTool3
                                      )
                    },
                        new SplitterDock()
                    {
                        Id    = "LeftPaneTopSplitter",
                        Title = "LeftPaneTopSplitter"
                    },
                        new ToolDock
                    {
                        Id          = "LeftPaneBottom",
                        Title       = "LeftPaneBottom",
                        Proportion  = double.NaN,
                        CurrentView = leftBottomTool1,
                        Views       = CreateList <IView>
                                      (
                            leftBottomTool1,
                            leftBottomTool2,
                            leftBottomTool3
                                      )
                    }
                                  )
                },
                    new SplitterDock()
                {
                    Id    = "LeftSplitter",
                    Title = "LeftSplitter"
                },
                    new DocumentDock
                {
                    Id          = "DocumentsPane",
                    Title       = "DocumentsPane",
                    Proportion  = double.NaN,
                    CurrentView = document1,
                    Views       = CreateList <IView>
                                  (
                        document1,
                        document2,
                        document3
                                  )
                },
                    new SplitterDock()
                {
                    Id    = "RightSplitter",
                    Title = "RightSplitter"
                },
                    new LayoutDock
                {
                    Id          = "RightPane",
                    Title       = "RightPane",
                    Proportion  = double.NaN,
                    Orientation = Orientation.Vertical,
                    CurrentView = null,
                    Views       = CreateList <IView>
                                  (
                        new ToolDock
                    {
                        Id          = "RightPaneTop",
                        Title       = "RightPaneTop",
                        Proportion  = double.NaN,
                        CurrentView = rightTopTool1,
                        Views       = CreateList <IView>
                                      (
                            rightTopTool1,
                            rightTopTool2,
                            rightTopTool3
                                      )
                    },
                        new SplitterDock()
                    {
                        Id    = "RightPaneTopSplitter",
                        Title = "RightPaneTopSplitter"
                    },
                        new ToolDock
                    {
                        Id          = "RightPaneBottom",
                        Title       = "RightPaneBottom",
                        Proportion  = double.NaN,
                        CurrentView = rightBottomTool1,
                        Views       = CreateList <IView>
                                      (
                            rightBottomTool1,
                            rightBottomTool2,
                            rightBottomTool3
                                      )
                    }
                                  )
                }
                              )
            };

            var mainView = new MainView
            {
                Id          = "Main",
                Title       = "Main",
                CurrentView = mainLayout,
                Views       = CreateList <IView>(mainLayout)
            };

            var homeView = new HomeView
            {
                Id    = "Home",
                Title = "Home"
            };

            var root = CreateRootDock();

            root.Id               = "Root";
            root.Title            = "Root";
            root.CurrentView      = homeView;
            root.DefaultView      = homeView;
            root.Views            = CreateList <IView>(homeView, mainView);
            root.Top              = CreatePinDock();
            root.Top.Alignment    = Alignment.Top;
            root.Bottom           = CreatePinDock();
            root.Bottom.Alignment = Alignment.Bottom;
            root.Left             = CreatePinDock();
            root.Left.Alignment   = Alignment.Left;
            root.Right            = CreatePinDock();
            root.Right.Alignment  = Alignment.Right;

            return(root);
        }