private void RemovePlayer(Player p)
 {
     Players.Remove(p);
     HideRemoveButton();
     BuildGameBoard();
 }
 public void SetUp()
 {
     p = new Player();
 }
        void GameFrame_Tapped(object sender, TappedRoutedEventArgs e)
        {
            if (!IsGameEnded)
            {
                EditPosition = 1;
                //AdBox.Suspend();
                Grid g = sender as Grid;
                EditPlayer = g.DataContext as Player;
                TextBlock t1 = g.Children[2] as TextBlock;
                TextBlock t2 = g.Children[3] as TextBlock;
                TextBlock FrameNumber = g.Children[4] as TextBlock;
                EditText1.Text = t1.Text;
                EditText2.Text = t2.Text;
                EditFrame = Int32.Parse(FrameNumber.Text);

                if (EditFrame < EditPlayer.Game.CurrentFrame)
                {
                    string Place;
                    string Apostrophe = "'s ";
                    switch (EditFrame)
                    {
                        case 0:
                            Place = "1st";
                            break;
                        case 1:
                            Place = "2nd";
                            break;
                        case 2:
                            Place = "3rd";
                            break;
                        default:
                            Place = EditFrame.ToString() + "th";
                            break;
                    }
                    if (EditPlayer.Name.Substring(EditPlayer.Name.Length - 2, 1).ToLower() == "s") Apostrophe = "' ";
                    EditTitle.Text = "Edit " + EditPlayer.Name + Apostrophe + Place + " Frame";
                    EditBox.Visibility = Visibility.Visible;
                }
            }
            //EditFrameButton.Visibility = Visibility.Visible;
            //BottomBar.IsOpen = true;
            //ResetAllFrameBackgrounds();
            //Grid g = sender as Grid;
            //g.Background = GrayBrush;
            //OldGrid = g;
        }
 private void AddNewPlayer()
 {
     if ((AddNewPlayerText.Text != String.Empty) && (AddNewPlayerText.Text != ""))
     {
         AddPlayerPopup.IsOpen = false;
         BottomBar.IsOpen = false;
         Player p = new Player(AddNewPlayerText.Text);
         Players.Add(p);
         AddNewPlayerCleanup();               
     }
     else
     {
         AddNewPlayerError.Visibility = Visibility.Visible;
         //AddNewPlayerText.Focus(Windows.UI.Xaml.FocusState.Programmatic);
     }
 }
 private void AddBowlerButton_Tapped(object sender, TappedRoutedEventArgs e)
 {
     p = new Player();
     ShowEditForm();
 }
 private void AddPlayerButton_Click(object sender, RoutedEventArgs e)
 {
     p = new Player();
     ShowEditForm();
 }
 private void Player_Tapped(object sender, TappedRoutedEventArgs e)
 {
     OldGrid.Background = Gray666Brush;
     if (OldGrid.DataContext != null) ((Grid)((Grid)OldGrid.Children[0]).Children[0]).Visibility = Visibility.Collapsed;
     Grid g = sender as Grid;
     ((Grid)((Grid)g.Children[0]).Children[0]).Visibility = Visibility.Visible;
     g.Background = Gray444Brush;
     p = (Player)g.DataContext;
     ShowEditForm();
     OldGrid = g;
 }