大佬教程收集整理的这篇文章主要介绍了xaml – 如何在Win10 Universal应用程序中禁用GridView / ListView上的倾斜动画?,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
但是,当我在Win10 Universal应用程序上编辑模板时,我没有看到任何故事板.我在哪里可以取消动画?
这是为我生成的样式(使用时,不会禁用动画):
<Style x:Key="ListViewItemStyle1" TargetType="ListViewItem"> <Setter Property="FontFamily" Value="{Themeresource ContentControlThemeFontFamily}"/> <Setter Property="FontSize" Value="{Themeresource ControlContentThemeFontSizE}"/> <Setter Property="BACkground" Value="Transparent"/> <Setter Property="Foreground" Value="{Themeresource SystemControlForegroundBaseHighBrush}"/> <Setter Property="TabNavigation" Value="Local"/> <Setter Property="IsHoldingEnabled" Value="True"/> <Setter Property="Padding" Value="12,12,0"/> <Setter Property="HorizontalContentAlignment" Value="Left"/> <Setter Property="VerticalContentAlignment" Value="Center"/> <Setter Property="MinWidth" Value="{Themeresource ListViewItemMinWidth}"/> <Setter Property="MinHeight" Value="{Themeresource ListViewItemMinHeight}"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="ListViewItem"> <ListViewItemPresenter checkBrush="{Themeresource SystemControlForegroundBaseMediumHighBrush}" ContentMargin="{TemplateBinding Padding}" checkmode="Inline" ContentTransitions="{TemplateBinding ContentTransitions}" checkBoxBrush="{Themeresource SystemControlForegroundBaseMediumHighBrush}" DragForeground="{Themeresource ListViewItemDragForegroundThemeBrush}" DragOpacity="{Themeresource ListViewItemDragThemeOpacity}" DragBACkground="{Themeresource ListViewItemDragBACkgroundThemeBrush}" Disabledopacity="{Themeresource ListViewItemDisabledThemeOpacity}" FocusBorderBrush="{Themeresource SystemControlForegroundAltHighBrush}" FocusSecondaryBorderBrush="{Themeresource SystemControlForegroundBaseHighBrush}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" PointerOverForeground="{Themeresource SystemControlHighlightAltBaseHighBrush}" PressedBACkground="{Themeresource SystemControlHighlightListMediumBrush}" PlaceholderBACkground="{Themeresource ListViewItemPlaceholderBACkgroundThemeBrush}" PointerOverBACkground="{Themeresource SystemControlHighlightListLowBrush}" ReorderHintOffset="{Themeresource ListViewItemReorderHintThemeOffset}" SELEctedPressedBACkground="{Themeresource SystemControlHighlightListAccentHighBrush}" SELEctioncheckmarkVisualEnabled="True" SELEctedForeground="{Themeresource SystemControlHighlightAltBaseHighBrush}" SELEctedPointerOverBACkground="{Themeresource SystemControlHighlightListAccentMediumBrush}" SELEctedBACkground="{Themeresource SystemControlHighlightListAccentLowBrush}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/> </ControlTemplate> </Setter.Value> </Setter> </Style>
例如,使用具有以下几乎为空的样式的Button将内容包装在ItemTemplate中.
<Style x:Key="EmptyButtonStyle" TargetType="Button"> <Setter Property="BACkground" Value="Transparent" /> <Setter Property="HorizontalAlignment" Value="Stretch" /> <Setter Property="VerticalAlignment" Value="Stretch" /> <Setter Property="HorizontalContentAlignment" Value="Stretch" /> <Setter Property="VerticalContentAlignment" Value="Stretch" /> <Setter Property="UseSystemFocusVisuals" Value="false" /> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="Button"> <Grid x:Name="RootGrid" BACkground="{TemplateBinding BACkgrounD}"> <ContentPresenter x:Name="ContentPresenter" ContentTemplate="{TemplateBinding ContentTemplatE}" Content="{TemplateBinding Content}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" /> </Grid> </ControlTemplate> </Setter.Value> </Setter> </Style> <DataTemplate x:Name="ListViewItemTemplate"> <Button Style="{Staticresource EmptyButtonStylE}"> <!-- Put your original stuff here --> </Button> </DataTemplate>
以上是大佬教程为你收集整理的xaml – 如何在Win10 Universal应用程序中禁用GridView / ListView上的倾斜动画?全部内容,希望文章能够帮你解决xaml – 如何在Win10 Universal应用程序中禁用GridView / ListView上的倾斜动画?所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。