/// <summary> /// Handles the Loaded event of the PodCastDetails control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.Windows.RoutedEventArgs"/> instance containing the event data.</param> private void PodCastDetails_Loaded( object sender, RoutedEventArgs e) { try { this.service = new PodCastService( App.Repositories, App.Downloader); } catch (ServiceException ex) { App.HandleException( "Service not initialized.", ex); return; } if (this.podCastId.HasValue) { PodCastDetailsViewModel podCast; try { podCast = this.service.GetPodCast( this.podCastId.Value); } catch (RepositoryException ex) { App.HandleException( "Error retrieving pod cast details", ex); return; } this.nameTextBox.Text = podCast.Name; this.urlTextBox.Text = podCast.Url.ToString(); this.descriptionTextBlock.Text = podCast.Description; this.authorTextBlock.Text = podCast.Author; } this.deleteButton.Click += this.DeleteButton_Click; }
/// <summary> /// Handles the Loaded event of the PodCastCreate control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.Windows.RoutedEventArgs"/> instance containing the event data.</param> private void PodCastCreate_Loaded( object sender, RoutedEventArgs e) { try { this.service = new PodCastService( App.Repositories, App.Downloader); } catch (ServiceException ex) { App.HandleException( "Service did not initialize.", ex); } }
/// <summary> /// Handles the Loaded event of the PodCastIndex control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.Windows.RoutedEventArgs"/> instance containing the event data.</param> private void PodCastIndex_Loaded( object sender, RoutedEventArgs e) { try { this.service = new PodCastService( App.Repositories, App.Downloader); } catch (ServiceException ex) { App.HandleException( "Error initializing service.", ex); return; } try { podCastsListBox.ItemsSource = this.service.GetPodCasts(); } catch (RepositoryException ex) { App.HandleException( "Error retrieving pod cast index.", ex); return; } podCastsListBox.SelectionChanged += this.PodCastsListBox_SelectionChanged; addPodCastButton.Click += this.AddPodCastButton_Click; }