How can I change the border of a gridview element when pointer / mouse

this is my gridview

<Grid Grid.Column="1" Margin="80,0,0,0"> <Grid.RowDefinitions> <RowDefinition Height="50" /> <RowDefinition Height="*" /> </Grid.RowDefinitions> <TextBlock Text="aktualnoΕ›ci" Style="{StaticResource PageSubheader}" /> <local:VariableGridView x:Name="listView" Grid.Row="1" Margin="0,2,0,0" IsItemClickEnabled="True" ItemClick="listView_ItemClick" > <local:VariableGridView.ItemTemplate> <DataTemplate> <Grid> <Border> <Image Source="Templates/LightGray.png" Stretch="UniformToFill"/> </Border> <StackPanel VerticalAlignment="Top" > <TextBlock Text="{Binding title}" Height="30" Margin="15,0,15,0"/> <TextBlock Text="{Binding short}" TextWrapping="NoWrap" Margin="15,0,15,10"/> </StackPanel> </Grid> </DataTemplate> </local:VariableGridView.ItemTemplate> <local:VariableGridView.ItemsPanel> <ItemsPanelTemplate> <VariableSizedWrapGrid ItemWidth="150" ItemHeight="150" Orientation="Vertical" Margin="0,0,80,0" MaximumRowsOrColumns="3"/> </ItemsPanelTemplate> </local:VariableGridView.ItemsPanel> </local:VariableGridView> </Grid> 

The local class (VariableGridView) is a small extension for creating a view, for example, in the Windows Store. It is working fine. I can not do anything. How to change the border when the pointer is above the grid? I can not find him.

+4
source share
1 answer

GridView roll-over effects are managed as part of its ItemContainerStyle.

In Visual Studio, right-click the GridView on the left and select "Edit Additional Templates", "Edit Created Item Container" (ItemContainerStyle), "Edit Copy".

In the style that is generated, you will find a VisualStateGroup called "Hover". These are changes that occur in the container when the user hangs over an element. At the bottom of the template, you will find the item container and the standard wrapper for the grid element (box with a check box).

+3
source

All Articles