Hello,
You could remove ItemsLayout
property in CollectionView
, it is always 2 columns now. Then you can change MinWindowWidth
from 800
to 320
, and test again, 800
is a little wide for iOS and Android device( you can test on ipad).
<CollectionView ItemsSource="{Binding Pokemons}"
ItemsLayout="VerticalGrid, 2"// remove
RemainingItemsThreshold="4"
...
It works on iOS and Android, the number of columns is 3, the color has been triggered as well.
<VisualState x:Name="Medium">
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowWidth="320"/>
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Property="BackgroundColor" Value="Yellow"></Setter>
<Setter Property="ItemsLayout" Value="VerticalGrid, 3"/>
</VisualState.Setters>
</VisualState>
But it doesn't work on Windows, the number of columns has not changed. There is known issue CollectionView does not update when changing ItemsLayout #7747 and #7242, you could follow the progress.
Best Regards,
Wenyan Zhang
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.