From d045a47ad7363e62b763013fa6afcdb1762a7ce3 Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Sun, 11 Aug 2019 16:48:35 +0300 Subject: Machine Studio : added configuration for dark /light theme --- .../Tango.MachineStudio.UI/ViewModels/MainViewVM.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels') 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 /// public RelayCommand AboutCommand { get; set; } + /// + /// Gets or sets the about command. + /// + public RelayCommand ChangeAppThemeCommand { get; set; } + private IAuthenticationProvider _authenticationProvider; /// /// Gets or sets the authentication provider. @@ -336,6 +342,8 @@ namespace Tango.MachineStudio.UI.ViewModels TangoMessenger.Default.Register((x) => DisableCheckForUpdates = true); AboutCommand = new RelayCommand(ShowAboutDialog); + + ChangeAppThemeCommand = new RelayCommand(ChangeTheme); } private void MachineEventsStateProvider_EventsResolved(object sender, IEnumerable e) @@ -926,5 +934,15 @@ namespace Tango.MachineStudio.UI.ViewModels IsApplicationReady = true; } } + + private void ChangeTheme(MachineStudioTheme theme) + { + var settings = SettingsManager.Default.GetOrCreate(); + //add current theme + settings.Theme = theme; + settings.Save(); + + _notificationProvider.ShowInfo("Changes will be applies after application restart."); + } } } -- cgit v1.3.1