Posts
17
Comments
2589
Trackbacks
27
Wednesday, February 15, 2006
EID: Applying style using triggers

“In XAML you can define a style and have it applied based on an Event,Property or DataBinding property change.
To give you an idea, here's a XAML fragment that sets some properties of a button when mouse is over it.

<Style TargetType="{x:Type Button}">
  <Style.Triggers>
    <Trigger Property="IsMouseOver" Value="True">
    <Setter Property="FontSize" Value="20" />
    <Setter Property="Foreground" Value="Red" />
  </Trigger>
 </Style.Triggers>
</Style>

To have the same result using EID (a.k.a “Sparkle”) you have to follow some steps.
Let's try, as demo, to have the background of a button changing when IsMouseOver property is true.

  • Start by drawing a button on scene's document root.
  • Right click and select to Edit a copy of the style (BTW: You can see the structure of original style on EID timeline)
  • Click on Timeline's Create new state button, you should now have a new [No Triggers] tab
  • On Timeline Properties Palette, press Add button and type IsMouseOver on left textbox and true on right one.
  • Now change the backcolor of the button, when finished press Return to scope root button.
  • Test the scene

You'll see backcolor change on MouseOver.
Editing is far than complete, I'm still not able to edit some properties (e.g. Opacity) and looks like that Event/DataBiding triggers are still work in progress, but you should have an idea of how thing should work.”

posted @ Wednesday, February 15, 2006 10:50 PM | Feedback (102)
News

This is my personal blog.
These postings are provided "AS IS" with no warranties, and confer no rights.

Disciple