![wpd viewer doesnt work on tablet wpd viewer doesnt work on tablet](https://www.cisdem.com/images/features/documentreader/read-l.png)
That is, execution of your program goes to PdfReader window. It means CLR executes modally your new PdfReader window. You code is: PdfReader form = new PdfReader(1) Just reorder your call of ShowDialog(): PdfReader form = new PdfReader(1) Īnd set ShutdownMode="OnLastWindowClose" at App.xaml file of your application: If you set ShutdownMode to OnLastWindowClose, Windows Presentationįoundation (WPF) implicitly calls Shutdown when the last window in anĪpplication closes, even if any currently instantiated windows are set If it is in the list, try the methods below to remove the driver and fix the issue. This driver will be listed as Microsoft WPD 12:00:00 AM.
Wpd viewer doesnt work on tablet update#
However, this code will close your application as MSDN says(thanks to Aiman):Ī ShutdownMode of OnMainWindowClose causes Windows Presentationįoundation (WPF) to implicitly call Shutdown when the MainWindowĬloses, even if other windows are currently open.Īnd you should set your ShutdownMode to OnLastWindowClose as MSDN says: From Start, choose Settings, then Update and Security, Windows Update, and then select Update History. This means that you can click on the parent form. The Window.Show() function shows the form in a non modal form. When You use Window.ShowDialog(), it calls new Window modally, meaning you cannot go to the parent form. I hope this will safe time for someone like me :) I caught the exception: " Full Exception: System.InvalidOperationException: The calling thread cannot access this object because a different thread owns it.Īt .VerifyAccess()Īt ()."Ĭonsequently, instead of this: ().GetEvent() Nevertheless, when I enabled "Common Language Runtime exception" through visual studio settings:
![wpd viewer doesnt work on tablet wpd viewer doesnt work on tablet](https://3nlm2c1gjj0z2ju16293909h-wpengine.netdna-ssl.com/wp-content/uploads/2019/07/open-wpd-file-on-mac-neooffice.jpg)
However it didn't happen without an error or visible reason. I raised an event from the server and when it happened I raised another event through custom Event Aggregator to close the second Window that is opened (without shutting down the application). This is exactly that happened in my case. Important detail that we need to bear in mind when we deal with windows closure and other UI operation: we need to execute it in UI thread only.