public static void Create(Grid layoutRoot) { Current = new GamePanel(); Current.LayoutRoot = layoutRoot; layoutRoot.Children.Add(Current); Block.Size = Convert.ToInt32((Database.Current.ScreenWidth - 7 * 4) / 6); Current.RowCount = Convert.ToInt32(Database.Current.ScreenHeight / Block.Size) - 1; Current.ColumnCount = 6; ScoreboardDialog.Create(); OptionsDialog.Create(); AboutDialog.Create(); }
public void GameOver() { StopTimer(); RemoveAllBlocks(); CalculateWordPoint(); if (Point > Database.Current.Player.Score.PlayerScore) { Database.Current.Player.Score.PlayerScore = Point; ScoreboardDialog.Update(); NewScoreDialog.Create(); GamePanel.Current.ShowDialog(NewScoreDialog.Current); } else { GameOverDialog.Create(); GamePanel.Current.ShowDialog(GameOverDialog.Current); } }
public void CreateDialog() { Dialog = new Grid(); Dialog.Width = 0; Dialog.Height = 0; Dialog.VerticalAlignment = VerticalAlignment.Center; Dialog.HorizontalAlignment = HorizontalAlignment.Stretch; Dialog.Background = new SolidColorBrush(Colors.Orange); DialogTabs = new Pivot() { Margin = new Thickness(0, -25, 0, -25) }; PivotItem scorePivot = new PivotItem() { Content = ScoreboardDialog.Current, Margin = new Thickness(12, 0, 12, 12) }; DialogTabs.Items.Add(new PivotItem() { Content = null, Margin = new Thickness(12, 0, 12, 12) }); DialogTabs.Items.Add(scorePivot); DialogTabs.Items.Add(new PivotItem() { Content = OptionsDialog.Current, Margin = new Thickness(12, 0, 12, 12) }); DialogTabs.Items.Add(new PivotItem() { Content = AboutDialog.Current, Margin = new Thickness(12, 0, 12, 12) }); DialogTabs.SelectionChanged += (c, r) => { if (DialogTabs.SelectedIndex == 1) { ScoreboardDialog.Update(); scorePivot.Content = ScoreboardDialog.Current; } }; Dialog.Children.Add(DialogTabs); Canvas.SetZIndex(Dialog, 99999); LayoutRoot.Children.Add(Dialog); }