diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-08-15 10:45:25 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-08-15 10:45:25 +0300 |
| commit | ce51bf994fa0896018544698a60fd0740a05293b (patch) | |
| tree | 42d30252b3a6f7e19a0378251e05630834e6d60f /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels | |
| parent | 733f0ce4feef6b7dc4151ffe0f896efb53640314 (diff) | |
| parent | 723e2b8854db8c409268f31ab76f5252211ec494 (diff) | |
| download | Tango-ce51bf994fa0896018544698a60fd0740a05293b.tar.gz Tango-ce51bf994fa0896018544698a60fd0740a05293b.zip | |
Merge branch 'master' of https://twinetfs.visualstudio.com/_git/Tango
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."); + } } } |
