stattotal.blogg.se

How to open a closed window
How to open a closed window









When you re-show the window using the above, it will of course be the same instance as the one that was previously hidden, hence will have the same data and state. So how can i start freshly my window after closed or hide the window.

how to open a closed window

Ok I've now read your question properly -) Disclaimer, untested! protected override void OnClosing( CancelEventArgs e)Į.Cancel = true // cancels the window close this.Hide() // Programmatically hides the window This should allow the window to be hidden/shown even if the user closes the window. Override OnClosing inside the Window and set e.Cancelled to true, then call. If the user has closed it though and a close is unavoidable, you can try the following. If you want the behaviour of hide/show, you should not call Window.Close() on the window at all, but hide it by calling Window.Hide().











How to open a closed window