예제 #1
0
 private void HandleZoomFactorChanging()
 {
     if (_contentVsis != null)
     {
         _contentVsis.Dispose();
         _contentVsis = null;
     }
 }
예제 #2
0
        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;
        }
예제 #3
0
        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;
        }
예제 #4
0
 private void UnloadedHandler(object sender, RoutedEventArgs e)
 {
     _contentVsis?.Dispose();
     _contentVsis = null;
 }