Example #1
0
 /// <summary>
 /// Upon window close the server service closes to prevent DB connection leaks.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void WindowClosing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     ((ServerService)SL.Get(typeof(ServerService))).StopService();
 }
Example #2
0
        /// <summary>
        /// This button causes the app to show all highscores for every level. A new highscore added needs manual refresh.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ShowLevelHighscoresButton_Click(object sender, RoutedEventArgs e)
        {
            var db = (DatabaseService)SL.Get(typeof(DatabaseService));

            dataGrid.ItemsSource = db.GetAllLevelsWithHighscores();
        }