How UWP's GridView auto performace
The data source: IEnumerable.
In PC, when the window's width is 1000,the column is 10;
when the window's width is 500,the column will be 5;
MAUI's CollectionView
CollectionView uses the ItemsLayout property to set the span value, so that the control can display the column to display. But when I change the width of the window in PC, the items wouldn't move.
It seems to be designed for only using in mobile devices. The Windows won't change size.
Then I tried to set the span value in code:
private void Button_Clicked (object sender , EventArgs e)
{
var layout = collectionView.ItemsLayout as GridItemsLayout;
layout.Span += 2;
}
I use the code above to change the volumn value, however, It doesn't work.
So, how can CollectionView change the span value?
One of the possible ways is to use the Trigger(I guess, I'm new to MAUI). Then call the control method like "UpdateVisual()" (I guess).