Open suugbut opened 1 month ago
The following works.
<CollectionView.ItemTemplate> <OnPlatform x:TypeArguments="DataTemplate"> <On Platform="Android"> <DataTemplate> <Label Text="{Binding .}" /> </DataTemplate> </On> <On Platform="WinUI"> <DataTemplate> <Label Text="{Binding .}" BackgroundColor="Red" /> </DataTemplate> </On> </OnPlatform> </CollectionView.ItemTemplate>
However the following does NOT work on both Windows and Android.
<CollectionView.Header> <OnPlatform x:TypeArguments="View"> <On Platform="Android"> <Label Text="Android" /> </On> <On Platform="WinUI"> <Label Text="WinUI" /> </On> </OnPlatform> </CollectionView.Header>
MainPage
MainPage.cs
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="Bug.MainPage"> <CollectionView> <CollectionView.ItemsSource> <x:Array Type="{x:Type x:String}"> <x:String>A</x:String> <x:String>B</x:String> </x:Array> </CollectionView.ItemsSource> <CollectionView.Header> <OnPlatform x:TypeArguments="View"> <On Platform="Android"> <Label Text="Android" /> </On> <On Platform="WinUI"> <Label Text="WinUI" /> </On> </OnPlatform> </CollectionView.Header> </CollectionView> </ContentPage>
No response
9.0.0-rc.1.24453.9
Not sure, did not test other versions
Unknown/Other
Android, Windows, I was not able test on other platforms
No.
This issue has been verified using Visual Studio 17.12.0 Preview 2.1(9.0.0-rc.1.24453.9 & 8.0.91 & 8.0.82). Can repro this issue on windows and android platforms.
Description
The following works.
However the following does NOT work on both Windows and Android.
Steps to Reproduce
MainPage
. Remove the unnecessary code in the defaultMainPage.cs
.Link to public reproduction project repository
No response
Version with bug
9.0.0-rc.1.24453.9
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
Android, Windows, I was not able test on other platforms
Affected platform versions
No response
Did you find any workaround?
No.
Relevant log output
No response