Пример #1
0
 public static void Show(Panel parent, string title, UIElement content, EventHandler closed)
 {
     var dialog = new Dialog();
     if (closed != null)
     {
         dialog.Closed += closed;
     }
     dialog.Header.Text = title;
     dialog.DialogContents.Content = content;
     dialog.Show(parent);
 }
Пример #2
0
        private void GameWin(object sender, EventArgs e)
        {
            GameWon(_game.Round);
            _game.LastMove = null;
            Sound.Play(Sounds.GameWon);

            var statistics = new StatisticsClient();
            statistics.IsHighscoreCompleted += IsHighscoreCompleted;
            statistics.IsHighscoreAsync(_game.Score, Game.HighScore, DateTime.Today.Day);

            var textBlock = new TextBlock
                                {
                                    Style = Styles.BodyText,
                                    Text = String.Format(Strings.GameWinText, _game.Round, _game.Score.ToString("N0"),
                                                         _game.Moves.ToString("N0")) + "\n\n" + Strings.GameWinChecking
                                };

            _dialog = new Dialog
                          {
                              DialogContents = {Content = new StackPanel()},
                              Header = {Text = Strings.GameWinTitle}
                          };
            _dialog.Closed += SubmitHighScore;
            ((StackPanel) _dialog.DialogContents.Content).Children.Add(textBlock);
            _dialog.Show(LayoutRoot);
        }