private void HandleZoomFactorChanging() { if (_contentVsis != null) { _contentVsis.Dispose(); _contentVsis = null; } }
private void CreateContentSurface() { var zoomFactor = _pageViewObserver.ZoomFactor; var pageViewSize = new Size(Width * zoomFactor, Height * zoomFactor); var thumbnailSize = _thumbnailSis.Source.Size; if (pageViewSize.Width < thumbnailSize.Width && pageViewSize.Height < thumbnailSize.Height) { return; } _contentVsis = new VsisPageRenderer(Page, pageViewSize); var contentBackgroundBrush = new ImageBrush { ImageSource = _contentVsis.Source }; contentCanvas.Background = contentBackgroundBrush; }
private void CleanUp() { if (_pageViewObserver != null) { _pageViewObserver.ZoomFactorChanging -= HandleZoomFactorChanging; _pageViewObserver.ZoomFactorChanged -= HandleZoomFactorChanged; _pageViewObserver = null; } if (_contentVsis != null) { _contentVsis.Dispose(); _contentVsis = null; } _thumbnailSis = null; thumbnailContentCanvas.Background = null; contentCanvas.Background = null; contentCanvas.Children.Clear(); Page = null; TextLayer = null; }
private void UnloadedHandler(object sender, RoutedEventArgs e) { _contentVsis?.Dispose(); _contentVsis = null; }