This is a migrated thread and some comments may be shown as answers.

IsMouseOver Trigger does not override Background Property

1 Answer 815 Views
Buttons
This is a migrated thread and some comments may be shown as answers.
Steven
Top achievements
Rank 1
Steven asked on 09 Dec 2011, 03:05 PM
Hi,

Why my Trigger on the property IsMouseOver does not display a Red Background ?

<Style TargetType="telerik:RadButton">
  <Style.Triggers>
           <Trigger Property="IsMouseOver" Value="true">
               <Setter Property="Background" Value="Red"/>
           </Trigger>
       </Style.Triggers>
   </Style>

Should I override it ?
I am using the metro theme.

Regards,
S

1 Answer, 1 is accepted

Sort by
0
Tina Stancheva
Telerik team
answered on 12 Dec 2011, 01:30 PM
Hello Steven,

The default ControlTemplate of the RadButton control defines a trigger that sets the background of the control while the mouse is over it. And since the ControlTemplate trigger is applied after the Style trigger you defined, the Red color isn't applied.

This is why if you need to change the default MouseOver background, you'll have to edit the ControlTemplate of the RadButton - you can find the ControlTemplate structure of the control here and you can follow this approach to change it.

All the best,
Tina Stancheva
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
Buttons
Asked by
Steven
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
Share this question
or