UWP Print preview not updating after window resize -


i'm developing uwp app , using windows.graphics.printing.printmanager class show preview window. have controls affect result , call printdocument.invalidatepreview() refresh preview when user changes them. works fine until user resizes window. after preview not updated after calling printdocument.invalidatepreview().

it’s absolutely unclear what’s going on within invalidatepreview, because documentation poor , there’s no source code.

does know fix or workaround that?

i wrote simple demo try reproduce issue cannot reproduce. invoke printdoc.invalidatepreview() after user change print preview option, code follows

  if (optionid == "pagecontent")   {       await dispatcher.runasync(windows.ui.core.coredispatcherpriority.normal, () =>       {           printdoc.invalidatepreview();       });   } 

and worked well, worked after app's window resized. seems invaliddatepreview() recall printdocument.getpreviewpage event if have subscribed , print preview refresh. uploaded demo github, can download testing , compare project find differences. if cannot resolved compare differences, can try reproduce issue on demo , let solve again.

more details please reference:https://msdn.microsoft.com/en-us/windows/uwp/devices-sensors/print-from-your-app. , official sample:https://github.com/microsoft/windows-universal-samples/tree/master/samples/printing


Comments