Windows 8 - Customizing ListView swipe offset?

自古美人都是妖i 提交于 2020-01-03 03:20:09

问题


I am very new to Windows 8 so please bear with me. I am styling a ListView in xaml for a Windows 8.1 Store app. I would like to customize the offset distance that a ListViewItem can be swiped horizontally to select it. I have looked through the ListViewItem and ListView styles in the generic.xaml file and edited them in my App.xaml file... but I haven't been able to find any settings that made the correct change.

In the ListViewItem style with the key ListViewItemExpanded, I tried changing the ToHorizontalOffset properties:

<VisualState x:Name="HorizontalSelectionHint">
    <Storyboard>
        <SwipeHintThemeAnimation TargetName="SelectionBackground" ToHorizontalOffset="-23" ToVerticalOffset="0" />
        <SwipeHintThemeAnimation TargetName="ContentBorder" ToHorizontalOffset="-23" ToVerticalOffset="0" />a
        <SwipeHintThemeAnimation TargetName="SelectedBorder" ToHorizontalOffset="-23" ToVerticalOffset="0" />
        <SwipeHintThemeAnimation TargetName="SelectedCheckMark" ToHorizontalOffset="-23" ToVerticalOffset="0" />
        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="HintGlyph"
                                Storyboard.TargetProperty="Opacity"
                                Duration="0:0:0.500">
            <DiscreteDoubleKeyFrame Value="0.5" KeyTime="0:0:0" />
            <DiscreteDoubleKeyFrame Value="0" KeyTime="0:0:0.500" />
        </DoubleAnimationUsingKeyFrames>
    </Storyboard>
</VisualState>

I also tried changing the ListViewItemReorderHintThemeOffset:

<x:Double x:Key="ListViewItemReorderHintThemeOffset">40.0</x:Double>

which is used in the RightReorderHint and LeftReorderHint:

<VisualState x:Name="RightReorderHint">
    <Storyboard>
        <DragOverThemeAnimation TargetName="ReorderHintContent" ToOffset="{ThemeResource ListViewItemReorderHintThemeOffset}" Direction="Right" />
    </Storyboard>
</VisualState>
<VisualState x:Name="LeftReorderHint">
    <Storyboard>
        <DragOverThemeAnimation TargetName="ReorderHintContent" ToOffset="{ThemeResource ListViewItemReorderHintThemeOffset}" Direction="Left" />
    </Storyboard>
</VisualState>

None of these even made any visible difference and I'm not sure what to try next. Suggestions?

来源:https://stackoverflow.com/questions/20362749/windows-8-customizing-listview-swipe-offset

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!