Exemple #1
0
        public static ViewerState SaveViewerState(string futureAccessToken, ScrollViewer scrollViewer, StackPanel imagePanel, PageRange visibleRange)
        {
            ViewerState viewerState = new ViewerState(futureAccessToken)
            {
                hOffset = scrollViewer.HorizontalOffset,
                vOffset = scrollViewer.VerticalOffset,
                zFactor = scrollViewer.ZoomFactor,

                panelWidth  = imagePanel.ActualWidth,
                panelHeight = imagePanel.ActualHeight,

                visibleRange = visibleRange,
                lastViewed   = DateTime.Now
            };

            if (imagePanel.Orientation == Orientation.Horizontal)
            {
                viewerState.isHorizontalView = true;
            }

            return(viewerState);
        }
Exemple #2
0
 private ViewerState SaveViewerState()
 {
     ViewerState viewerState = new ViewerState(this.futureAccessToken);
     viewerState.hOffset = this.scrollViewer.HorizontalOffset;
     viewerState.vOffset = this.scrollViewer.VerticalOffset;
     viewerState.panelWidth = this.imagePanel.ActualWidth;
     viewerState.panelHeight = this.imagePanel.ActualHeight;
     viewerState.zFactor = this.scrollViewer.ZoomFactor;
     viewerState.lastViewed = DateTime.Now;
     viewerState.visibleRange = this.VisiblePageRange;
     if (this.imagePanel.Orientation == Orientation.Horizontal)
         viewerState.isHorizontalView = true;
     return viewerState;
 }