private void appbar_save_Click(object sender, EventArgs e) { AppData.Settings.alert_block = (bool)toggle_alert_block.IsChecked; AppData.Settings.lock_end_first = (bool)toggle_lock_end_first.IsChecked; AppData.Settings.lock_end_select = (bool)toggle_lock_end_select.IsChecked; AppData.Settings.main_end_first = (bool)toggle_main_end_first.IsChecked; AppData.Settings.main_end_select = (bool)toggle_main_end_select.IsChecked; if (list_sort.SelectedItem != null) { String tmps = (String)((ListPickerItem)list_sort.SelectedItem).Tag; if (tmps.Equals(SortType.last.ToString())) { AppData.Settings.sort_start = SortType.last; } else if (tmps.Equals(SortType.name_1.ToString())) { AppData.Settings.sort_start = SortType.name_1; } else if (tmps.Equals(SortType.name_2.ToString())) { AppData.Settings.sort_start = SortType.name_2; } else if (tmps.Equals(SortType.time_1.ToString())) { AppData.Settings.sort_start = SortType.time_1; } else if (tmps.Equals(SortType.time_2.ToString())) { AppData.Settings.sort_start = SortType.time_2; } } AppData.SetSave(); NavigationService.GoBack(); }
// Code to execute when the application is closing (eg, user hit Back) // This code will not execute when the application is deactivated private void Application_Closing(object sender, ClosingEventArgs e) { AppData.DB.Dispose(); AppData.SetSave(); }