Jigar Sheth
Jigar Sheth

Reputation: 636

Silverlight : Modify Canvas.Zindex of button on mouseover / focused state from style

I want to modify the ZIndex of a button on mouseover / focused state from the style and not from codebehind.

Upvotes: 0

Views: 209

Answers (1)

Silver Solver
Silver Solver

Reputation: 2320

You cant really do this with a style.

The best you can hope for in that regard is to create a Behavior that will change the ZIndex property. But then you have got to create an Attached Property for the Behavior so you can set it in a Style. It will work, but you should consider another approach.

You can define a Visual State in your Page/View. Then using Interaction Triggers, you can trigger that Visual State with a GoToState Action on MouseOver and GotFocus.


Edit: If it is re-usability you seek, derive a type from Button and use your type instead. You can then define any behavior that comes to mind from code in your Button.

Upvotes: 1

Related Questions