I have a ScrollViewer and very "long" content in it. I wrote a class that inherits from DocumentPaginator, but I don't understand how do I create a "frame" for every part of this Visual? I mean, how do I "look" at the next page of the control? I tried this, but with no 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 first page as it should be, second page is exactly like first, and all the rest pages are blank.