> With all the thoughts going on around styling (people have implemented
> CSS-like styling and WPF-like styling/triggers), what is the pivot core
> team's thoughts on 2.0 and what the objectives are?
My primary objectives for improving styling support in Pivot 2.0 included
making it easier to apply externally defined styles and possibly supporting
dynamic, automatic updates to those styles. Both of these objectives have now
been met. In addition to the previous means for applying styles:
Programmatically:
myComponent.getStyles().put("color", "#ffffff");
Declaratively via attribute value:
<Label styles="{color:'#ffffff'}"/>
Declaratively via external file:
<Label styles="@label_styles.json"/>
Declaratively via XML element:
<Label>
<styles color="#ffffff"/>
</Label>
Pivot 2.0 now includes support for defining styles using an external JSON-based
stylesheet:
<bxml:include bxml:id="myStyles" src="my_styles.json"/>
<Label styles="$myStyles.labelStyles"/>
It would also be possible define external styles using CSS syntax, if someone
is interested in writing a parser for it:
<bxml:include bxml:id="myStyles" src="my_styles.css"/>
As I mentioned earlier, this would basically amount to reading the CSS data
into the same data structure that is output by the JSON serializer.
Additionally, using namespace binding, dynamic style changes can now be
automatically applied:
<Label>
<styles color="${myStyles.labelStyles.color}"/>
</Label>
Whenever the "myStyles.labelStyles.color" value changes, the label's color will
automatically change to reflect the new value (as will any other styles or
properties bound to that value). This is demonstrated by the following example
(selecting a value from the color picker automatically updates the associated
label's text as well as its "color" style):
http://ixnay.biz/pivot-demos/namespace-binding.html
The work Michael has been doing is interesting, though I still think there is
an "impedance mismatch" between the actual CSS specification and how styles
work in Pivot. I would personally rather see some effort focused on writing a
CSS serializer that works within the existing styling framework, as described
above.
> We've seen that we can implement advanced styling approaches (and more)
> without changing core pivot at all, but what does this add up to? It seems
> that alot of this work is really about easier theming and L&F customization.
Yup, that is exactly what it is about. It simply aims to make it a bit easier
for designers to apply their own L&F customizations to a Pivot app.