fix: selectionmode and ItemClick

This commit is contained in:
Steve Bilogan 2021-11-20 11:18:12 -05:00
Родитель 49be374f60
Коммит 22384843dc
2 изменённых файлов: 23 добавлений и 7 удалений

Просмотреть файл

@ -36,6 +36,7 @@
<!-- To override the default FlyoutLightDismissOverlayBackground resource -->
<SolidColorBrush x:Key="FlyoutLightDismissOverlayBackground"
Color="{StaticResource MaterialOverlayColor}" />
<x:Double x:Key="WideMinWindowWidthh">800</x:Double>
</ResourceDictionary>
</Application.Resources>

Просмотреть файл

@ -31,7 +31,7 @@
<VisualState x:Name="Wide">
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowWidth="800" />
<AdaptiveTrigger MinWindowWidth="{StaticResource WideMinWindowWidthh}" />
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Target="ProductsColumn.Width"
@ -114,23 +114,38 @@
<Grid>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup>
<VisualState x:Name="Narrow" />
<VisualState x:Name="Wide">
<VisualState x:Name="Narrow">
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowWidth="0"
MinWindowHeight="0" />
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Target="ProductsListView.SelectionMode"
Value="None" />
<Setter Target="ProductsListView.IsItemClickEnabled"
Value="True" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Wide">
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowWidth="800" />
<AdaptiveTrigger MinWindowWidth="{StaticResource WideMinWindowWidthh}" />
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Target="ProductsListView.SelectionMode"
Value="Single" />
<Setter Target="ProductsListView.IsItemClickEnabled"
Value="False" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<ListView Background="{StaticResource MaterialSurfaceBrush}"
x:Name="ProductsListView"
ItemsSource="{Binding Data}"
uen:Navigation.Request="ProductDetails">
x:Name="ProductsListView"
ItemsSource="{Binding Data}"
SelectionMode="None"
IsItemClickEnabled="True"
uen:Navigation.Request="ProductDetails">
<ListView.ItemsPanel>
<ItemsPanelTemplate>
<ItemsStackPanel Orientation="Vertical" />