Andreas has posted another great WHS development tip for allowing your SettingsTab and ConsoleTab to notify each other of changes.

The easiest way to accomplish this is by using a singleton object which provides the necessary means of communication.

We can access a common instance (the singleton) from everywhere in our code by calling on ChangeNotifier.Instance. First we need to subscribe to the ChangeNotifier’s Changed event in our console tab and second we have to call the Notify() method (which will fire the Changed event) from our settings tab when setting changes are committed.

I’ve seen this come up quite a few times on various forums, and I’ve always recommended using some variation of the WHS Notification infrastructure (it’s what I use in Disk Management). I like Andreas’ idea much better; it’s a lot cleaner and less prone to errors than what I’ve been using.

Great stuff, Andreas.

posted on Friday, April 09, 2010 9:21 PM | Filed Under [ Windows Home Server Development ]

Search

Site Sections

Recent Posts

Archives

Post Categories

WHS Add-In Tutorial

WHS Blogs

WHS Development