IsMouseOver Trigger does not override Background Property

2 posts, 0 answers
  1. Steven
    Steven avatar
    35 posts
    Member since:
    Apr 2011

    Posted 09 Dec 2011 Link to this post

    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
  2. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 12 Dec 2011 Link to this post

    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 >>

  3. UI for WPF is Visual Studio 2017 Ready
Back to Top