views:

138

answers:

2

I couldn't understand the purpose of this event from official documantation.

It's commonly used developing controls with clint support (IScriptControl).

 get_highlightCssClass: function() {
        return this._highlightCssClass;
    },

    set_highlightCssClass: function(value) {
        if (this._highlightCssClass !== value) {
            this._highlightCssClass = value;
            this.raisePropertyChanged('highlightCssClass');
        }
    },

Is it used to update the server's-side property from the clint side?
How do I catch this event on server side and get the updated property value?

+1  A: 

This article by Garbin explains the use of this (and more).

[Edit to show sample usage] Suppose you have this in an instance of classA inside ClassB, then you add the following to ClassB:

classA.add_propertyChanged(onPropChanged);

function onPropChanged(sender, e) {
  if (e.get_propertyName == 'highlightCssClass') {
    // Do something with this....
  }
}

[/End Edit]

Pete OHanlon
it just explains how to raise this event but not how to subscribe to it on the server's side.
samuel
A: 

This event helps you to create observable objects, that is, objects whose changes in state that you can track. Useful for example when using LINQ to SQL, in orde to know which entities have been changed and need to be sent back to the database.

Konamiman