KNKVC

KNKVC is an implementation of Cocoa's NSKeyValueCoding and NSKeyValueObserving in C# .NET, which is a specific implementation of the Observer pattern.
This set of classes gives Cocoa developers back a key part of their skillset when working in other languages, and everyone else a dead-simple, easy-to-use key-value coding and observing system. Most of the client-facing functionality is implemented using class extensions, meaning you can simply import the KNKVC namespace and start simplifying your code!
KNKVC Requires .NET 3.5.
Key-Value Coding
Key-Value Coding allows you to get and set values from an object without having to strongly type it. KNKVC adds the following (and more) extension methods to the Object (and therefore every) class:
Object valueForKeyPath(String key);
Dictionary<String, Object> dictionaryWithValuesForKeys(String[] keys);
setValueForKey(Object value, String key);
setValuesForKeysWithDictionary(Dictionary<String, Object> keysAndValues);
KNKVC also provides specific functionality for arrays and dictionaries - calling valueForKey on an array will return an array of it’s members’ values for that key, and setValueForKey will set the given value for the given key of each object in the array. Using KNKVC on a dictionary object will attempt to get/set the value for the corresponding key in the dictionary.
Key-Value Observing
Key-Value Observing allows an object to register as an “observer” for any given key of an object. When the object’s value for that key changes in a KVO-compliant way, the observer is notified of that change. Combined with Key-Value Coding, this allows your controllers to interact with your model without coupling the two at all.
At the moment, a property isn’t automatically KVO-compliant. To become KVO-compliant, you must call this.willChangeValueForKey(“key”); just prior to changing your value, then this.didChangeValueForKey(“key”); after. I’m working on making this completely automatic, but it might have to wait for the more dynamic features of .NET 4.0.
Downloading and Documentation
You can download the KNKVC library, Visual Studio 2008 project and documentation here. The documentation is available online here.
If you’re interested on how this was implemented, I posted an essay on the challenges and implementation on my personal blog. The post can be found here.