Windows 8 - 自定义ListView滑动偏移?

时间:2013-12-03 22:11:02

标签: xaml listview swipe windows-8.1 listviewitem

我是Windows 8的新手,所以请耐心等待。我正在为xaml设计一个用于Windows 8.1 Store应用程序的ListView。我想自定义ListViewItem可以水平滑动以选择它的偏移距离。我查看了generic.xaml文件中的ListViewItem和ListView样式,并在我的App.xaml文件中对它们进行了编辑...但是我找不到任何能够正确更改的设置。

在具有KeyViewItemExpanded键的ListViewItem样式中,我尝试更改ToHorizo​​ntalOffset属性:

<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>

我也尝试更改ListViewItemReorderHintThemeOffset:

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

在RightReorderHint和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>

这些都没有产生任何明显的差异,我不确定下一步该尝试什么。建议?

0 个答案:

没有答案