private async void ThemeToggle_Toggled(object sender, Windows.UI.Xaml.RoutedEventArgs e) { //Only switch theme if value has changed (not on initialization) if (sender is ToggleSwitch toggleSwitch) { if (toggleSwitch.IsOn != ThemeSelectorService.IsLightThemeEnabled) { await ThemeSelectorService.SwitchThemeAsync(); } } }
public SettingsViewModel(IDialogService dialogService) { _dialogService = dialogService; SwitchThemeCommand = new RelayCommand(async() => { await ThemeSelectorService.SwitchThemeAsync(); }); this.GetDevicesCommand = new RelayCommand(() => this.GetDevices()); this.ClearHistoryCommand = new RelayCommand(() => this.ClearHistory()); using (CGM.Communication.Data.Repository.CgmUnitOfWork uow = new Communication.Data.Repository.CgmUnitOfWork()) { _setting = uow.Setting.GetSettings(); } GetDevices(); this.LocalPath = Windows.Storage.ApplicationData.Current.LocalFolder.Path; }
public SettingsPageViewModel() { SwitchThemeCommand = new DelegateCommand(async() => { await ThemeSelectorService.SwitchThemeAsync(); }); }
/// <summary> /// 기본 생성자 /// </summary> public SettingsViewModel() { SwitchThemeCommand = new RelayCommand(async() => { await ThemeSelectorService.SwitchThemeAsync(); }); LoadedCommand = new RelayCommand(OnLoaded); UnloadedCommand = new RelayCommand(OnUnloaded); PayInformations = new List <PayInformation> { new PayInformation { Id = "1.0", Value = 1.0, StartTime = DateTime.Parse("08:00"), EndTime = DateTime.Parse("18:00"), TimePay = 10000 }, new PayInformation { Id = "1.5 Part1", Value = 1.5, StartTime = DateTime.Parse("18:00"), EndTime = DateTime.Parse("22:00"), TimePay = 15000 }, new PayInformation { Id = "2.0", Value = 2.0, StartTime = DateTime.Parse("22:00"), EndTime = DateTime.Parse("06:00"), TimePay = 20000 }, new PayInformation { Id = "1.5 Part2", Value = 1.5, StartTime = DateTime.Parse("06:00"), EndTime = DateTime.Parse("08:00"), TimePay = 15000 }, new PayInformation { Id = "1.5 Holiday", Value = 1.5, IsHoliday = true, StartTime = DateTime.Parse("08:00"), EndTime = DateTime.Parse("18:00"), TimePay = 15000 }, new PayInformation { Id = "2.0 Holiday1", Value = 2.0, IsHoliday = true, StartTime = DateTime.Parse("18:00"), EndTime = DateTime.Parse("22:00"), TimePay = 20000 }, new PayInformation { Id = "2.5 Holiday", Value = 2.5, IsHoliday = true, StartTime = DateTime.Parse("22:00"), EndTime = DateTime.Parse("06:00"), TimePay = 25000 }, new PayInformation { Id = "2.0 Holiday2", Value = 2.0, IsHoliday = true, StartTime = DateTime.Parse("06:00"), EndTime = DateTime.Parse("08:00"), TimePay = 20000 } }; }
public SettingsViewModel() { IsLightThemeEnabled = ThemeSelectorService.IsLightThemeEnabled; SwitchThemeCommand = new RelayCommand(async() => { await ThemeSelectorService.SwitchThemeAsync(); }); }
public SettingsViewModel() { SwitchThemeCommand = new RelayCommand(async() => { await ThemeSelectorService.SwitchThemeAsync(); }); }