Exemplo n.º 1
0
        protected override void OnNavigatedTo(NavigationEventArgs args)
        {
            Params = args.Parameter as Session;

            if (Params != null)
            {
                BtnState = Params.ByScore ? ButtonState.BY_SCORE : ButtonState.BY_TIME;
                if (!viewModel.IsPending)
                {
                    if (Params.ByScore)
                    {
                        viewModel.GetAllScoreLimitedGamesAsync();                    }

                    if (Params.ByTime)
                    {
                        viewModel.GetAllTimeLimitedGamesAsync();
                    }
                }
            }

            if (viewModel.IsPending)
            {
                btn_ByScore.Visibility = Visibility.Collapsed;
                btn_ByTime.Visibility = Visibility.Collapsed;
            }
        }
Exemplo n.º 2
0
        private void BtnOption_OnClick(object sender, RoutedEventArgs e)
        {
            Button btnSender = sender as Button;
            bool byScore = btnSender == btn_byScore;

            Session session = new Session(byScore, nameInput.Text);
            Frame.Navigate(typeof (Game), session);
        }
Exemplo n.º 3
0
 public Session(Session other)
 {
     ByScore = other.ByScore;
     PlayerName = other.PlayerName;
 }