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

TileView with altered header template on mouse over

2 Answers 67 Views
TileView
This is a migrated thread and some comments may be shown as answers.
Huy
Top achievements
Rank 1
Huy asked on 25 Jul 2014, 09:13 PM
Hi,

I'm looking for a way to change the header style (background + foreground colors) of a tileviewitem as mouse is moved over

So far none of the result on Google is helpful

Thanks

2 Answers, 1 is accepted

Sort by
0
Accepted
Martin Ivanov
Telerik team
answered on 30 Jul 2014, 11:13 AM
Hello Huy,

Our controls, including the RadTileViewItem elements, are using VisualStates to modify their appearances when the user interacts with them. Those visual states are located in the ControlTemplate of the control. For example there is a visual states for mouse enter, mouse leave, mouse over, pressed, disabled, etc. Each state animates an element in the control's visual tree.

In order to modify the background and the foreground color of the RadTileViewItem's header when you mouse over it, you can change the visual states in the ControlTemplate of the TileViewItemHeader control that holds the item's header. 

Another approach that can be more suitable for the tile view items is to use Trigger. Here is an example how you can set the Background and Foreground of the TileViewItemHeader when the mouse is over:

<Window.Resources>
    <Style TargetType="tileView:TileViewItemHeader">
        <Style.Triggers>
            <Trigger Property="tileView:TileViewItemHeader.IsMouseOver" Value="True">
                <Setter Property="tileView:TileViewItemHeader.Background" Value="Black" />
                <Setter Property="tileView:TileViewItemHeader.Foreground" Value="White" />
            </Trigger>
        </Style.Triggers>
    </Style>
</Window.Resources>

Please give this approach a try and let me know if it helps.

Regards,
Martin
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
Huy
Top achievements
Rank 1
answered on 31 Jul 2014, 08:30 PM
Hey Martin,

That's exactly what I want, thanks :)
Tags
TileView
Asked by
Huy
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Huy
Top achievements
Rank 1
Share this question
or