Getting started with bindings – part III
Notice that I’ve also set the id property. That means that we can use the $find helper if we need to get a reference to this binding object later (notice that there’s another option here: you could use a global variable and save the return result of the $create method – don’t forget that the $create always returns a reference to the component it creates).
I do recommend this approach for creating bindings (or any sort of MS AJAX components for that matter). Besides reducing the code, it will always ensure that you initialize the component (something that most people end up forgetting after initializing the properties of the object).
And that’s it. We’ll go back to interesting stuff in the next post. Stay tuned for more on MS AJAX.