-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Open
Labels
area-controls-labelLabel, SpanLabel, Spanplatform/windowss/triagedIssue has been reviewedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering TriageVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't workingSomething isn't working
Milestone
Description
Description
The following just works fine on both Windows and Android.
<CollectionView>
<CollectionView.ItemsSource>
<x:Array Type="{x:Type x:String}">
<x:String>Item 1</x:String>
<x:String>Item 2</x:String>
</x:Array>
</CollectionView.ItemsSource>
<CollectionView.ItemTemplate>
<DataTemplate x:DataType="{x:Type x:String}">
<Grid Padding="10">
<OnPlatform x:TypeArguments="View">
<On Platform="Android">
<Label Text="{Binding}" />
</On>
<On Platform="WinUI">
<Label Text="{Binding}" />
</On>
</OnPlatform>
</Grid>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>But adding page level style below,
<ContentPage.Resources>
<Style TargetType="Label">
<Setter Property="FontSize"
Value="30" />
</Style>
</ContentPage.Resources>makes the Label invisible on Windows.
Steps to Reproduce
Replace ContentPage of the MainPage with my code above.
Link to public reproduction project repository
Not needed
Version with bug
10.0.20
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
Windows
Affected platform versions
Windows 10
Did you find any workaround?
Explicitly specify BackgroundColor of the Label on Windows section:
<On Platform="WinUI">
<Label Text="{Binding}" BackgroundColor="White" />
</On>Relevant log output
Metadata
Metadata
Assignees
Labels
area-controls-labelLabel, SpanLabel, Spanplatform/windowss/triagedIssue has been reviewedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering TriageVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't workingSomething isn't working