There is no way to reuse the Window after ShowDialog has been called [on hold]
As the title says - there is no way to reuse the Window after ShowDialog() has been called. Possible outcomes are that the user clicks close button which closes the Window and the expected behaviour is that the Window gets closed and disposed. But, if user calls Window.Hide() in code, this will also dispose the Window. I found some articles where it says this is a bug but it is so weird thet they would let this out as a bug. If you check WinForms there you can call ShowDialog() as many times as you want since Hide() just conceals the Window from the user and the ShowDialog() method is just a way of showing the Window to the user while blocking message loop of previous Window. My question is - is there a way to successfuly call ShowDialog() after calling Hide()? Any workarounds you might have? The closes I can get is inheriting the Window and hiding ShowDialog() method with new one where I call Show() method and immediately after it I can call System.Windows.Threading.Dispatcher.Run(). This kinda freezes the previous message loop but the problem with this is I don't know how to pop the main execution frame from the event queue. If I caould 'undo' this method call somehow I would continue with execution of my own implementation of ShowDialog and could return a bool value. UPDATE Window.Hide() does not dispose the Window it simply conceals it. The issue is calling Close() or setting DialogResult to anything but null. Both of these approaches will dispose the Window and next call to ShowDialog will produce exception: Cannot set Visibility or call Show, ShowDialog, or WindowInteropHelper.EnsureHandle after a Window has closed. Only Close and setting DialogResult to true/false will cause the ShowDialog() method to return. So bottom line is that you cannot reuse the Window after calling ShowDialog() once and getting a return value from this method.
Non-blocking Sockets vs BeginXXX vs SocketAsyncEventArgs
MVVM viewmodel events (commands?)
Powershell nothing returned from C#, same code runs in ps prompt with \r\n's removed
How do I change the foreground text color of (local variable '…' is never used) in code
HttpHandler to render a png from an array of bytes
MVC Default Area Not working
Index (zero based) must be greater than or equal to zero and less than the size of the argument list [closed]
How to smoothly play a sequence of videos with WPF's MediaElement?
Creating Zip without third party DLLs. Getting Part URI must start with a forward slash error
Creating a list of static objects in asp.net
How can I get the StripOffsets tag to stay the same when using the LibTiff.Net 2.3 library?
Iterate a group in active directory using C Sharp
Type . insted of ,
Client HTTP Handling & ETag
Missing network sent/received