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.
How to calculate the sum of the datatable column in c#
System.ArgumentException “Parameter is not valid” when comparing image dimensions
Set field via class
how to use ModelState.IsValid in ASP.NET?
protobuf-net : v2 deserialize v1 objects with inheritance
Getting data on ListView Select event and setting it in a div in C#
c# Oledb add list of parameters in a foreach loop
dotnet ef not works with ef tools 1.1.0-preview4-final
Check permission of a PDF using itext [duplicate]
Is there an event fired when WebBrowser content is redrawn?
How can I filter a DataTable without brute-forcing it?
Creating objects using an older version of Google Protobuf
WPF Combo box not calling setter method when item changed
Entity RemoveRange delete all rows
zip is not working in the same way on 4.2 to 6.0
Twilio Error - 12300 - Invalid Content Type only sometimes