コード例 #1
0
        private void ScoresBorad_Click(object sender, RoutedEventArgs e)
        {
            ResultWindow resWindow = new ResultWindow();

            resWindow.Result.ItemsSource = rslt.Results.ToList();
            resWindow.Show();
        }
コード例 #2
0
ファイル: MazeWindow.xaml.cs プロジェクト: Obi1one/Maze
        private void Exit_MouseEnter(object sender, MouseEventArgs e)
        {
            timer.Stop();
            this.Close();
            ResultWindow resWindow = new ResultWindow();

            using (ActualResultContext rslt = new ActualResultContext()) {
                id = rslt.Results.Count();
                Result rs = new Result {
                    ID = ++id, NickName = nick, TimeResult = DateTime.Now - startTime
                };
                rslt.Results.Add(rs);
                rslt.SaveChangesAsync();
                resWindow.Result.ItemsSource = rslt.Results.ToList();
            }
            MessageBoxResult exit = MessageBox.Show("Congratulations!!" + "\n" + "Your Time: " + (DateTime.Now - startTime).ToString());

            if (exit == MessageBoxResult.OK)
            {
                resWindow.Show();
            }
        }