【发布时间】:2021-01-15 12:00:36
【问题描述】:
当我在集合视图中添加SelectionChanged 函数时,VisualStateManager 不起作用。
<ContentPage.Resources>
<Style TargetType="StackLayout">
<Setter Property="VisualStateManager.VisualStateGroups">
<VisualStateGroupList>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" />
<VisualState x:Name="Selected">
<VisualState.Setters>
<Setter Property="BackgroundColor" Value="LightSkyBlue"/>
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateGroupList>
</Setter>
</Style>
</ContentPage.Resources>
当我在CollectionView:SelectionChanged="OnCollectionViewSelectionChanged" 中添加此代码时,VisualStateManager 停止工作。有谁知道为什么?
【问题讨论】:
标签: xaml xamarin.forms collectionview visualstatemanager