/// <summary> /// toggle button,暂时用事件处理程序 /// </summary> private void BtnGame_Click(object sender, RoutedEventArgs e) { _gameOption.Add(sender); _gameOption.Switch(sender); var identity = (string)((ToggleButton)sender).Tag; ViewModel.CurrentGame = ViewModel.CurrentMachine.Games.First(k => k.Identity == identity); }
private void BtnNavigate_Checked(object sender, RoutedEventArgs e) { if (_ischanging) { return; } _ischanging = true; var btn = (ToggleButton)sender; _optionContainer.Switch(btn); _ischanging = false; }
/// <summary> /// toggle button,暂时用事件处理程序 /// </summary> private async void BtnConsole_Click(object sender, RoutedEventArgs e) { _consoleOption.Add(sender); _consoleOption.Switch(sender); await ViewModel.StopScanTask(); var identity = (string)((ToggleButton)sender).Tag; ViewModel.CurrentMachine = ViewModel.ConsoleMachines.FirstOrDefault(k => k.Identity == identity); ViewModel.StartScanTask(); ViewModel.CurrentGame = null; }