canton7 / Stylet

A very lightweight but powerful ViewModel-First MVVM framework for WPF for .NET Framework and .NET Core, inspired by Caliburn.Micro.
MIT License
988 stars 143 forks source link

WindowManager.ShowDialog never returns nulled bool #142

Closed pingu2k4 closed 3 years ago

pingu2k4 commented 4 years ago

From a window requesting close after having been opened with ShowDialog on WindowManager, the returned result from ShowDialog will never be null. I tried RequestClose(); and RequestClose(null); and both instead return false.

canton7 commented 4 years ago

WindowManager.ShowDialog just wraps WPF's Window.ShowDialog(), and returns the same value. Calling RequestClose(x) sets the window's DialogResult to x.

From the docs, it looks like Window.ShowDialog() will never return null, which means that WindowManager.ShowDialog will never return null. I don't think there's anything I can do about this: changing the signature of that method would be a breaking change.

canton7 commented 3 years ago

Closing as no response.