コード例 #1
0
 public SpeakerListPage()
 {
     this.InitializeComponent();
     ViewModel       = SpeakerListViewModel.GetSpeakerListViewModel();
     Add_Command     = new RelayCommand(() => Add());
     Refresh_Command = new RelayCommand(() => Refresh());
 }
コード例 #2
0
        /// <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();
        }
コード例 #3
0
        public IActionResult GetSpeakers()
        {
            var speakerListViewModel = new SpeakerListViewModel {
                SpeakerList = _speakerService.GetSpeakers().ToList()
            };

            return(View(speakerListViewModel));
        }
コード例 #4
0
ファイル: SpeakerList.xaml.cs プロジェクト: kssagra/SagraEmi
        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;
            }
        }
コード例 #5
0
        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;
            }
        }
コード例 #6
0
        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();
            }
        }
コード例 #7
0
        public SpeakerListPage(SpeakerListViewModel bindingContext)
        {
            InitializeComponent();

            BindingContext = ViewModel = bindingContext;
        }