Example #1
0
        public void View(string path, ContextObject context)
        {
            _epubControl          = new EpubViewerControl(context);
            context.ViewerContent = _epubControl;
            Exception exception = null;

            _epubControl.Dispatcher.BeginInvoke(new Action(() =>
            {
                try
                {
                    // Opens a book
                    var epubBook  = EpubReader.OpenBook(path);
                    context.Title = epubBook.Title;
                    _epubControl.SetContent(epubBook);
                    context.IsBusy = false;
                }
                catch (Exception e)
                {
                    exception = e;
                }
            }), DispatcherPriority.Loaded).Wait();

            if (exception != null)
            {
                ExceptionDispatchInfo.Capture(exception).Throw();
            }
        }
Example #2
0
 public void Cleanup()
 {
     _epubControl.Dispose();
     _epubControl = null;
 }