/// <summary> /// Loading app resources when on extended splash screen. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> async void DismissedEventHandler(SplashScreen sender, object e) { dismissed = true; // Updating the loading text depends on loading operation. This call is performed safely using the main UI thread. // If there's any error, ignore anh proceed to main page. Errors will be shown specifically in corresponding pages. // Load protocols await CoreApplication.MainView.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => LoadingText.Text = "Loading Protocols..."); try { ProtocolListViewModel.GetProtocolListViewModel(); } catch { } // Load speakers await CoreApplication.MainView.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => LoadingText.Text = "Loading Speakers..."); try { SpeakerListViewModel.GetSpeakerListViewModel(); } catch { } // (Fake) Finalizing await CoreApplication.MainView.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => LoadingText.Text = "Finalizing Initialization..."); Thread.Sleep(2000); // Dismiss and go to main page. DismissExtendedSplash(); }
public ProtocolListPage() { this.InitializeComponent(); ViewModel = ProtocolListViewModel.GetProtocolListViewModel(); Add_Command = new RelayCommand(() => Add()); Refresh_Command = new RelayCommand(() => Refresh()); }
private async void DeleteProtocol(object sender, RoutedEventArgs e) { ContentDialog deleteDialog = new ContentDialog { Title = "Delete Protocol", Content = (((Button)sender).DataContext as ProtocolViewModel).Name + " will be deleted.", PrimaryButtonText = "Delete", SecondaryButtonText = "Cancel" }; if (await deleteDialog.ShowAsync() == ContentDialogResult.Primary) { await ProtocolListViewModel.GetProtocolListViewModel().DeleteProtocol(((Button)sender).DataContext as ProtocolViewModel); } else { deleteDialog.Hide(); } }