我怎样才能让淡蓝色鼠标悬停对我的影响ListView
?
当我触摸屏幕时,会出现一个淡蓝色选择器,并在我上下滚动时停留在屏幕中间(但以深蓝色突出显示的所选项目不会改变)。我猜这是鼠标悬停效果,因为当我使用鼠标时会出现同样的效果。
如何解决?
我将 DataTemplate 用于项目集合。
代码
<ListView Grid.Row="1"
Margin="10"
HorizontalContentAlignment="Stretch"
ItemsSource="{Binding Source={StaticResource MyData}}"
ItemTemplate="{StaticResource MyItemTemplate}"
ScrollViewer.CanContentScroll="False"
ScrollViewer.PanningMode="VerticalOnly"
ScrollViewer.PanningRatio="0.5">
</ListView>
这是我的项目模板:
<DataTemplate x:Key="MyItemTemplate">
<Grid Margin="10,5">
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<Border BorderBrush="Gray"
BorderThickness="1"
Grid.RowSpan="2"
CornerRadius="5" />
<TextBlock Text="{Binding Name}"
FontSize="20"
VerticalAlignment="Center"
Grid.Row="0"
Margin="10" />
<Border Background="#FFB9B9B9"
Grid.Row="1"
CornerRadius="5"
Margin="10,0,10,4">
<StackPanel HorizontalAlignment="Stretch"
Orientation="Horizontal"
Grid.Row="1">
<TextBlock VerticalAlignment="Center"
Text="Status: "
Margin="5,5,0,5" />
<TextBlock VerticalAlignment="Center"
Text="{Binding CompletionStatus}" />
<TextBlock VerticalAlignment="Center"
Text="% complete, " />
<TextBlock VerticalAlignment="Center"
Text="Upload status: " />
<TextBlock VerticalAlignment="Center"
Text="{Binding UploadStatus}" />
<TextBlock VerticalAlignment="Center"
Text="last Modified: " />
<TextBlock VerticalAlignment="Center"
Text="{Binding LastModified}" />
</StackPanel>
</Border>
</Grid>
</DataTemplate>