public EbookDetails(Ebook ebook) { InitializeComponent(); var ebookViewSource = (Ebook)FindResource("ebookViewSource"); ebookViewSource = ebook; Image.Source = new BitmapImage(new Uri(Path.Combine(FilePaths.EbookDataDirectory, ebook.Id.ToString(), "cover.png"))).Clone(); }
private void BtnDelete_OnClick(object sender, RoutedEventArgs e) { var res = MessageBox.Show("Dou you really want to delete the ebook?", "Delete Ebook", MessageBoxButtons.YesNo); if (res != System.Windows.Forms.DialogResult.Yes) { return; } Ebook selectedEbook = (Ebook)ebookListView.SelectedItem; var service = new EbookService(); service.DeleteEbook(selectedEbook.Id); }
private void Window_Loaded(object sender, RoutedEventArgs e) { ebookViewSource = ((Ebook)(this.FindResource("Ebook"))); }