public void Load(IPdfSource source, string password = null) { this.scrollViewer = VisualTreeHelperEx.FindChild <ScrollViewer>(this); this.imageProvider = new PdfImageProvider(source, this.parent.TotalPages, new PageDisplaySettings(this.parent.GetPagesPerRow(), this.parent.ViewType, this.parent.HorizontalMargin, this.parent.Rotation), false, password); currentPageIndex = 0; if (this.scrollViewer != null) { this.scrollViewer.Visibility = System.Windows.Visibility.Visible; } if (this.parent.ZoomType == ZoomType.Fixed) { this.SetItemsSource(); } else if (this.parent.ZoomType == ZoomType.FitToHeight) { this.ZoomToHeight(); } else if (this.parent.ZoomType == ZoomType.FitToWidth) { this.ZoomToWidth(); } }
public void Load(IPdfSource source, string password = null) { virtualPanel = VisualTreeHelperEx.FindChild <CustomVirtualizingPanel>(this); scrollViewer = VisualTreeHelperEx.FindChild <ScrollViewer>(this); virtualPanel.PageRowBounds = parent.PageRowBounds.Select(f => f.SizeIncludingOffset).ToArray(); imageProvider = new PdfImageProvider(source, parent.TotalPages, new PageDisplaySettings(parent.GetPagesPerRow(), parent.ViewType, parent.HorizontalMargin, parent.Rotation), password: password); if (parent.ZoomType == ZoomType.Fixed) { CreateNewItemsSource(); } else if (parent.ZoomType == ZoomType.FitToHeight) { ZoomToHeight(); } else if (parent.ZoomType == ZoomType.FitToWidth) { ZoomToWidth(); } if (scrollViewer != null) { scrollViewer.Visibility = Visibility.Visible; scrollViewer.ScrollToTop(); } }
public void Load(string pdfFilename) { this.virtualPanel = VisualTreeHelperEx.FindChild <CustomVirtualizingPanel>(this); this.scrollViewer = VisualTreeHelperEx.FindChild <ScrollViewer>(this); this.virtualPanel.PageRowBounds = this.parent.PageRowBounds.Select(f => f.SizeIncludingOffset).ToArray(); this.imageProvider = new PdfImageProvider(pdfFilename, this.parent.TotalPages, new PageDisplaySettings(this.parent.GetPagesPerRow(), this.parent.ViewType, this.parent.HorizontalMargin, this.parent.Rotation)); if (this.parent.ZoomType == ZoomType.Fixed) { this.CreateNewItemsSource(); } else if (this.parent.ZoomType == ZoomType.FitToHeight) { this.ZoomToHeight(); } else if (this.parent.ZoomType == ZoomType.FitToWidth) { this.ZoomToWidth(); } if (this.scrollViewer != null) { this.scrollViewer.ScrollToTop(); } }
public void Unload() { this.scrollViewer.Visibility = System.Windows.Visibility.Collapsed; this.scrollViewer.ScrollToHorizontalOffset(0); this.scrollViewer.ScrollToVerticalOffset(0); currentPageIndex = 0; this.imageProvider = null; }
public void Unload() { scrollViewer.Visibility = Visibility.Collapsed; scrollViewer.ScrollToHorizontalOffset(0); scrollViewer.ScrollToVerticalOffset(0); currentPageIndex = 0; imageProvider = null; }
public void Unload() { scrollViewer.Visibility = Visibility.Collapsed; scrollViewer.ScrollToHorizontalOffset(0); scrollViewer.ScrollToVerticalOffset(0); imageProvider = null; if (virtualizingPdfPages != null) { virtualizingPdfPages.CleanUpAllPages(); virtualizingPdfPages = null; } itemsControl.ItemsSource = null; }
public void Unload() { this.scrollViewer.Visibility = System.Windows.Visibility.Collapsed; this.scrollViewer.ScrollToHorizontalOffset(0); this.scrollViewer.ScrollToVerticalOffset(0); this.imageProvider = null; if (this.virtualizingPdfPages != null) { this.virtualizingPdfPages.CleanUpAllPages(); this.virtualizingPdfPages = null; } this.itemsControl.ItemsSource = null; }
public void Load(string pdfFilename) { this.scrollViewer = VisualTreeHelperEx.FindChild <ScrollViewer>(this); this.imageProvider = new PdfImageProvider(pdfFilename, this.parent.TotalPages, new PageDisplaySettings(this.parent.GetPagesPerRow(), this.parent.ViewType, this.parent.HorizontalMargin, this.parent.Rotation), false); currentPageIndex = 0; if (this.parent.ZoomType == ZoomType.Fixed) { this.SetItemsSource(); } else if (this.parent.ZoomType == ZoomType.FitToHeight) { this.ZoomToHeight(); } else if (this.parent.ZoomType == ZoomType.FitToWidth) { this.ZoomToWidth(); } }