Hi,Your approach is not familiar to me but I can see at least one problem within your example. The method
private Canvas UpdateECUpages(FrameworkElement e, int i, Size visibleSize, PageImageableArea PageImageableArea, Thickness margin)
receiving FrameworElement e but returns new Canvas object. You may want to assign a new content (preserving the reference) to the e element as newCanvas and return e, or you can change the method signature to
private void UpdateECUpages(ref FrameworkElement e, int i, Size visibleSize, PageImageableArea PageImageableArea, Thickness margin)
and in the method assign a new value to e. e = newCanvas; and then use the e object in your following code. Another option is to use a different approach, see the accepted solution here
[
^]
Sorry for my English and not full ansver.
Best wishes,
Roman