private void ScoresBorad_Click(object sender, RoutedEventArgs e) { ResultWindow resWindow = new ResultWindow(); resWindow.Result.ItemsSource = rslt.Results.ToList(); resWindow.Show(); }
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(); } }