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 ]

Comments

Gravatar
# re: Andreas M. and communication between SettingsTab and ConsoleTab (madlan @ 5/5/2010 10:21 AM)

This is great, I'm currently using the notification system to pass info between the two as you advised - will take a look at this method.

Thanks.

Post Comment

Title *
Name *
Email
Url
Comment *  
Remember me
Please add 8 and 3 and type the answer here:

Search

Site Sections

Recent Posts

Archives

Post Categories

WHS Add-In Tutorial

WHS Blogs

WHS Development