示例#1
0
        private void BetClickExecute()
        {
            var     unit       = 2;
            var     totalPoint = MainwindowViewModel.GetInstance().User.Points;
            decimal bet        = 0;

            if (totalPoint > 0)
            {
                if (totalPoint > unit)
                {
                    bet = unit;
                }
                else
                {
                    bet = totalPoint - unit;
                }

                MainwindowViewModel.GetInstance().User.MinusPoints(bet);
                MainwindowViewModel.GetInstance().RefreshPoints();
                MainwindowViewModel.GetInstance().Bets += bet;
                Bet.AddBets(bet);
            }
        }
示例#2
0
 public MainWindow()
 {
     InitializeComponent();
     viewModel        = MainwindowViewModel.GetInstance();
     this.DataContext = viewModel;
 }