예제 #1
0
        private void MenuItemFileExit_Click(object sender, RoutedEventArgs e)
        {
            SerializationAccountActions actions = new SerializationAccountActions();

            actions.SerializeObject("conturi.xml", (DataContext as AccountsViewModel).UserList);
            Window.GetWindow(this).Close();
        }
 public StatisticsViewModel()
 {
     this.Lost     = false;
     this.Accounts = Views.Account.acVM;
     this.Gamer    = Accounts.UserList[Accounts.SelectedAccount];
     Gamer.GamePlay++;
     actions = new SerializationAccountActions();
     actions.SerializeObject("conturi.xml", Accounts.UserList);
 }
        public void GameStatus(bool win)
        {
            if (!win)
            {
                this.Lost = true;
                MessageBox.Show("You Lost!");
            }

            if (win)
            {
                Gamer.GameWon++;
                actions.SerializeObject("conturi.xml", Accounts.UserList);
                MessageBox.Show("You Win!");
            }
            OnPropertyChanged("GameStatus");
        }
예제 #4
0
 private void Exit_Click(object sender, RoutedEventArgs e)
 {
     actions.SerializeObject("conturi.xml", (DataContext as AccountsViewModel).UserList);
     Application.Current.MainWindow.Close();
 }