public SpeakerListPage() { this.InitializeComponent(); ViewModel = SpeakerListViewModel.GetSpeakerListViewModel(); Add_Command = new RelayCommand(() => Add()); Refresh_Command = new RelayCommand(() => Refresh()); }
/// <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 IActionResult GetSpeakers() { var speakerListViewModel = new SpeakerListViewModel { SpeakerList = _speakerService.GetSpeakers().ToList() }; return(View(speakerListViewModel)); }
protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e) { base.OnNavigatedTo (e); if (e.NavigationMode == System.Windows.Navigation.NavigationMode.New) { var vm = new SpeakerListViewModel (); vm.BeginUpdate (Dispatcher); DataContext = vm; } }
protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e) { base.OnNavigatedTo(e); if (e.NavigationMode == System.Windows.Navigation.NavigationMode.New) { var vm = new SpeakerListViewModel(); vm.BeginUpdate(Dispatcher); DataContext = vm; } }
private async void DeleteSpeaker(object sender, RoutedEventArgs e) { ContentDialog deleteDialog = new ContentDialog { Title = "Delete Protocol", Content = (((Button)sender).DataContext as SpeakerViewModel).Name + " will be deleted.", PrimaryButtonText = "Delete", SecondaryButtonText = "Cancel" }; if (await deleteDialog.ShowAsync() == ContentDialogResult.Primary) { await SpeakerListViewModel.GetSpeakerListViewModel().DeleteSpeaker(((Button)sender).DataContext as SpeakerViewModel); } else { deleteDialog.Hide(); } }
public SpeakerListPage(SpeakerListViewModel bindingContext) { InitializeComponent(); BindingContext = ViewModel = bindingContext; }