private void ComPortRefreshButton_Click(object sender, RoutedEventArgs e) { Button button = sender as Button; EditSettingsViewModel vm = button.DataContext as EditSettingsViewModel; vm.RefreshComPorts(); }
private void EditSettingsDialogClosingEventHandler(object sender, DialogClosingEventArgs e) { if ((e.Parameter as bool?) == true) { EditSettingsViewModel vm = e.Content as EditSettingsViewModel; TournamentManager.ComPort = vm.ComPort; TournamentManager.Simulate = vm.Simulate; } MenuToggleButton.IsChecked = false; }
public void EditSettings_Click(object sender, RoutedEventArgs e) { EditSettingsViewModel editVm = new EditSettingsViewModel(); DialogHost.Show(editVm, "RootDialog", EditSettingsDialogClosingEventHandler); }