From 744260bea55869eef2be5ccf1fd1ae0731c1ed69 Mon Sep 17 00:00:00 2001 From: Jake Norbut Date: Thu, 25 Oct 2018 15:22:51 -0500 Subject: [PATCH] Workspaces - trying to just get a proof of conept of something happenning in the UI; not working in our UI at the moment, but I can see it kind of working in snoop? --- .../Workspaces/WorkspaceItemControl.xaml | 35 +++++++++++++++++++ .../Workspaces/WorkspaceItemControl.xaml.cs | 27 ++++++++++++++ .../Shell/Workspaces/WorkspaceViewModel.cs | 4 +++ .../Workspaces/WorkspacesDialogView.xaml | 8 +---- .../Workspaces/WorkspacesDialogViewModel.cs | 3 ++ 5 files changed, 70 insertions(+), 7 deletions(-) create mode 100644 src/client/spark/view/Shell/Workspaces/WorkspaceItemControl.xaml create mode 100644 src/client/spark/view/Shell/Workspaces/WorkspaceItemControl.xaml.cs diff --git a/src/client/spark/view/Shell/Workspaces/WorkspaceItemControl.xaml b/src/client/spark/view/Shell/Workspaces/WorkspaceItemControl.xaml new file mode 100644 index 000000000..ef60ac437 --- /dev/null +++ b/src/client/spark/view/Shell/Workspaces/WorkspaceItemControl.xaml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + diff --git a/src/client/spark/view/Shell/Workspaces/WorkspaceItemControl.xaml.cs b/src/client/spark/view/Shell/Workspaces/WorkspaceItemControl.xaml.cs new file mode 100644 index 000000000..7cb18658f --- /dev/null +++ b/src/client/spark/view/Shell/Workspaces/WorkspaceItemControl.xaml.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace mbts.ui.controls { + /// + /// Interaction logic for WorkspaceItemControl.xaml + /// + public partial class WorkspaceItemControl : UserControl + { + public WorkspaceItemControl() + { + InitializeComponent(); + } + } +} diff --git a/src/client/spark/view/Shell/Workspaces/WorkspaceViewModel.cs b/src/client/spark/view/Shell/Workspaces/WorkspaceViewModel.cs index 0b9369947..fc63e12c2 100644 --- a/src/client/spark/view/Shell/Workspaces/WorkspaceViewModel.cs +++ b/src/client/spark/view/Shell/Workspaces/WorkspaceViewModel.cs @@ -21,6 +21,10 @@ namespace mbts.ui.shell public object Icon { get { return Icons.Window; } } + + private string _vstate = "Normal"; + public string VisualState { get { return _vstate; } set { _vstate = value; RaisePropertyChanged("VisualState"); } } + internal WorkspaceDefinition Definition { get; private set; } public ICommand ActivateCommand { diff --git a/src/client/spark/view/Shell/Workspaces/WorkspacesDialogView.xaml b/src/client/spark/view/Shell/Workspaces/WorkspacesDialogView.xaml index 39cb0c9f2..d573ac3dd 100644 --- a/src/client/spark/view/Shell/Workspaces/WorkspacesDialogView.xaml +++ b/src/client/spark/view/Shell/Workspaces/WorkspacesDialogView.xaml @@ -59,13 +59,7 @@ - + diff --git a/src/client/spark/view/Shell/Workspaces/WorkspacesDialogViewModel.cs b/src/client/spark/view/Shell/Workspaces/WorkspacesDialogViewModel.cs index d91e9fd8f..67daac42e 100644 --- a/src/client/spark/view/Shell/Workspaces/WorkspacesDialogViewModel.cs +++ b/src/client/spark/view/Shell/Workspaces/WorkspacesDialogViewModel.cs @@ -45,6 +45,9 @@ namespace mbts.ui.shell { clear_error("SaveName"); } + if (Workspaces.Any( x => x.Name == SaveName)) { + Workspaces.Where(x => x.Name == SaveName).ForEach( x => x.VisualState = "Overridden"); + } // Save _work_model.save_workspace(SaveName, ispublic: IsPublicWorkspace); });