我在GridView
SemanticZoom
内使用WinRT xaml
来显示图片集。
我使用的代码如下
<SemanticZoom>
<SemanticZoom.ZoomedInView>
<GridView>
<ScrollViewer Name="canvas" Height="500" Background="Red" Margin="288,135,222,133">
<ItemsControl>
<Image Name="img1" Height="577" Canvas.Left="145" Canvas.Top="65" Width="608" Source="Assets/issue mentioned.png" Visibility="Visible"/>
<Image Name="img2" Height="577" Canvas.Left="154" Canvas.Top="650" Width="608" Source="Assets/issue mentioned.png" Visibility="Visible"/>
</ItemsControl>
</ScrollViewer>
</GridView>
</SemanticZoom.ZoomedInView>
</SemanticZoom>
运行应用程序时,images
正确显示。当我触摸图像时,它会被轻拍。
如何摆脱这个?我不需要那个被挖掘。
答案 0 :(得分:0)
我们可以通过从ItemContainerStyle中删除按下的状态动画,从网格视图中删除点击视觉效果,如下所示。
<Style x:Key="GridViewItemsStyle" TargetType="GridViewItem">
<Setter Property="HorizontalAlignment" Value="right"/>
<Setter Property="IsTabStop" Value="False"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="GridViewItem">
<Border x:Name="OuterContainer">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal"/>
<VisualState x:Name="PointerOver"/>
<VisualState x:Name="Pressed"/>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Grid x:Name="ReorderHintContent" Background="Transparent">
<Border x:Name="ContentContainer">
<Grid>
<Border x:Name="ContentBorder" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
<ContentPresenter x:Name="contentPresenter" ContentTransitions="{TemplateBinding ContentTransitions}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="{TemplateBinding Padding}" />
</Border>
</Grid>
</Border>
</Grid>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<GridView ItemContainerStyle="{StaticResource GridViewItemsStyle}"
SelectionMode="None">
<ScrollViewer Name="canvas"
Height="500"
Background="Red"
Margin="288,135,222,133">
<ItemsControl>
<Image Name="img1"
Height="577"
Width="608"
Source="Assets/ShowPlaceholder.png"
Visibility="Visible" />
<Image Name="img2"
Height="577"
Width="608"
Source="Assets/ShowPlaceholder.png"
Visibility="Visible" />
</ItemsControl>
</ScrollViewer>
</GridView>
我希望这会对你有所帮助。
Santyy