0

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

Jigar Sheth
  • 586
  • 2
  • 5
  • 21

1 Answers1

1

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.

Community
  • 1
  • 1
Silver Solver
  • 2,310
  • 1
  • 13
  • 19
  • Thanks for the suggestion. Problem is I need to have common style for button because this style needs to be reused in multiple pages/views for many buttons across the application. – Jigar Sheth Feb 18 '13 at 07:39