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