On 2/12/17, 11:38 PM, "Justin Mclean" <jus...@classsoftware.com> wrote:

>Hi,
>
>> Raise a jira for Bindable - I will try to look into that.
>
>Here you go https://issues.apache.org/jira/browse/FLEX-35265
>
>> What's the difference between BindableCSSStyles to ContainerDataBinding
>>?
>
>Code is very different looks like BindableCSSStyles just specifies the
>list of styles to watch for, where as ContainerDataBinding does all of
>the actually binding work.
>       

The XXXDataBinding classes handle the {} data binding statements in MXML.
They set up watchers and binding instances that react to change events,
which are the key piece in data binding.

A string like styles="fontWeight:bold" is difficult to watch for changes.
Plus it is not structured data: the compiler will not catch me when I
mistype style="fontWieght:bold".  So, and hopefully FlexJSStore
illustrates this, there is a SimpleCSSStyles class that is structured so
in MXML you use it like:

<js:Button>
   <js:style>
      <js:SimpleCSSStyles fontWeight="bold" />
   </js:style>
</js:Button>


More verbose, but now the compiler won't let you mis-type fontWeight.
SimpleCSSStyles only contains the most common styles I could think of.
Folks can create their own versions for their own purposes.  However,
these classes are, because of PAYG, simple bags of properties and do not
dispatch change events.  BindableCSSStyles dispatches change events.

HTH,
-Alex

Reply via email to