private void cancelButton_Click(object sender, RoutedEventArgs e) { _gameOptions = null; Close(); }
public Options() { _gameOptions = GameOptions.Create(); DataContext = _gameOptions; InitializeComponent(); }
void StartGame_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e) { _gameOptions = DataContext as GameOptions; ChangeListBoxOptions(); }
//添加一个新的默认构造函数 public GameViewModel() { _players = new List <Player>(); _gameOptions = GameOptions.Create(); }