I have a pretty specific problem with the documentviewer control. Let me explain:
I have a documentviewer that is by default in an invisible grid that sits on top of my data-representation. When i press a specific button (generate report, bound to a command on my viewmodel), a report and xps document for the documentviewer(fixed page etc.) is generated and the documentviewer-grid is set to visible. So far so good. The strange thing and the root of my problem is that everything is working fine and displaying as it should when the button is pressed via touch-input on a touch-screen.
When it's pressed via mouse, the command fires, the documentviewer shows, BUT the document shows up all messed up. Tables are a mess, custom-controls are not sized correctly etc. As soon as the cursor is moved into the document or the area inside the documentviewer is clicked, everything lines up and displays correctly.
I suspected a difference between touch and click concerning focus on the control and tried various hacks of manually updating the layout when the control becomes visible. No success.
Additionally: My XPS Document contains a layout with usercontrols and grids that are generated when the generate-report command is fired. What seems interesting is that the user-control scaling seems to break down only when there are multiple elements on the page.
Edit: Changes to visibility have no effect at all. It behaves exactly the same when the documentviewer is visible the whole time and the document it is bound to gets updated.
Any help or ideas appreciated.