tags:

views:

37

answers:

2

I want to check if a wpf windows is hidden then show it and if it is closed (by close button or by any other methods) then create new and show it.

A: 

check the Visibility property on the window. If it is not Visible call Show()

Patrick Klug
Visibility is always visible after closing window
Jeevan Bhatt
A: 

Use the Window.Closed event handler to do something creative. ie, You can set some property in the ViewModel and send a message to other ViewModels.

Check this sample. It may take time to understand. But worth knowing it.

Or you can use the Window.Closing event handler to cancel the user action.

Veer