Macro is the best solution in umbraco to introduce modules(asp.net usercontrols) into the site. To address the communication between the modules, I invented the middle man class, named MessageNotifier. I think it would be better if umbraco supplied the facility. Can anyone tell me if umbraco has one?
With the help of the MessageNotifier, you can send message in following style. MessageNotifier.Instance["unitchanged"].Notify(this, null);
any usercontrol that will subscribe the event will go as following. MessageNotifier.Instance["unitchanged"].Notifier += (s,e)=>{ //implementation code goes here};
decouple consideration in umbraco modules
Please refer to Communication in Umbraco Modules in my blogger or the source code MessageNotifier.cs in Dev3Lib in codeplex.
With the help of the MessageNotifier, you can send message in following style.
MessageNotifier.Instance["unitchanged"].Notify(this, null);
any usercontrol that will subscribe the event will go as following.
MessageNotifier.Instance["unitchanged"].Notifier += (s,e)=>{ //implementation code goes here};
My credits goes here.
is working on a reply...