I have started to develop a support tool for an old legacy system that is no longer maintained but still needed for the foreseeable future. The legacy system offers few, clunky and error prone methods for basic tasks such as handling users, rules, data imports and settings. The Tool I am developing will be used by the inhouse support team.
I'm using panels to group related tasks together. I intend to load each panel into a TabControl on user request. The main form have a few user settings that affects/ all panels. A panel might perform a task that other panels need to aware of.
Question TL:DR
How can the MainForm
be made aware that Panel
A have made a significant change that other panels
might be interested in?
How can a panel receive information from MainForm
?
My thoughts so far:
The MainForm
could get information from each Panel
by subscribing to custom events (such as a UsersUpdatedEvent
). But how to do the other way around since a Panel does not "know" the parent form?
Use example: Homer wants to add a user and a new rule for company "Duff Beer". He opens the application and selects "Duff beer" from a dropdown list. He then clicks on a "User" toolstrip icon and the user panel opens in a tab. Homer creates user "Lisa" and then switches over to "Rules" panel and creates a new rule that is owned by Lisa.
Bonus question:
I would also like each panel
to be able to add menu items to the MainForm
Menustrip
. Now that I think about it, the application is a bit like a very very lightweight Visual studio. With tabs and menus and toolbars that change depending on whtat the user is watching.