/// <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); }
/// <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; }