diff options
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels')
| -rw-r--r-- | Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs index b2faf346e..31ba4e57d 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs @@ -5,6 +5,7 @@ using System.IO; using System.Linq; using System.Reflection; using System.Text; +using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; using System.Windows; @@ -174,6 +175,11 @@ namespace Tango.MachineStudio.UI.ViewModels /// </summary> public RelayCommand AboutCommand { get; set; } + /// <summary> + /// Gets or sets the about command. + /// </summary> + public RelayCommand<MachineStudioTheme> ChangeAppThemeCommand { get; set; } + private IAuthenticationProvider _authenticationProvider; /// <summary> /// Gets or sets the authentication provider. @@ -336,6 +342,8 @@ namespace Tango.MachineStudio.UI.ViewModels TangoMessenger.Default.Register<Messages.ForcedUpdateMessage>((x) => DisableCheckForUpdates = true); AboutCommand = new RelayCommand(ShowAboutDialog); + + ChangeAppThemeCommand = new RelayCommand<MachineStudioTheme>(ChangeTheme); } private void MachineEventsStateProvider_EventsResolved(object sender, IEnumerable<MachinesEvent> e) @@ -926,5 +934,15 @@ namespace Tango.MachineStudio.UI.ViewModels IsApplicationReady = true; } } + + private void ChangeTheme(MachineStudioTheme theme) + { + var settings = SettingsManager.Default.GetOrCreate<MachineStudioSettings>(); + //add current theme + settings.Theme = theme; + settings.Save(); + + _notificationProvider.ShowInfo("Changes will be applies after application restart."); + } } } |
