void Speakers_LoadCompleted(object sender, SourcesLoadCompletedEventArgs e) { // Turn off the progress bar. this.perfProgressBar.Visibility = System.Windows.Visibility.Collapsed; this.perfProgressBar.IsIndeterminate = false; if (App.ViewModel.SingleSpeaker == null) { // Switch to the ListBox instead of the scrollviewer for multiple speakers. ((PanoramaItem)(this.Panorama.Items[3])).Visibility = Visibility.Visible; ((PanoramaItem)(this.Panorama.Items[2])).Visibility = Visibility.Collapsed; } else { // Switch to the item for a single speaker. ((PanoramaItem)(this.Panorama.Items[2])).Visibility = Visibility.Visible; ((PanoramaItem)(this.Panorama.Items[3])).Visibility = Visibility.Collapsed; } App.ViewModel.LoadCompleted -= Speakers_LoadCompleted; App.ViewModel.LoadCompleted += new EventHandler <SourcesLoadCompletedEventArgs>(SessionFiles_LoadCompleted); // Turn back on the progress bar. this.perfProgressBar.Visibility = System.Windows.Visibility.Visible; this.perfProgressBar.IsIndeterminate = true; // Finally, load the session files. App.ViewModel.LoadSessionFiles(this.currentSession); }
void ViewModel_LoadCompleted(object sender, SourcesLoadCompletedEventArgs e) { // Turn off the progress bar. this.perfProgressBar.Visibility = System.Windows.Visibility.Collapsed; this.perfProgressBar.IsIndeterminate = false; App.ViewModel.LoadCompleted -= ViewModel_LoadCompleted; }
void SessionFiles_LoadCompleted(object sender, SourcesLoadCompletedEventArgs e) { // Turn off the progress bar. this.perfProgressBar.Visibility = System.Windows.Visibility.Collapsed; this.perfProgressBar.IsIndeterminate = false; App.ViewModel.LoadCompleted -= SessionFiles_LoadCompleted; if (App.ViewModel.SessionFiles.Count > 0) { // Turn on the list header text if there are session files. this.SessionFilesText.Visibility = System.Windows.Visibility.Visible; } }