Singleton dialog instances

Apr 5, 2011 at 7:42 AM

I have a data grid in my main window (shell) containing records. Users can either double click an existing record to view its details in a new window or click "New Record" button to open a new empty record detail window. I'm using ShowWindow method of WindowManager to open these windows as modeless. What I want to achieve is that if the details window of an existing record is already open, I want that get window gets focus when user double clicks that existing record from the data grid inside main window, otherwise open the details of that record in a new window.

Is there a built-in way to do this in CM, like implementing GetHashCode on my VMs, WindowManager caches these hash codes and do the appropriate action, create new window or focus existing one. Or should I derive from WindowManager to implement this functionality? Thanks.

Apr 5, 2011 at 3:29 PM

The current version doesn't support that, but I'm looking to fix that in the next version. The best way to do this is probably to inherit from WindowManager and add that functionality on top.

Jul 5, 2011 at 5:59 AM


I was interested in this kind of capability as well (for an SDI multi-view application that has many non-modal windows open at the same time).  I'm using 1.1, and CM  opens a new view on every call to ShowWindow.  The interesting thing is that if you close one instance of a particular view, all the others close as well.

Is the recommendation still to extend WindowManager?