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;
            }
        }
        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);
        }
Exemple #3
0
 public Session(Session other)
 {
     ByScore = other.ByScore;
     PlayerName = other.PlayerName;
 }