How To Reopen Closed Windows

How To Reopen Closed Windows Average ratng: 8,6/10 3873 reviews

Oct 02, 2018  Go to This PC or anywhere in File Explorer. Press Ctrl + F1 to expand the options panel. Click on the View tab. At the right, click Options then select Change folder and search options. Go to View Tab. Under Advanced settings, scroll down and enable the option that reads Restore previous folder windows at logon.

  1. How To Reopen Windows On Mac
  2. Restore Tabs Edge
  3. How To Reopen Windows

I switch ShutdownMode in my app to OnExplicitShutdown so when I close window, my app still working and I try to reopen window like this:

Open

But I've got following error: Set property '...ViewModelLocator.AutoWireViewModel' threw an exception. and InnerException is: 'AutoWireViewModel' property was already registered by 'ViewModelLocator'

Have you any idea how to fix this?

I use ViewModelLocator from Microsoft.Prism

BartoszKP
27.4k10 gold badges74 silver badges110 bronze badges
rechandlerrechandler

How To Reopen Windows On Mac

1 Answer

Unfortunately, you simply can't re-open a Window after it has been closed. However, you can 'pretend' that you can and use a little deception... instead of closing the Window in the first place, you could simply hide it, as it can be hidden and re-displayed any number of times:

You could improve this situation slightly perhaps, by attaching an event handler to the Window.Closing Event. This particular event provides a way to cancel the Close operation and so at this point, you could hide it instead:

You could alternatively put this functionality inside the Window code behind using the Window.OnClosing Method if you preferred.

SheridanWindows

Restore Tabs Edge

Sheridan

How To Reopen Windows

57.1k16 gold badges114 silver badges163 bronze badges
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.

Not the answer you're looking for? Browse other questions tagged c#wpfprismviewmodellocator or ask your own question.