I have a WPF window that is run on a background thread as a sort of “notifier window”… when an event is raised, it displays a message… a user clicks the “Snooze” button and I call this.Visibility = Visibility.Collapsed
The very moment that I hide the window (either by calling this.Hide() or setting the Visibility as mentioned above)… the “ShowDialog()” code releases the window and closes it.
This is absolutely a bug in the WPF code (which I’ve identified via reflector)… but my question remains. Has anyone been able to come up with a work-around for this issue?
I’ve tried many things and am now reaching out to ya’ll smart people 🙂
OK, and as quickly as that – my boss (old C++ goofy guy that he is) figured out the answer.
Here was the code inside of my background thread (which is set to STA mode):
And here is the modification, that strangely enough works perfectly 🙂
And that’s it.
This kinda thing makes me hate C++ people though, and makes me want to just say “if you just built it right in the first place I wouldn’t have to look for a work-around!” (j/k)