Marking a single property bindable causes the compiler(maybe actually
should be said precompiler) to generate a getter and setter for the
property. Within the setter a propertyChanged event is broadcast
whenever the property is set. Also, any place that this property is
accessed via MXML with the {} syntax will now add a listener to that
class for the property changed. I believe the class then also becomes
an IEventDispatcher (and maybe a IPropertyChangeNotifier but I
honestly don't remember for sure)

Marking the entire class bindable does this for every property in the
class. The [Bindable] versus [Bindable(event='')] syntax allows you to
change the default use of the propertyChanged to a new event name. 

This means you can have different events broadcast by each setter as
opposed to a property changed event always being broadcast and then
later interrogated to see if it is the right event. Personally, I like
this for debugging, but there is a little cost overhead here too.

If you want to know more about this, make a simple value object, mark
the whole class bindable and compile it with the keep-genenerated-as
flag on. Is is a great way to see what is happening.

Personal opinion, mark what you need and only what you need,
Mike



--- In [email protected], "reflexactions"
<[EMAIL PROTECTED]> wrote:
>
> I've read the docs but they left me wanting to know more!
> 
> According to the docs I can add [Bindable] at the top of a class to 
> make everything bindable.
> Fine but is there a downside to that or do I just blindly make whole 
> classes bindable "just in case" or do I selectively make bindable only 
> those properties that I know will need it?
> 
> Does making a class or property bindable result in it being wrapped in 
> a proxy?
> 
> If I make a property bindable does it make a difference if I use 
> [Bindable] or [Bindable(event...)] with respect to sub-properties.
> 
> tks
>


Reply via email to