public override IRootDock CreateLayout() { var mainDocumentsDock = new DocumentDock { Id = ShellDockIds.Documents, Title = "Documents", IsCollapsable = false, VisibleDockables = CreateList <IDockable>() }; var mainLayout = new ProportionalDock { Id = "MainLayout", Title = "MainLayout", Orientation = Orientation.Horizontal, ActiveDockable = null, VisibleDockables = base.CreateList <IDockable> ( mainDocumentsDock ) }; var mainLayoutVertical = new ProportionalDock { Id = "MainLayoutVertical", Title = "MainLayoutVertical", Orientation = Orientation.Vertical, ActiveDockable = null, VisibleDockables = base.CreateList <IDockable> ( mainLayout ) }; var rootDock = CreateRootDock(); rootDock.Id = ShellDockIds.RootDock; rootDock.Title = ShellDockIds.RootDock; rootDock.ActiveDockable = mainLayoutVertical; rootDock.DefaultDockable = mainLayoutVertical; rootDock.IsFocusableRoot = true; rootDock.VisibleDockables = CreateList <IDockable>(mainLayoutVertical); this.rootDock = rootDock; this.mainLayout = mainLayout; this.mainLayoutVertical = mainLayoutVertical; this.mainDocumentsDock = mainDocumentsDock; return(rootDock); }
private Task InstantiateNewToolWindow(object parameter) { ToolWindowFactoryInfo factoryInfo = (ToolWindowFactoryInfo)parameter; BaseToolWindow toolWindow = ConstructToolWindow(factoryInfo); IDockable toolWindowDock = null; if (factoryInfo.ToolWindowAttribute.ToolWindowType == ToolWindowType.Document) { toolWindowDock = new DocumentDock() { Proportion = Double.NaN, ActiveDockable = toolWindow, VisibleDockables = CreateList <IDockable>(toolWindow) }; } else { toolWindowDock = new ToolDock() { Proportion = Double.NaN, ActiveDockable = toolWindow, VisibleDockables = CreateList <IDockable>(toolWindow) }; } toolWindowDock.Id = factoryInfo.ToolWindowAttribute.DisplayName; toolWindowDock.Title = factoryInfo.ToolWindowAttribute.DisplayName; var window = CreateWindowFrom(toolWindowDock); window.Owner = _rootDock; window.Factory = this; // REEEEEEEEEEE why is there no f*****g documentation for this f*****g library? AddWindow(_rootDock, window); // DO NOT set this boolean to true. Don't do it. Trust me. window.Present(false); return(Task.CompletedTask); }
public override IDock CreateLayout() { Tools = new ToolDock(); Documents = new DocumentDock(); return(new RootDock { // We delegate the rendering of tabs to the ViewDataTemplate VisibleDockables = new AvaloniaList <IDockable> { new ProportionalDock { VisibleDockables = new AvaloniaList <IDockable> { Tools, new SplitterDock(), Documents, } } } }); }
public void DocumentDock_Ctor() { var actual = new DocumentDock(); Assert.NotNull(actual); }
/// <inheritdoc/> public override IDock CreateLayout() { // Documents var pageDocument = new PageDocument { Id = nameof(PageDocument), Title = "Page" }; // Tools var projectTool = new ProjectTool { Id = nameof(ProjectTool), Title = "Project" }; var optionsTool = new OptionsTool { Id = nameof(OptionsTool), Title = "Options" }; var imagesTool = new ImagesTool { Id = nameof(ImagesTool), Title = "Images" }; var groupsTool = new GroupsTool { Id = nameof(GroupsTool), Title = "Groups" }; var databasesTool = new DatabasesTool { Id = nameof(DatabasesTool), Title = "Databases" }; var scriptTool = new ScriptTool { Id = nameof(ScriptTool), Title = "Script" }; var browserTool = new BrowserTool { Id = nameof(BrowserTool), Title = "Browser" }; var stylesTool = new StylesTool { Id = nameof(StylesTool), Title = "Styles" }; var templatesTool = new TemplatesTool { Id = nameof(TemplatesTool), Title = "Templates" }; var containerTool = new ContainerTool { Id = nameof(ContainerTool), Title = "Container" }; var zoomTool = new ZoomTool { Id = nameof(ZoomTool), Title = "Zoom" }; var shapeTool = new ShapeTool { Id = nameof(ShapeTool), Title = "Shape" }; var toolsTool = new ToolsTool { Id = nameof(ToolsTool), Title = "Tools" }; var dataTool = new DataTool { Id = nameof(DataTool), Title = "Data" }; var styleTool = new StyleTool { Id = nameof(StyleTool), Title = "Style" }; var templateTool = new TemplateTool { Id = nameof(TemplateTool), Title = "Template" }; // Panes var leftPane = new LayoutDock { Id = nameof(ILayoutDock), Title = "EditorLeft", Orientation = Orientation.Vertical, Proportion = 0.17, CurrentView = null, Views = new ObservableCollection <IView> { new ToolDock { Id = nameof(IToolDock), Title = "EditorLeftTop", Proportion = double.NaN, CurrentView = projectTool, Views = new ObservableCollection <IView> { projectTool, optionsTool, imagesTool } }, new SplitterDock() { Id = nameof(ISplitterDock), Title = "LeftTopSplitter" }, new ToolDock { Id = nameof(IToolDock), Title = "EditorLeftBottom", Proportion = double.NaN, CurrentView = groupsTool, Views = new ObservableCollection <IView> { groupsTool, databasesTool, scriptTool, browserTool } } } }; var rightPane = new LayoutDock { Id = nameof(ILayoutDock), Title = "EditorRight", Orientation = Orientation.Vertical, Proportion = 0.17, CurrentView = null, Views = new ObservableCollection <IView> { new ToolDock { Id = nameof(IToolDock), Title = "EditorRightTop", Proportion = double.NaN, CurrentView = stylesTool, Views = new ObservableCollection <IView> { stylesTool, templatesTool, containerTool, zoomTool } }, new SplitterDock() { Id = nameof(ISplitterDock), Title = "RightTopSplitter" }, new ToolDock { Id = nameof(IToolDock), Title = "EditorRightBottom", Proportion = double.NaN, CurrentView = shapeTool, Views = new ObservableCollection <IView> { shapeTool, toolsTool, dataTool, styleTool, templateTool } } } }; var documentsPane = new DocumentDock { Id = nameof(IDocumentDock), Title = "DocumentsPane", Proportion = double.NaN, CurrentView = pageDocument, Views = new ObservableCollection <IView> { pageDocument } }; // Editor var editorLayout = new LayoutDock { Id = nameof(ILayoutDock), Title = "EditorLayout", Orientation = Orientation.Horizontal, Proportion = double.NaN, CurrentView = null, Views = new ObservableCollection <IView> { leftPane, new SplitterDock() { Id = nameof(ISplitterDock), Title = "LeftSplitter" }, documentsPane, new SplitterDock() { Id = nameof(ISplitterDock), Title = "RightSplitter" }, rightPane } }; // Views var editorView = new EditorView { Id = nameof(EditorView), Title = "Editor", CurrentView = editorLayout, Views = new ObservableCollection <IView> { editorLayout } }; var aboutView = new AboutView { Id = nameof(AboutView), Title = "About" }; var browserView = new BrowserView { Id = nameof(BrowserView), Title = "Browser" }; var scriptView = new ScriptView { Id = nameof(ScriptView), Title = "Script" }; var documentView = new DocumentView { Id = nameof(DocumentView), Title = "Document" }; var dashboardView = new DashboardView { Id = nameof(DashboardView), Title = "Dashboard" }; // Root var layout = new RootDock { Id = nameof(IRootDock), Title = "Root", CurrentView = dashboardView, DefaultView = dashboardView, Views = new ObservableCollection <IView> { dashboardView, editorView, aboutView, browserView, scriptView, documentView } }; return(layout); }
public override IRootDock CreateLayout() { var leftFloating = GetDefaultFloatingWindowsByPostion(DefaultFloatingPostion.Left); var rightFloating = GetDefaultFloatingWindowsByPostion(DefaultFloatingPostion.Right); var listDocuments = new List <IDockable>(); foreach (var item in _defaultDocumentTools) { listDocuments.Add(ConstructToolWindow(item.Value)); } var documentDock = new DocumentDock() { Id = "DocumentsPane", Title = "DocumentsPane", Proportion = double.NaN, ActiveDockable = (listDocuments.Count > 0) ? listDocuments[0] : null, VisibleDockables = listDocuments, IsCollapsable = false }; var horizontalDockables = CreateList <IDockable>( documentDock ); if (leftFloating.Count > 0) { horizontalDockables.Insert(0, new ToolDock() { Id = "LeftPaneTop", Title = "LeftPaneTop", Proportion = 1 / 4D, ActiveDockable = leftFloating[0], VisibleDockables = leftFloating }); horizontalDockables.Insert(1, new SplitterDockable() { Id = "LeftSplitter", Title = "LeftSplitter" }); } if (rightFloating.Count > 0) { horizontalDockables.Add(new SplitterDockable() { Id = "RightSplitter", Title = "RightSplitter" }); horizontalDockables.Add(new ToolDock() { Id = "RightPaneTop", Title = "RightPaneTop", Proportion = 1 / 4D, ActiveDockable = rightFloating[0], VisibleDockables = rightFloating }); } IDockable horizontalDock = new ProportionalDock() { Id = "LeftPane", Title = "LeftPane", Proportion = double.NaN, Orientation = Orientation.Horizontal, ActiveDockable = null, VisibleDockables = horizontalDockables }; var mainVisibleDockables = CreateList <IDockable>(horizontalDock); var mainLayout = new ProportionalDock { Id = "MainLayout", Title = "MainLayout", Proportion = double.NaN, Orientation = Orientation.Horizontal, ActiveDockable = null, VisibleDockables = mainVisibleDockables }; var rootViewModel = new RootViewModel() { Id = "Main", Title = "Main", ActiveDockable = mainLayout, VisibleDockables = CreateList <IDockable>(mainLayout) }; var root = CreateRootDock(); root.Id = "Root"; root.Title = "Root"; root.ActiveDockable = rootViewModel; root.DefaultDockable = rootViewModel; root.VisibleDockables = CreateList <IDockable>(rootViewModel); _rootDock = root; return(root); }
public override IRootDock CreateLayout() { var document1 = new TestDocumentViewModel { Id = "Document1", Title = "Document1" }; var document2 = new TestDocumentViewModel { Id = "Document2", Title = "Document2" }; var leftTopTool1 = new LeftTopTool1ViewModel { Id = "LeftTop1", Title = "LeftTop1" }; var leftTopTool2 = new LeftTopTool2ViewModel { Id = "LeftTop2", Title = "LeftTop2" }; var leftBottomTool1 = new LeftBottomTool1ViewModel { Id = "LeftBottom1", Title = "LeftBottom1" }; var leftBottomTool2 = new LeftBottomTool2ViewModel { Id = "LeftBottom2", Title = "LeftBottom2" }; var rightTopTool1 = new RightTopTool1ViewModel { Id = "RightTop1", Title = "RightTop1" }; var rightTopTool2 = new RightTopTool2ViewModel { Id = "RightTop2", Title = "RightTop2" }; var rightBottomTool1 = new RightBottomTool1ViewModel { Id = "RightBottom1", Title = "RightBottom1" }; var rightBottomTool2 = new RightBottomTool2ViewModel { Id = "RightBottom2", Title = "RightBottom2" }; var documentDock = new DocumentDock { Id = "DocumentsPane", Title = "DocumentsPane", Proportion = double.NaN, ActiveDockable = document1, VisibleDockables = CreateList <IDockable> ( document1, document2 ) }; documentDock.CanCreateDocument = true; documentDock.CreateDocument = ReactiveCommand.Create(() => { var index = documentDock.VisibleDockables?.Count + 1; var document = new TestDocumentViewModel { Id = $"Document{index}", Title = $"Document{index}" }; this.AddDockable(documentDock, document); this.SetActiveDockable(document); this.SetFocusedDockable(documentDock, document); }); var mainLayout = new ProportionalDock { Id = "MainLayout", Title = "MainLayout", Proportion = double.NaN, Orientation = Orientation.Horizontal, ActiveDockable = null, VisibleDockables = CreateList <IDockable> ( new ProportionalDock { Id = "LeftPane", Title = "LeftPane", Proportion = double.NaN, Orientation = Orientation.Vertical, ActiveDockable = null, VisibleDockables = CreateList <IDockable> ( new ToolDock { Id = "LeftPaneTop", Title = "LeftPaneTop", Proportion = double.NaN, ActiveDockable = leftTopTool1, VisibleDockables = CreateList <IDockable> ( leftTopTool1, leftTopTool2 ), Alignment = Alignment.Left, GripMode = GripMode.Visible }, new SplitterDockable() { Id = "LeftPaneTopSplitter", Title = "LeftPaneTopSplitter" }, new ToolDock { Id = "LeftPaneBottom", Title = "LeftPaneBottom", Proportion = double.NaN, ActiveDockable = leftBottomTool1, VisibleDockables = CreateList <IDockable> ( leftBottomTool1, leftBottomTool2 ), Alignment = Alignment.Left, GripMode = GripMode.Visible } ) }, new SplitterDockable() { Id = "LeftSplitter", Title = "LeftSplitter" }, documentDock, new SplitterDockable() { Id = "RightSplitter", Title = "RightSplitter" }, new ProportionalDock { Id = "RightPane", Title = "RightPane", Proportion = double.NaN, Orientation = Orientation.Vertical, ActiveDockable = null, VisibleDockables = CreateList <IDockable> ( new ToolDock { Id = "RightPaneTop", Title = "RightPaneTop", Proportion = double.NaN, ActiveDockable = rightTopTool1, VisibleDockables = CreateList <IDockable> ( rightTopTool1, rightTopTool2 ), Alignment = Alignment.Right, GripMode = GripMode.Visible }, new SplitterDockable() { Id = "RightPaneTopSplitter", Title = "RightPaneTopSplitter" }, new ToolDock { Id = "RightPaneBottom", Title = "RightPaneBottom", Proportion = double.NaN, ActiveDockable = rightBottomTool1, VisibleDockables = CreateList <IDockable> ( rightBottomTool1, rightBottomTool2 ), Alignment = Alignment.Right, GripMode = GripMode.Visible } ) } ) }; var mainView = new MainViewModel { Id = "Main", Title = "Main", ActiveDockable = mainLayout, VisibleDockables = CreateList <IDockable>(mainLayout) }; var root = CreateRootDock(); root.Id = "Root"; root.Title = "Root"; root.ActiveDockable = mainView; root.DefaultDockable = mainView; root.VisibleDockables = CreateList <IDockable>(mainView); _documentDock = documentDock; return(root); }
public override IDock CreateLayout() { //var elementTreeDocument = new ElementTreeDocument //{ // Id = "ElementTreeDocument", // Title = "ElementTreeDocument" //}; var elementTreeTool = new ElementTreeTool { Id = "ElementTreeTool", Title = "ElementTreeTool" }; var leftPaneTop = new ToolDock() { Id = "LeftPaneTop", Title = "LeftPaneTop", Proportion = double.NaN, CurrentView = elementTreeTool, Views = CreateList <IView>(elementTreeTool) }; var leftPane = new LayoutDock() { Id = "LeftPane", Title = "LeftPane", Proportion = double.NaN, Orientation = Orientation.Vertical, CurrentView = null, Views = CreateList <IView>(leftPaneTop) }; var leftSplitter = new SplitterDock() { Id = "LeftSplitter", Title = "LeftSplitter" }; var documentsPane = new DocumentDock() { Id = "DocumentsPane", Title = "DocumentsPane", Proportion = double.NaN, CurrentView = null, Views = CreateList <IView>() //CurrentView = elementTreeDocument, //Views = CreateList<IView>(elementTreeDocument) }; var mainLayout = new LayoutDock { Id = "MainLayout", Title = "MainLayout", Proportion = double.NaN, Orientation = Orientation.Horizontal, CurrentView = null, Views = CreateList <IView>(leftPane, leftSplitter, documentsPane) }; var mainView = new MainView { Id = "Main", Title = "Main", CurrentView = mainLayout, Views = CreateList <IView>(mainLayout) }; var root = CreateRootDock(); root.Id = "Root"; root.Title = "Root"; root.CurrentView = mainView; root.DefaultView = mainView; root.Views = CreateList <IView>(mainView); root.Left = CreatePinDock(); root.Left.Alignment = Alignment.Left; AddAllViews(root, mainView, mainLayout, documentsPane, leftSplitter, leftPane, leftPaneTop, elementTreeTool); return(root); }
public override IDock CreateLayout() { var objectExplorer = new ObjectExplorerViewModel { Id = "ObjectExplorer", Title = "ObjectExplorer", }; var documentsWindows = new DocumentDock { Id = "DocumentsPane", Title = "DocumentsPane", Proportion = double.NaN, VisibleDockables = CreateList <IDockable>() }; _context .Queries .ToObservableChangeSet() .Transform(x => { return(new QueryViewModel(x, _context)); }) .ObserveOn(RxApp.MainThreadScheduler) .ActOnEveryObject( added => { bool exists = documentsWindows.VisibleDockables .Select(x => (QueryViewModel)x) .Any(x => x.Id == added.Id); if (exists == false) { if (documentsWindows.ActiveDockable != null) { documentsWindows.VisibleDockables.Insert( documentsWindows.VisibleDockables.IndexOf(documentsWindows.ActiveDockable) + 1, added); } else { documentsWindows.VisibleDockables.Add(added); } this.InitLayout(added); this.InitLayout(documentsWindows); documentsWindows.ActiveDockable = added; } }, removed => { bool exists = documentsWindows.VisibleDockables .Select(x => (QueryViewModel)x) .Any(x => x.Id == removed.Id); if (exists) { documentsWindows.VisibleDockables.Remove(removed); } } ); ((INotifyCollectionChanged)documentsWindows.VisibleDockables).CollectionChanged += new NotifyCollectionChangedEventHandler( (object sender, NotifyCollectionChangedEventArgs e) => { if (e.OldItems != null) { foreach (QueryViewModel view in e.OldItems) { var queryModel = _context.Queries.FirstOrDefault(x => x.Id == view.Id); if (queryModel != null) { _context.Queries.Remove(queryModel); } } } }); documentsWindows .WhenAnyValue(x => x.ActiveDockable) .Subscribe(x => { if (x != null) { _context.SelectedQueryIndex = documentsWindows.VisibleDockables.IndexOf(x); } else { _context.SelectedQueryIndex = -1; } }); _context .WhenAnyValue(x => x.SelectedQueryIndex) .Subscribe(x => { var view = documentsWindows.VisibleDockables.ElementAtOrDefault(x); if (view != null) { documentsWindows.ActiveDockable = view; } }); var bodyLayout = new ProportionalDock { Id = "BodyLayout", Title = "BodyLayout", Proportion = double.NaN, Orientation = Orientation.Horizontal, ActiveDockable = null, VisibleDockables = CreateList <IDockable> ( new ProportionalDock { Id = "LeftPane", Title = "LeftPane", Proportion = double.NaN, Orientation = Orientation.Vertical, ActiveDockable = null, VisibleDockables = CreateList <IDockable> ( new ToolDock { Id = "LeftPaneTop", Title = "LeftPaneTop", Proportion = double.NaN, ActiveDockable = objectExplorer, VisibleDockables = CreateList <IDockable> ( objectExplorer ) } ) }, new SplitterDock() { Id = "LeftSplitter", Title = "LeftSplitter" }, documentsWindows ) }; var root = CreateRootDock(); root.Id = "Root"; root.Title = "Root"; root.ActiveDockable = bodyLayout; root.DefaultDockable = bodyLayout; root.VisibleDockables = CreateList <IDockable>(bodyLayout); 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); }
public override IDock CreateLayout() { var document1 = new LogViewModel { Name = "Log1", Id = "Log1", Title = "Log1" }; var document2 = new LogViewModel { Name = "Log2", Id = "Log2", Title = "Log2" }; var document3 = new LogViewModel { Id = "AllLogs", Title = "All Logs" }; var xmainLayout = new ProportionalDock { Id = "MainLayout", Title = "MainLayout", Proportion = double.NaN, Orientation = Orientation.Horizontal, ActiveDockable = null, VisibleDockables = CreateList <IDockable> ( new ProportionalDock { Id = "LeftPane", Title = "LeftPane", Proportion = double.NaN, Orientation = Orientation.Vertical, ActiveDockable = null, VisibleDockables = CreateList <IDockable> ( new ProportionalDock { Id = "TopLeftPane", Title = "TopLeftPane", Proportion = double.NaN, Orientation = Orientation.Vertical, ActiveDockable = null, VisibleDockables = CreateList <IDockable> ( new DocumentDock { Id = "DocumentsPaneTopLeft", Title = "DocumentsPaneTopLeft", Proportion = double.NaN, ActiveDockable = document1, VisibleDockables = CreateList <IDockable> ( document1 ) } ) }, new ProportionalDock { Id = "BottomLeftPane", Title = "BottomLeftPane", Proportion = double.NaN, Orientation = Orientation.Vertical, ActiveDockable = null, VisibleDockables = CreateList <IDockable> ( new DocumentDock { Id = "DocumentsPaneBottomLeft", Title = "DocumentsPaneBottomLeft", Proportion = double.NaN, ActiveDockable = document2, VisibleDockables = CreateList <IDockable> ( document2 ) } ) } ) }, new DocumentDock { Id = "DocumentsPaneRight", Title = "DocumentsPaneRight", Proportion = double.NaN, ActiveDockable = document3, VisibleDockables = CreateList <IDockable> ( document3 ) } ) }; var mainLayout = new DocumentDock { Id = "DocumentsPane", Title = "DocumentsPane", Proportion = double.NaN, ActiveDockable = document1, VisibleDockables = CreateList <IDockable> ( document1, document2, document3 ) }; var mainView = new MainViewModel { Id = "Main", Title = "Main", ActiveDockable = mainLayout, VisibleDockables = CreateList <IDockable>(mainLayout) }; var root = CreateRootDock(); root.Id = "Root"; root.Title = "Root"; root.ActiveDockable = mainView; root.DefaultDockable = mainView; root.VisibleDockables = CreateList <IDockable>(mainView); return(root); }
public void Initialise(IDockFactory layoutFactory = null) { foreach (var extension in _extensions) { if (extension.Value is IActivatableExtension activatable) { activatable.BeforeActivation(); } } if (layoutFactory == null) { Factory = new DefaultLayoutFactory(); } else { Factory = layoutFactory; } LoadLayout(); Layout.WhenAnyValue(l => l.FocusedView).Subscribe(focused => { if (focused is IDocumentTabViewModel doc) { SelectedDocument = doc; } else { SelectedDocument = null; } }); if (Layout.Factory.ViewLocator.ContainsKey("LeftDock")) { _leftPane = Layout.Factory.ViewLocator["LeftDock"]() as ToolDock; } if (Layout.Factory.ViewLocator.ContainsKey("DocumentDock")) { _documentDock = Layout.Factory.ViewLocator["DocumentDock"]() as DocumentDock; } if (Layout.Factory.ViewLocator.ContainsKey("RightDock")) { _rightPane = Layout.Factory.ViewLocator["RightDock"]() as ToolDock; } if (Layout.Factory.ViewLocator.ContainsKey("BottomDock")) { _bottomPane = Layout.Factory.ViewLocator["BottomDock"]() as ToolDock; } foreach (var extension in _extensions) { if (extension.Value is IActivatableExtension activatable) { activatable.Activation(); } } foreach (var command in _commandService.GetKeyGestures()) { foreach (var keyGesture in command.Value) { _keyBindings.Add(new KeyBinding { Command = command.Key.Command, Gesture = KeyGesture.Parse(keyGesture) }); } } foreach (var tool in _toolControls) { switch (tool.Value.DefaultLocation) { case Location.Bottom: DockView(_bottomPane, tool.Value); break; //case Location.BottomRight: // BottomRightTabs.Tools.Add(tool); // break; //case Location.RightBottom: // RightBottomTabs.Tools.Add(tool); // break; //case Location.RightMiddle: // RightMiddleTabs.Tools.Add(tool); // break; //case Location.RightTop: // RightTopTabs.Tools.Add(tool); // break; //case Location.MiddleTop: // MiddleTopTabs.Tools.Add(tool); // break; case Location.Left: DockView(_leftPane, tool.Value); break; case Location.Right: DockView(_rightPane, tool.Value); break; } } IoC.Get <IStatusBar>().ClearText(); }
public override IDock CreateLayout() { var untitledFileViewModel = new FileViewModel() { Path = string.Empty, Title = "Untitled", Text = "", Encoding = Encoding.Default.WebName }; var findViewModel = new FindViewModel { Id = "Find", Title = "Find" }; var replaceViewModel = new ReplaceViewModel { Id = "Replace", Title = "Replace" }; var files = new DocumentDock { Id = MainWindowViewModel.DocumentsDockId, Title = MainWindowViewModel.DocumentsDockId, IsCollapsable = false, Proportion = double.NaN, ActiveDockable = untitledFileViewModel, VisibleDockables = CreateList <IDockable> ( untitledFileViewModel ) }; var tools = new ProportionalDock { Proportion = 0.2, Orientation = Orientation.Vertical, VisibleDockables = CreateList <IDockable> ( new ToolDock { Proportion = double.NaN, ActiveDockable = findViewModel, VisibleDockables = CreateList <IDockable> ( findViewModel ) }, new SplitterDock(), new ToolDock { Proportion = double.NaN, ActiveDockable = replaceViewModel, VisibleDockables = CreateList <IDockable> ( replaceViewModel ) } ) }; var windowLayout = CreateRootDock(); windowLayout.Title = "Default"; var windowLayoutContent = new ProportionalDock { Proportion = double.NaN, Orientation = Orientation.Horizontal, IsCollapsable = false, VisibleDockables = CreateList <IDockable> ( files, new SplitterDock(), tools ) }; windowLayout.IsCollapsable = false; windowLayout.VisibleDockables = CreateList <IDockable>(windowLayoutContent); windowLayout.ActiveDockable = windowLayoutContent; var root = CreateRootDock(); root.IsCollapsable = false; root.VisibleDockables = CreateList <IDockable>(windowLayout); root.ActiveDockable = windowLayout; root.DefaultDockable = windowLayout; 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); }
/// <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); }
/// <inheritdoc/> public override IDock CreateLayout() { LeftDock = new ToolDock { Id = "LeftPaneTop", Proportion = double.NaN, Title = "LeftPaneTop", CurrentView = null, Views = new ObservableCollection <IView>() }; // Left Pane LeftPane = new LayoutDock { Id = "LeftPane", Proportion = 0.15, Orientation = Orientation.Vertical, Title = "LeftPane", CurrentView = null, Views = CreateList <IView> ( LeftDock ) }; RightDock = new ToolDock { Id = "RightDock", Title = "RightDock", CurrentView = null, Views = new ObservableCollection <IView>() }; var RightPane = new LayoutDock { Id = "RightPane", Proportion = 0.15, Orientation = Orientation.Vertical, Title = "LeftPane", CurrentView = null, Views = CreateList <IView> ( RightDock ) }; BottomDock = new ToolDock { Id = "BottomDock", Title = "BottomDock", CurrentView = null, Proportion = 0.3, Views = new ObservableCollection <IView>() }; // Documents DocumentDock = new DocumentDock { Id = "DocumentsPane", Proportion = double.NaN, Title = "DocumentsPane", CurrentView = null, Views = new ObservableCollection <IView>() }; CenterPane = new LayoutDock { Id = "CenterPane", Proportion = double.NaN, Orientation = Orientation.Vertical, Title = "LeftPane", CurrentView = null, Views = CreateList <IView> ( DocumentDock, new SplitterDock(), BottomDock ) }; // Main var mainLayout = new LayoutDock { Id = "MainLayout", Proportion = double.NaN, Orientation = Orientation.Horizontal, Title = "MainLayout", CurrentView = null, Views = new ObservableCollection <IView> { LeftPane, new SplitterDock() { Id = "LeftSplitter", Title = "LeftSplitter" }, CenterPane, new SplitterDock() { Id = "RightSplitter", Title = "RightSplitter" }, RightPane } }; var mainView = new MainView { Id = "Main", Title = "Main", CurrentView = mainLayout, Views = new ObservableCollection <IView> { mainLayout } }; // Root var root = new RootDock { Id = "Root", Title = "Root", CurrentView = mainView, DefaultView = mainView, Views = new ObservableCollection <IView> { mainView, } }; return(root); }
/// <inheritdoc/> public override IDock CreateLayout() { // Right Pane RightDock = new ToolDock { Id = "RightDock", Dock = "Right", Width = 300, Height = double.NaN, Title = "RightDock", CurrentView = null, Views = new ObservableCollection <IView>() }; // Documents DocumentDock = new DocumentDock { Id = "DocumentsPane", Dock = "", Width = double.NaN, Height = double.NaN, Title = "DocumentsPane", CurrentView = null, Views = new ObservableCollection <IView>() }; // Main var mainLayout = new LayoutDock { Id = "MainLayout", Dock = "", Width = double.NaN, Height = double.NaN, Title = "MainLayout", CurrentView = null, Views = new ObservableCollection <IView> { RightDock, DocumentDock } }; var mainView = new MainView { Id = "Main", Width = double.NaN, Height = double.NaN, Title = "Main", CurrentView = mainLayout, Views = new ObservableCollection <IView> { mainLayout } }; // Root var root = new RootDock { Id = "Root", Width = double.NaN, Height = double.NaN, Title = "Root", CurrentView = mainView, DefaultView = mainView, Views = new ObservableCollection <IView> { mainView, } }; return(root); }
/// <inheritdoc/> public override IDock CreateLayout() { // Documents var pageDocument = new PageDocument { Id = nameof(PageDocument), Width = double.NaN, Height = double.NaN, Title = "Page" }; // Left / Top var projectView = new ProjectTool { Id = nameof(ProjectTool), Width = double.NaN, Height = double.NaN, Title = "Project" }; var optionsView = new OptionsTool { Id = nameof(OptionsTool), Width = 200, Height = 200, Title = "Options" }; var imagesView = new ImagesTool { Id = nameof(ImagesTool), Width = double.NaN, Height = double.NaN, Title = "Images" }; // Left / Bottom var groupsView = new GroupsTool { Id = nameof(GroupsTool), Width = double.NaN, Height = double.NaN, Title = "Groups" }; var databasesView = new DatabasesTool { Id = nameof(DatabasesTool), Width = double.NaN, Height = double.NaN, Title = "Databases" }; // Right / Top var stylesView = new StylesTool { Id = nameof(StylesTool), Width = double.NaN, Height = double.NaN, Title = "Styles" }; var templatesView = new TemplatesTool { Id = nameof(TemplatesTool), Width = double.NaN, Height = double.NaN, Title = "Templates" }; var containerView = new ContainerTool { Id = nameof(ContainerTool), Width = double.NaN, Height = double.NaN, Title = "Container" }; var zoomView = new ZoomTool { Id = nameof(ZoomTool), Width = double.NaN, Height = double.NaN, Title = "Zoom" }; // Right / Bottom var toolsView = new ToolsTool { Id = nameof(ToolsTool), Width = double.NaN, Height = double.NaN, Title = "Tools" }; var shapeView = new ShapeTool { Id = nameof(ShapeTool), Width = double.NaN, Height = double.NaN, Title = "Shape" }; var dataView = new DataTool { Id = nameof(DataTool), Width = double.NaN, Height = double.NaN, Title = "Data" }; var styleView = new StyleTool { Id = nameof(StyleTool), Width = double.NaN, Height = double.NaN, Title = "Style" }; var templateView = new TemplateTool { Id = nameof(TemplateTool), Width = double.NaN, Height = double.NaN, Title = "Template" }; // Left Pane var leftPane = new LayoutDock { Id = nameof(ILayoutDock), Dock = "Left", Width = 200, Height = double.NaN, Title = "EditorLeft", CurrentView = null, Views = new ObservableCollection <IView> { new ToolDock { Id = nameof(IToolDock), Dock = "Top", Width = double.NaN, Height = 340, Title = "EditorLeftTop", CurrentView = projectView, Views = new ObservableCollection <IView> { projectView, optionsView, imagesView } }, new SplitterDock() { Id = nameof(ISplitterDock), Dock = "Top", Title = "LeftTopSplitter" }, new ToolDock { Id = nameof(IToolDock), Dock = "Bottom", Width = double.NaN, Height = double.NaN, Title = "EditorLeftBottom", CurrentView = groupsView, Views = new ObservableCollection <IView> { groupsView, databasesView } } } }; // Right Pane var rightPane = new LayoutDock { Id = nameof(ILayoutDock), Dock = "Right", Width = 240, Height = double.NaN, Title = "EditorRight", CurrentView = null, Views = new ObservableCollection <IView> { new ToolDock { Id = nameof(IToolDock), Dock = "Top", Width = double.NaN, Height = 340, Title = "EditorRightTop", CurrentView = stylesView, Views = new ObservableCollection <IView> { stylesView, templatesView, containerView, zoomView } }, new SplitterDock() { Id = nameof(ISplitterDock), Dock = "Top", Title = "RightTopSplitter" }, new ToolDock { Id = nameof(IToolDock), Dock = "Bottom", Width = double.NaN, Height = double.NaN, Title = "EditorRightBottom", CurrentView = toolsView, Views = new ObservableCollection <IView> { toolsView, shapeView, dataView, styleView, templateView } } } }; // Documents var documentsPane = new DocumentDock { Id = nameof(IDocumentDock), Dock = "", Width = double.NaN, Height = double.NaN, Title = "DocumentsPane", CurrentView = pageDocument, Views = new ObservableCollection <IView> { pageDocument } }; // Main var editorLayout = new LayoutDock { Id = nameof(ILayoutDock), Dock = "", Width = double.NaN, Height = double.NaN, Title = "EditorLayout", CurrentView = null, Views = new ObservableCollection <IView> { leftPane, new SplitterDock() { Id = nameof(ISplitterDock), Dock = "Left", Title = "LeftSplitter" }, rightPane, new SplitterDock() { Id = nameof(ISplitterDock), Dock = "Right", Title = "RightSplitter" }, documentsPane } }; var editorView = new EditorView { Id = nameof(EditorView), Width = double.NaN, Height = double.NaN, Title = "Editor", CurrentView = editorLayout, Views = new ObservableCollection <IView> { editorLayout } }; // About var aboutView = new AboutView { Id = nameof(AboutView), Width = double.NaN, Height = double.NaN, Title = "About" }; // Browser var browserView = new BrowserView { Id = nameof(BrowserView), Width = double.NaN, Height = double.NaN, Title = "Browser" }; // Document var documentView = new DocumentView { Id = nameof(DocumentView), Width = double.NaN, Height = double.NaN, Title = "Document" }; // Dashboard var dashboardView = new DashboardView { Id = nameof(DashboardView), Width = double.NaN, Height = double.NaN, Title = "Dashboard" }; // Main var layout = new RootDock { Id = nameof(IRootDock), Width = double.NaN, Height = double.NaN, Title = "Root", CurrentView = dashboardView, DefaultView = dashboardView, Views = new ObservableCollection <IView> { dashboardView, editorView, aboutView, browserView, documentView } }; return(layout); }