【问题标题】:remove animation effect after drop GridViewItem in GridView in Windows store apps在 Windows 商店应用程序的 GridView 中删除 GridViewItem 后删除动画效果
【发布时间】:2016-02-19 14:38:30
【问题描述】:

我想去掉gridview中的gridviewitem后的动画效果。 我已将 ItemContainerStyle 编辑如下,但不知道必须更改哪些 VisualStates

  <GridView SelectionMode="None" Margin="10" AllowNewGroup="True" ScrollViewer.HorizontalScrollBarVisibility="Visible" 
    ScrollViewer.HorizontalScrollMode="Enabled" BeforeDrop="MyGridView_BeforeDrop" 
    Drop="MyGridView_Drop" AllowDrop="True" CanReorderItems="True" 
    CanDragItems="True" IsSwipeEnabled="True" ItemsSource="{Binding}" 
    ItemTemplate="{StaticResource ItemTemplate}" > 

            <GridView.ItemContainerStyle> 
            <Style TargetType="GridViewItem"> 
            <Setter Property="HorizontalContentAlignment" Value="Stretch"/> 
            <Setter Property="VerticalContentAlignment" Value="Stretch"/> 
            <Setter Property="Template"> 
            <Setter.Value> 
            <ControlTemplate TargetType="GridViewItem">
             ... 
            </ControlTemplate> 
            </Setter.Value> 
            </Setter> 
            </Style> 
            </GridView.ItemContainerStyle>    
    </GridView>


【问题讨论】:

    标签: xaml windows-store-apps


    【解决方案1】:

    所以,如果我们去查看Style template 并清除您应该遇到的所有噪音;

    <VisualState x:Name="DraggingTarget">
       <Storyboard>
          <DropTargetItemThemeAnimation TargetName="ContentBorder" />
       </Storyboard>
    </VisualState>
    

    这应该是你的罪魁祸首,你可以删除或评论或任何你想做的事情。 DropTargetItemThemeAnimation 由文档更好地解释。希望对您有所帮助,周末愉快!

    【讨论】:

    • 感谢您的宝贵回答,但它不起作用.. 领先一步我还尝试编辑其父网格视图的 TransitionCollection 并评论了 EntranceThemeTransition但效果仍然出现
    • 嗯,我不明白,应该是这样。也许分享您的样式模板版本,以便我们仔细查看?
    猜你喜欢
    • 2017-07-28
    • 2013-12-14
    • 1970-01-01
    • 1970-01-01
    • 2017-09-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多