private void ThemeSwitch_Toggled(object sender, RoutedEventArgs e) { ToggleSwitch toggleSwitch = sender as ToggleSwitch; if (toggleSwitch != null) { App.SetDarkTheme(toggleSwitch.IsOn); } }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.isAutoRollcallEnabled = ((ModernWpf.Controls.ToggleSwitch)(target)); #line 14 "..\..\MainWindow.xaml" this.isAutoRollcallEnabled.Toggled += new System.Windows.RoutedEventHandler(this.isAutoRollcallEnabled_Toggled); #line default #line hidden return; case 2: this.ShowAutoRollcallService = ((System.Windows.Controls.ProgressBar)(target)); return; case 3: this.WelcomeLabel = ((System.Windows.Controls.Label)(target)); return; case 4: this.isSoundEnabled = ((ModernWpf.Controls.ToggleSwitch)(target)); #line 19 "..\..\MainWindow.xaml" this.isSoundEnabled.Toggled += new System.Windows.RoutedEventHandler(this.isSoundEnabled_Toggled); #line default #line hidden return; case 5: this.RollcalllCheckSeconds = ((System.Windows.Controls.TextBox)(target)); return; case 6: this.AboutShow = ((System.Windows.Controls.Button)(target)); #line 24 "..\..\MainWindow.xaml" this.AboutShow.Click += new System.Windows.RoutedEventHandler(this.About_Click); #line default #line hidden return; case 7: this.Update = ((System.Windows.Controls.Button)(target)); #line 25 "..\..\MainWindow.xaml" this.Update.Click += new System.Windows.RoutedEventHandler(this.Update_Click); #line default #line hidden return; case 8: this.OpenSource = ((System.Windows.Controls.Button)(target)); #line 26 "..\..\MainWindow.xaml" this.OpenSource.Click += new System.Windows.RoutedEventHandler(this.OpenSource_Click); #line default #line hidden return; case 9: this.Notice = ((System.Windows.Controls.TextBlock)(target)); return; } this._contentLoaded = true; }