public override IRootDock CreateLayout() { var documents = CreateDocumentDock(); documents.Proportion = 0.8f; documents.IsCollapsable = false; var mainLayout = new ProportionalDock { Id = "MainLayout", Title = "MainLayout", Proportion = 1, IsCollapsable = false, Orientation = Orientation.Horizontal, ActiveDockable = null, VisibleDockables = CreateList <IDockable> ( documents ) }; var root = CreateRootDock(); root.ActiveDockable = mainLayout; root.DefaultDockable = mainLayout; root.VisibleDockables = CreateList <IDockable>(mainLayout); return(root); }
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); }
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 IDock CreateLayout() { var document1 = new Document1ViewModel { Id = "Document1", Title = "Document1" }; var document2 = new Document2ViewModel { 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 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 ) }, new SplitterDock() { Id = "LeftPaneTopSplitter", Title = "LeftPaneTopSplitter" }, new ToolDock { Id = "LeftPaneBottom", Title = "LeftPaneBottom", Proportion = double.NaN, ActiveDockable = leftBottomTool1, VisibleDockables = CreateList <IDockable> ( leftBottomTool1, leftBottomTool2 ) } ) }, new SplitterDock() { Id = "LeftSplitter", Title = "LeftSplitter" }, new DocumentDock { Id = "DocumentsPane", Title = "DocumentsPane", Proportion = double.NaN, ActiveDockable = document1, VisibleDockables = CreateList <IDockable> ( document1, document2 ) }, new SplitterDock() { 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 ) }, new SplitterDock() { Id = "RightPaneTopSplitter", Title = "RightPaneTopSplitter" }, new ToolDock { Id = "RightPaneBottom", Title = "RightPaneBottom", Proportion = double.NaN, ActiveDockable = rightBottomTool1, VisibleDockables = CreateList <IDockable> ( rightBottomTool1, rightBottomTool2 ) } ) } ) }; var dashboardView = new DashboardViewModel { Id = "Dashboard", Title = "Dashboard" }; var homeView = new HomeViewModel { Id = "Home", Title = "Home", ActiveDockable = mainLayout, VisibleDockables = CreateList <IDockable>(mainLayout) }; var root = CreateRootDock(); root.Id = "Root"; root.Title = "Root"; root.ActiveDockable = dashboardView; root.DefaultDockable = dashboardView; root.VisibleDockables = CreateList <IDockable>(dashboardView, homeView); 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 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 void ProportionalDock_Ctor() { var actual = new ProportionalDock(); Assert.NotNull(actual); }
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 override IRootDock 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 documentDock = new FilesDocumentDock() { Id = "Files", Title = "Files", IsCollapsable = false, Proportion = double.NaN, ActiveDockable = untitledFileViewModel, VisibleDockables = CreateList <IDockable> ( untitledFileViewModel ), CanCreateDocument = true }; var tools = new ProportionalDock { Proportion = 0.2, Orientation = Orientation.Vertical, VisibleDockables = CreateList <IDockable> ( new ToolDock { ActiveDockable = findViewModel, VisibleDockables = CreateList <IDockable> ( findViewModel ), Alignment = Alignment.Right, GripMode = GripMode.Visible }, new ProportionalDockSplitter(), new ToolDock { ActiveDockable = replaceViewModel, VisibleDockables = CreateList <IDockable> ( replaceViewModel ), Alignment = Alignment.Right, GripMode = GripMode.Visible } ) }; var windowLayout = CreateRootDock(); windowLayout.Title = "Default"; var windowLayoutContent = new ProportionalDock { Orientation = Orientation.Horizontal, IsCollapsable = false, VisibleDockables = CreateList <IDockable> ( documentDock, new ProportionalDockSplitter(), tools ) }; windowLayout.IsCollapsable = false; windowLayout.VisibleDockables = CreateList <IDockable>(windowLayoutContent); windowLayout.ActiveDockable = windowLayoutContent; var rootDock = CreateRootDock(); rootDock.IsCollapsable = false; rootDock.VisibleDockables = CreateList <IDockable>(windowLayout); rootDock.ActiveDockable = windowLayout; rootDock.DefaultDockable = windowLayout; _documentDock = documentDock; _rootDock = rootDock; _findTool = findViewModel; _replaceTool = replaceViewModel; return(rootDock); }
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); }
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); }
public override IDock CreateLayout() { var documentViewModel = new SceneControlDocumentViewModel() { Id = "Viewport", Title = "Viewport" }; documentViewModel.SceneControlViewModel.Document = m_ViewModel.Document; var layersToolViewModel = new LayersViewModel() { Id = "Layers", Title = "Layers" }; layersToolViewModel.SceneViewModel.Scene = documentViewModel.SceneControlViewModel; var editLayerToolViewModel = new EditLayerViewModel() { Id = "GroupAndLayerSettings", Title = "Group and Layer Settings" }; editLayerToolViewModel.SceneViewModel.Scene = documentViewModel.SceneControlViewModel; var addGeometryViewModel = new AddGeometryViewModel() { Id = "AddGeometry", Title = "Add Geometry" }; addGeometryViewModel.SceneViewModel.Scene = documentViewModel.SceneControlViewModel; 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 = .2, Orientation = Orientation.Vertical, ActiveDockable = null, VisibleDockables = CreateList <IDockable> ( new ToolDock { Id = "LeftPaneTop", Title = "LeftPaneTop", Proportion = double.NaN, ActiveDockable = layersToolViewModel, VisibleDockables = CreateList <IDockable> ( layersToolViewModel ) }, new SplitterDock() { Id = "LeftPaneTopSplitter", Title = "LeftPaneTopSplitter" }, new ToolDock { Id = "LeftPaneBottom", Title = "LeftPaneBottom", Proportion = double.NaN, ActiveDockable = editLayerToolViewModel, VisibleDockables = CreateList <IDockable> ( editLayerToolViewModel ) } ) }, new SplitterDock() { Id = "LeftSplitter", Title = "LeftSplitter" }, new ProportionalDock { Id = "CenterPane", Title = "CenterPane", Proportion = double.NaN, Orientation = Orientation.Vertical, ActiveDockable = null, VisibleDockables = CreateList <IDockable> ( new DocumentDock { Id = "DocumentsPane", Title = "DocumentsPane", Proportion = .8, ActiveDockable = documentViewModel, VisibleDockables = CreateList <IDockable> ( documentViewModel ) }, new SplitterDock() { Id = "CenterPaneSplitter", Title = "CenterPaneSplitter" }, new ToolDock { Id = "CenterPaneBottom", Title = "CenterPaneBottom", Proportion = double.NaN, ActiveDockable = addGeometryViewModel, VisibleDockables = CreateList <IDockable> ( addGeometryViewModel ) } ) } ) }; 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 override IDock CreateLayout() { SpatialDocument document = new SpatialDocument(); ILayer layer = document.AddItemsLayer(); document.SelectedNode = layer; layer.Name = "WKT Geometries"; var documentViewModel = new SceneControlDocumentViewModel() { Id = "Document1", Title = "Document 1" }; documentViewModel.SceneControlViewModel.Document = document; var layersToolViewModel = new LayersViewModel() { Id = "Layers", Title = "Layers" }; layersToolViewModel.SceneViewModel.Scene = documentViewModel.SceneControlViewModel; var editLayerToolViewModel = new EditLayerViewModel() { Id = "GroupAndLayerSettings", Title = "Group and Layer Settings" }; editLayerToolViewModel.SceneViewModel.Scene = documentViewModel.SceneControlViewModel; var addGeometryViewModel = new AddGeometryViewModel() { Id = "AddGeometry", Title = "Add Geometry" }; addGeometryViewModel.SceneViewModel.Scene = documentViewModel.SceneControlViewModel; 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 = .2, Orientation = Orientation.Vertical, ActiveDockable = null, VisibleDockables = CreateList <IDockable> ( new ToolDock { Id = "LeftPaneTop", Title = "LeftPaneTop", Proportion = double.NaN, ActiveDockable = layersToolViewModel, VisibleDockables = CreateList <IDockable> ( layersToolViewModel ) }, new SplitterDock() { Id = "LeftPaneTopSplitter", Title = "LeftPaneTopSplitter" }, new ToolDock { Id = "LeftPaneBottom", Title = "LeftPaneBottom", Proportion = double.NaN, ActiveDockable = editLayerToolViewModel, VisibleDockables = CreateList <IDockable> ( editLayerToolViewModel ) } ) }, new SplitterDock() { Id = "LeftSplitter", Title = "LeftSplitter" }, new ProportionalDock { Id = "CenterPane", Title = "CenterPane", Proportion = double.NaN, Orientation = Orientation.Vertical, ActiveDockable = null, VisibleDockables = CreateList <IDockable> ( new DocumentDock { Id = "DocumentsPane", Title = "DocumentsPane", Proportion = .8, ActiveDockable = documentViewModel, VisibleDockables = CreateList <IDockable> ( documentViewModel ) }, new SplitterDock() { Id = "CenterPaneSplitter", Title = "CenterPaneSplitter" }, new ToolDock { Id = "CenterPaneBottom", Title = "CenterPaneBottom", Proportion = double.NaN, ActiveDockable = addGeometryViewModel, VisibleDockables = CreateList <IDockable> ( addGeometryViewModel ) } ) } ) }; 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); 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() { var documentDock = new AvalonStudioDocumentDock { Id = "DocumentsPane", Proportion = double.NaN, Title = "DocumentsPane", ActiveDockable = null, IsCollapsable = false, VisibleDockables = _documents }; var verticalContainer = new ProportionalDock { Id = "VerticalContainer", Proportion = double.NaN, Orientation = Orientation.Vertical, Title = "VerticalContainer", ActiveDockable = null, VisibleDockables = new ObservableCollection <IDockable> { documentDock, } }; var horizontalContainer = new ProportionalDock { Id = "HorizontalContainer", Proportion = double.NaN, Orientation = Orientation.Horizontal, Title = "HorizontalContainer", ActiveDockable = null, VisibleDockables = new ObservableCollection <IDockable> { verticalContainer, } }; var mainLayout = new RootDock { Id = "Perspective", Title = "Perspective", ActiveDockable = horizontalContainer, VisibleDockables = new ObservableCollection <IDockable> { horizontalContainer } }; Root = new RootDock { Id = "Root", Title = "Root", ActiveDockable = mainLayout, VisibleDockables = new ObservableCollection <IDockable> { mainLayout } }; Root.WhenAnyValue(x => x.VisibleDockables) .Subscribe(x => { }); (Root.VisibleDockables as ObservableCollection <IDockable>).CollectionChanged += DefaultLayoutFactory_CollectionChanged; return(Root); }
public override IRootDock CreateLayout() { var document1 = new DocumentViewModel { Id = "Document1", Title = "Document1" }; var document2 = new DocumentViewModel { Id = "Document2", Title = "Document2" }; var document3 = new DocumentViewModel { Id = "Document3", Title = "Document3", CanClose = true }; var tool1 = new Tool1ViewModel { Id = "Tool1", Title = "Tool1" }; var tool2 = new Tool2ViewModel { Id = "Tool2", Title = "Tool2" }; var tool3 = new Tool3ViewModel { Id = "Tool3", Title = "Tool3" }; var tool4 = new Tool4ViewModel { Id = "Tool4", Title = "Tool4" }; var tool5 = new Tool5ViewModel { Id = "Tool5", Title = "Tool5" }; var tool6 = new Tool6ViewModel { Id = "Tool6", Title = "Tool6", CanClose = true, CanPin = false }; var tool7 = new Tool7ViewModel { Id = "Tool7", Title = "Tool7", CanClose = false, CanPin = false }; var tool8 = new Tool8ViewModel { Id = "Tool8", Title = "Tool8", CanClose = false, CanPin = true }; var leftDock = new ProportionalDock { Proportion = 0.25, Orientation = Orientation.Vertical, ActiveDockable = null, VisibleDockables = CreateList <IDockable> ( new ToolDock { ActiveDockable = tool1, VisibleDockables = CreateList <IDockable>(tool1, tool2), Alignment = Alignment.Left }, new ProportionalDockSplitter(), new ToolDock { ActiveDockable = tool3, VisibleDockables = CreateList <IDockable>(tool3, tool4), Alignment = Alignment.Left } ) }; var rightDock = new ProportionalDock { Proportion = 0.25, Orientation = Orientation.Vertical, ActiveDockable = null, VisibleDockables = CreateList <IDockable> ( new ToolDock { ActiveDockable = tool5, VisibleDockables = CreateList <IDockable>(tool5, tool6), Alignment = Alignment.Right, GripMode = GripMode.Hidden }, new ProportionalDockSplitter(), new ToolDock { ActiveDockable = tool7, VisibleDockables = CreateList <IDockable>(tool7, tool8), Alignment = Alignment.Right, GripMode = GripMode.AutoHide } ) }; var documentDock = new CustomDocumentDock { IsCollapsable = false, ActiveDockable = document1, VisibleDockables = CreateList <IDockable>(document1, document2, document3), CanCreateDocument = true }; var mainLayout = new ProportionalDock { Orientation = Orientation.Horizontal, VisibleDockables = CreateList <IDockable> ( leftDock, new ProportionalDockSplitter(), documentDock, new ProportionalDockSplitter(), rightDock ) }; var dashboardView = new DashboardViewModel { Id = "Dashboard", Title = "Dashboard" }; var homeView = new HomeViewModel { Id = "Home", Title = "Home", ActiveDockable = mainLayout, VisibleDockables = CreateList <IDockable>(mainLayout) }; var rootDock = CreateRootDock(); rootDock.IsCollapsable = false; rootDock.ActiveDockable = dashboardView; rootDock.DefaultDockable = homeView; rootDock.VisibleDockables = CreateList <IDockable>(dashboardView, homeView); _documentDock = documentDock; _rootDock = rootDock; return(rootDock); }
public override IDock CreateLayout() { // - В будущем текущий язык среды будет подгружаться с файла Localizer.GetInstance().LoadLanguage("en-EN"); var Dict = Semantic.Scripts.Localizer.GetInstance().Strings; // - Подготовка панелей для объединения в layout // - Страница "Добро пожаловать" var welcome = new WelcomeViewModel { Id = "Welcome", Title = Dict["WelcomePage"] }; // - Панель "Проект" var project = new ProjectViewModel { Id = "Project", Title = Dict["Project"] }; // - Панель "Задачник" var taskbook = new TaskbookViewModel { Id = "Taskbook", Title = Dict["Taskbook"] }; // - Панель "Документация" var help = new HelpViewModel { Id = "Help", Title = Dict["Help"] }; // - Панель "Ошибки" var errors = new ErrorsViewModel { Id = "Errors", Title = Dict["ErrorsList"] }; // - Панель "Журнал команд" var commandLog = new CommandLogViewModel { Id = "CommandLog", Title = Dict["CommandLog"] }; // - Панель "Консоль" var console = new ConsoleViewModel { Id = "Console", Title = Dict["Console"] }; // - Делим layout на две части: нижнюю и верхнюю var mainLayout = new ProportionalDock { Id = "MainLayout", Title = "MainLayout", Proportion = double.NaN, Orientation = Orientation.Vertical, ActiveDockable = null, VisibleDockables = CreateList <IDockable> ( // - Верхняя часть содержит проект, задачник, докум-ю и редактор кода new ProportionalDock { Id = "UpperPart", Title = "UpperPart", Proportion = double.NaN, Orientation = Orientation.Horizontal, ActiveDockable = null, VisibleDockables = CreateList <IDockable> ( new ToolDock { Id = "UpperTool1", Title = "UpperTool1", Proportion = double.NaN, ActiveDockable = project, VisibleDockables = CreateList <IDockable> ( project, // - Вкладка со структурой проекта taskbook, // - Вкладка с задачами help // - Вкладка с документацией ) }, new SplitterDock { Id = "UpperSplitter", Title = "UpperSplitter" }, new DocumentDock { Id = "DocumentPane", Title = "DocumentPane", Proportion = double.NaN, ActiveDockable = welcome, VisibleDockables = CreateList <IDockable>(welcome) } ) }, // - Разделитель частей new SplitterDock { Id = "LayoutSplitter", Title = "LayoutSplitter" }, // - Нижняя часть содержит ошибки, журнал команд и консоль new ProportionalDock { Id = "LowerPart", Title = "LowerPart", Proportion = double.NaN, Orientation = Orientation.Horizontal, ActiveDockable = null, VisibleDockables = CreateList <IDockable> ( new ToolDock { Id = "LowerTool1", Title = "LowerTool1", Proportion = double.NaN, ActiveDockable = errors, VisibleDockables = CreateList <IDockable> ( errors, commandLog ) }, new SplitterDock { Id = "LowerSplitter", Title = "LowerSplitter" }, new ToolDock { Id = "LowerTool2", Title = "LowerTool2", Proportion = double.NaN, ActiveDockable = console, VisibleDockables = CreateList <IDockable>(console) } ) } ) }; var mainView = new MainViewModel { Id = "MainView", Title = "MainView", 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 override IRootDock CreateLayout() { // Tool Windows - Libraries var styleLibraryViewModel = new StyleLibraryViewModel() { Id = "StyleLibrary", Title = "Styles" }; var groupLibraryViewModel = new GroupLibraryViewModel() { Id = "GroupLibrary", Title = "Groups" }; var databaseLibraryViewModel = new DatabaseLibraryViewModel() { Id = "DatabaseLibrary", Title = "Databases" }; var templateLibraryViewModel = new TemplateLibraryViewModel() { Id = "TemplateLibrary", Title = "Templates" }; var scriptLibraryViewModel = new ScriptLibraryViewModel() { Id = "ScriptLibrary", Title = "Scripts" }; // Tool Windows - Options var projectOptionsViewModel = new ProjectOptionsViewModel() { Id = "ProjectOptions", Title = "Options" }; var rendererOptionsViewModel = new RendererOptionsViewModel() { Id = "RendererOptions", Title = "Renderer" }; var zoomOptionsViewModel = new ZoomOptionsViewModel() { Id = "ZoomOptions", Title = "Zoom" }; var imageOptionsViewModel = new ImageOptionsViewModel() { Id = "ImageOptions", Title = "Images" }; // Tool Windows - Properties var pagePropertiesViewModel = new PagePropertiesViewModel() { Id = "PageProperties", Title = "Page" }; var shapePropertiesViewModel = new ShapePropertiesViewModel() { Id = "ShapeProperties", Title = "Shape" }; var stylePropertiesViewModel = new StylePropertiesViewModel() { Id = "StyleProperties", Title = "Style" }; var dataPropertiesViewModel = new DataPropertiesViewModel() { Id = "DataProperties", Title = "Data" }; var statePropertiesViewModel = new StatePropertiesViewModel() { Id = "StateProperties", Title = "State" }; // Tool Windows var projectExplorerViewModel = new ProjectExplorerViewModel() { Id = "ProjectExplorer", Title = "Project Explorer" }; var objectBrowserViewModel = new ObjectBrowserViewModel() { Id = "ObjectBrowser", Title = "Object Browser" }; // Home Perspective var leftTopToolDock = new ToolDock { ActiveDockable = projectExplorerViewModel, VisibleDockables = CreateList <IDockable>( projectExplorerViewModel, objectBrowserViewModel, scriptLibraryViewModel), Alignment = Alignment.Left, GripMode = GripMode.Visible }; var leftBottomToolDock = new ToolDock { Proportion = 0.35, ActiveDockable = pagePropertiesViewModel, VisibleDockables = CreateList <IDockable>( pagePropertiesViewModel, projectOptionsViewModel, rendererOptionsViewModel, zoomOptionsViewModel, imageOptionsViewModel), Alignment = Alignment.Right, GripMode = GripMode.Visible }; var rightTopToolDock = new ToolDock { Proportion = 0.35, ActiveDockable = shapePropertiesViewModel, VisibleDockables = CreateList <IDockable>( shapePropertiesViewModel, dataPropertiesViewModel, statePropertiesViewModel, templateLibraryViewModel), Alignment = Alignment.Right, GripMode = GripMode.Visible }; var rightBottomToolDock = new ToolDock { ActiveDockable = stylePropertiesViewModel, VisibleDockables = CreateList <IDockable>( stylePropertiesViewModel, styleLibraryViewModel, groupLibraryViewModel, databaseLibraryViewModel), Alignment = Alignment.Right, GripMode = GripMode.Visible }; var leftDock = new ProportionalDock { Proportion = 0.20, Orientation = Orientation.Vertical, ActiveDockable = leftTopToolDock, VisibleDockables = CreateList <IDockable> ( leftTopToolDock, new ProportionalDockSplitter(), leftBottomToolDock ) }; var rightDock = new ProportionalDock { Proportion = 0.20, Orientation = Orientation.Vertical, ActiveDockable = rightTopToolDock, VisibleDockables = CreateList <IDockable> ( rightTopToolDock, new ProportionalDockSplitter(), rightBottomToolDock ) }; var documentDock = new PageDocumentDock { Id = "PageDocumentDock", Title = "Pages", ActiveDockable = null, VisibleDockables = CreateList <IDockable>(), CanCreateDocument = true, IsCollapsable = false }; var homeDock = new ProportionalDock { Id = "HomeDock", Orientation = Orientation.Horizontal, ActiveDockable = documentDock, VisibleDockables = CreateList <IDockable> ( leftDock, new ProportionalDockSplitter(), documentDock, new ProportionalDockSplitter(), rightDock ), IsCollapsable = false }; var homeMenuViewModel = new HomeMenuViewModel() { Id = "HomeMenuView", Dock = DockMode.Top }; var homeStatusBarViewModel = new HomeStatusBarViewModel() { Id = "HomeStatusBarView", Dock = DockMode.Bottom }; var homeViewModel = new HomeViewModel { Id = "HomeView", Dock = DockMode.Center, ActiveDockable = homeDock, VisibleDockables = CreateList <IDockable>(homeDock), IsCollapsable = false }; var homeDockDock = new DockDock() { Id = "HomeDockDock", LastChildFill = true, VisibleDockables = CreateList <IDockable> ( homeMenuViewModel, homeStatusBarViewModel, homeViewModel ), IsCollapsable = false }; // Dashboard Perspective var dashboardMenuViewModel = new DashboardMenuViewModel() { Id = "DashboardMenuView", Title = "Dashboard Menu", Dock = DockMode.Top, IsCollapsable = false }; var dashboardViewModel = new DashboardViewModel { Id = "DashboardView", Title = "Dashboard", Dock = DockMode.Center, IsCollapsable = false }; var dashboardDockDock = new DockDock() { Id = "DashboardDock", Proportion = 1.0, LastChildFill = true, VisibleDockables = CreateList <IDockable> ( dashboardMenuViewModel, dashboardViewModel ), IsCollapsable = false }; // Root Perspective var dashboardRootDock = CreateRootDock(); dashboardRootDock.Id = "Dashboard"; dashboardRootDock.ActiveDockable = dashboardDockDock; dashboardRootDock.DefaultDockable = dashboardDockDock; dashboardRootDock.VisibleDockables = CreateList <IDockable>(dashboardDockDock); dashboardRootDock.IsCollapsable = false; var homeRootDock = CreateRootDock(); homeRootDock.Id = "Home"; homeRootDock.ActiveDockable = homeDockDock; homeRootDock.DefaultDockable = homeDockDock; homeRootDock.VisibleDockables = CreateList <IDockable>(homeDockDock); homeRootDock.IsCollapsable = false; // Root Dock var rootDock = CreateRootDock(); rootDock.Id = "Root"; rootDock.ActiveDockable = dashboardRootDock; rootDock.DefaultDockable = dashboardRootDock; rootDock.VisibleDockables = CreateList <IDockable>(dashboardRootDock, homeRootDock); rootDock.IsCollapsable = false; _rootDock = rootDock; _pagesDock = documentDock; _homeDock = homeDock; return(rootDock); }