I have a ScrollViewer and very "long" content. I wrote a class that inherits from DocumentPaginator, but I don’t understand how to create a “frame” for each part of this Visual? I mean, how do I “look” at the next page of the control? I tried this, but without success:
public override DocumentPage GetPage(int pageNumber)
{
double left = pageNumber * pageSize.Width;
Point pt = new Point(left, 0);
visual.RenderTransform = Transform.Identity;
visual.RenderTransform = new TranslateTransform(-left, 0);
visual.Measure(pageSize);
visual.Arrange(new Rect(visual.DesiredSize));
DocumentPage page = new DocumentPage(visual);
return page;
}
With this code, I get the first page, as it should be, the second page is exactly the same as the first, and all the other pages are empty.
source
share