Triggers for individual objects |
Post Reply |
Author | |
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1355 |
Post Options
Thanks(0)
Posted: 06 January 2010 at 10:26am |
I've looked over the documentation & triggers.xaml sample, and I understand how to apply a trigger to all objects of a class (for example, all rectangles can become green on mouseover). What I would like to do is set a trigger for a particular object only, for example:
I have a StackPanel with 3 images. I would like to be able to change the Source property for only one of those images on mouse over (and restore the previous Source on mouse leave). I imagine I have to do something with the Key property, but nothing I have tried so far works. Does anyone know how to do this? Thanks a lot in advance. |
|
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
|
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1355 |
Post Options
Thanks(0)
|
Sometimes just asking the question inspires the answer - I was thinking of it backwards (that the x:Key property of the style would be the same as a key property of the object). Instead we can assign the {StaticResource KEY} to the Style property of the object. Something like:
Only the first image will be affected by the triggers. Another important thing to note is that you shouldn't define any properties that you want to affect by triggers in the object, otherwise the trigger won't work. |
|
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |