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();
        }
Example #2
0
        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);
        }
Example #3
0
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     ebookViewSource = ((Ebook)(this.FindResource("Ebook")));
 }