I have a menu item that loads a Window. The problem is every time I click the menu item it loads a new instance of the same Window. This may corrupt my database so I need only one Window open.
I had a fix for this in Windows Forms but since WPF Windows do not implement IDisposable it does not work.
Here is my Windows Forms code. How do I do this with WPF?
private FormAssociates frmAssoc = null;
If ((frmAssoc == null) || (frmAssoc.IsDisposed())
frmAssoc = new FormAssociates();
frmAssoc.Owner = this;
// cannot bring a form to front if it is minimized...
frmAssoc.WindowState = WindowState.Normal;