I am using .NET 2.0 & C# to develop a WinForm Mdi application. It will have a Main Window and a lot of mdi windows. I am thinking I should use which design pattern to manage mdi windows. Because I want only one instance for each window, if window is existed, I will show it on top, & otherwise I will create and show it.
Note: a mdi window is opened from Menus of Main Window or open from another mdi window. An example is very good.
Update: Menu’s status is depended on mdi window’s status. Ex: If Window ‘A’ is openned -> menu ‘A’ -> disabled. When window ‘A’ is closed -> I update menu ‘A’ status to Enabled.
Thanks.
I dont think you will find one pattern to solve the problem, but will be a collaboration of pattern. The links provided by Josh are interesting read.
A simple suggestion based on GoF pattern will be as below:
menu click event
so that it creates only single
instance of the window, using
approach from Singleton pattern
will be the subject and you will need
to structure your code so that you
can embedded observer logic in your
menu controller.