Example #1
0
        public override IDockable Clone()
        {
            var projectVM = new ProjectViewportVM();

            CloneHelper.CloneDockProperties(this, projectVM);
            CloneHelper.CloneRootDockProperties(this, projectVM);

            return(projectVM);
        }
        public override IDock CreateLayout()
        {
            var languagesVM = new LanguagesVM()
            {
                Id = nameof(LanguagesVM)
            };
            var propertiesVM = new PropertiesVM()
            {
                Id = nameof(PropertiesVM)
            };
            var executeVM = new ExecuteVM()
            {
                Id = nameof(ExecuteVM)
            };
            var resultListVM = new ResultListVM()
            {
                Id = nameof(ResultListVM)
            };

            var mainLayout = new ProportionalDock
            {
                Id               = DockableExplorerLocator.IdUniversalDock,
                Orientation      = Orientation.Horizontal,
                Proportion       = double.NaN,
                ActiveDockable   = null,
                VisibleDockables = CreateList <IDockable>
                                   (
                    new ProportionalDock
                {
                    Orientation      = Orientation.Vertical,
                    Proportion       = 0.8,
                    ActiveDockable   = null,
                    VisibleDockables = CreateList <IDockable>
                                       (
                        new DocumentDock
                    {
                        Id               = DockableExplorerLocator.IdResultsDock,
                        IsCollapsable    = false,
                        ActiveDockable   = null,
                        VisibleDockables = CreateList <IDockable>()
                    },
                        new SplitterDock(),
                        new ToolDock
                    {
                        Id               = DockableExplorerLocator.IdExecuteDock,
                        ActiveDockable   = executeVM,
                        Proportion       = 0.2,
                        VisibleDockables = CreateList <IDockable>(executeVM)
                    }
                                       )
                },
                    new SplitterDock(),
                    new ProportionalDock
                {
                    Orientation      = Orientation.Vertical,
                    Proportion       = double.NaN,
                    ActiveDockable   = null,
                    VisibleDockables = CreateList <IDockable>
                                       (
                        new ToolDock
                    {
                        Id =
                            DockableExplorerLocator.IdResultListDock +
                            " " +
                            DockableExplorerLocator.IdLanguagesDock,
                        ActiveDockable   = resultListVM,
                        VisibleDockables = CreateList <IDockable>(resultListVM, languagesVM)
                    },
                        new SplitterDock(),
                        new ToolDock
                    {
                        Id               = DockableExplorerLocator.IdPropertiesDock,
                        ActiveDockable   = propertiesVM,
                        VisibleDockables = CreateList <IDockable>(propertiesVM)
                    }
                                       )
                }
                                   )
            };

            var projectView = new ProjectViewportVM
            {
                Id               = "Project",
                Title            = "Project",
                ActiveDockable   = mainLayout,
                VisibleDockables = CreateList <IDockable>(mainLayout)
            };

            var root = CreateRootDock();

            root.ActiveDockable   = projectView;
            root.DefaultDockable  = projectView;
            root.VisibleDockables = CreateList <IDockable>(projectView);

            return(root);
        }