locked
How to disable GridViewItem animation when right-clicking? RRS feed

  • Question

  • How do I disable right click animation/visualisation on a GridViewItem?


    This is my code:

    <Page
        x:Name="pageRoot"
        x:Class="HelloWorld.VideoPage"
        DataContext="{Binding DefaultViewModel, RelativeSource={RelativeSource Self}}"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="using:HelloWorld"
        xmlns:common="using:HelloWorld.Common"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        mc:Ignorable="d" Loaded="pageRoot_Loaded">
    
        <Page.Resources>
            <local:SetPercentageConverter x:Key="SetPercentageConverter"/>
            <!-- TODO: Delete this line if the key AppName is declared in App.xaml -->
            <x:String x:Key="AppName">Hello, video!</x:String>
            <Style x:Key="GridViewItemStyle" TargetType="GridViewItem">
            	<Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}"/>
            	<Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}"/>
            	<Setter Property="Background" Value="Transparent"/>
            	<Setter Property="TabNavigation" Value="Local"/>
            	<Setter Property="IsHoldingEnabled" Value="True"/>
            	<Setter Property="Margin" Value="0"/>
            	<Setter Property="Template">
            		<Setter.Value>
            			<ControlTemplate TargetType="GridViewItem">
            				<GridViewItemPresenter x:Name="gridViewItemPresenter" CheckHintBrush="{ThemeResource ListViewItemCheckHintThemeBrush}" CheckBrush="{ThemeResource ListViewItemCheckThemeBrush}" ContentTransitions="{TemplateBinding ContentTransitions}" CheckSelectingBrush="{ThemeResource ListViewItemCheckSelectingThemeBrush}" DragForeground="{ThemeResource ListViewItemDragForegroundThemeBrush}" DragOpacity="{ThemeResource ListViewItemDragThemeOpacity}" DragBackground="{ThemeResource ListViewItemDragBackgroundThemeBrush}" DisabledOpacity="{ThemeResource ListViewItemDisabledThemeOpacity}" FocusBorderBrush="{ThemeResource ListViewItemFocusBorderThemeBrush}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" Padding="{TemplateBinding Padding}" PointerOverBackgroundMargin="1" PlaceholderBackground="{ThemeResource ListViewItemPlaceholderBackgroundThemeBrush}" PointerOverBackground="{ThemeResource ListViewItemPointerOverBackgroundThemeBrush}" ReorderHintOffset="{ThemeResource ListViewItemReorderHintThemeOffset}" SelectedPointerOverBorderBrush="{ThemeResource ListViewItemSelectedPointerOverBorderThemeBrush}" SelectionCheckMarkVisualEnabled="True" SelectedForeground="{ThemeResource ListViewItemSelectedForegroundThemeBrush}" SelectedPointerOverBackground="{ThemeResource ListViewItemSelectedPointerOverBackgroundThemeBrush}" SelectedBorderThickness="{ThemeResource GridViewItemCompactSelectedBorderThemeThickness}" SelectedBackground="{ThemeResource ListViewItemSelectedBackgroundThemeBrush}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}">
            					<VisualStateManager.VisualStateGroups>
            						<VisualStateGroup x:Name="CommonStates">
            							<VisualState x:Name="Normal"/>
            							<VisualState x:Name="PointerOver"/>
            							<VisualState x:Name="Pressed"/>
            							<VisualState x:Name="PointerOverPressed"/>
            							<VisualState x:Name="Disabled"/>
            						</VisualStateGroup>
            					</VisualStateManager.VisualStateGroups>
            				</GridViewItemPresenter>
            			</ControlTemplate>
            		</Setter.Value>
            	</Setter>
            </Style>
            
        </Page.Resources>
        <Page.TopAppBar>
            <CommandBar x:Name="commandBar">
                <AppBarButton x:Name="SyncMovieLibraryButton" Icon="SyncFolder" Label="Sync Movie Library" Click="SyncMovieLibraryButton_Click"/>
                <AppBarButton x:Name="SetMovieLibraryButton" Icon="Folder" Label="Set Movie Library" Click="SetMovieLibraryButton_Click"/>
            </CommandBar>
        </Page.TopAppBar>
    
        <GridView x:Name="videoGridView" ItemsSource="{Binding Movies}" ItemContainerStyle="{StaticResource GridViewItemStyle}" Padding="0">
            <GridView.ItemTemplate>
                <DataTemplate>
                    <Image Source="{Binding PosterPath}" Loaded="Image_Loaded" RightTapped="Image_RightTapped" />
                </DataTemplate>
            </GridView.ItemTemplate>
        </GridView>
    </Page>



    • Edited by ϻοϰsϯεr Saturday, November 15, 2014 3:56 PM
    Saturday, November 15, 2014 1:56 PM

Answers

All replies