-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Open
Labels
area-xamlXAML, CSS, Triggers, BehaviorsXAML, CSS, Triggers, Behaviorsi/regressionThis issue described a confirmed regression on a currently supported versionThis issue described a confirmed regression on a currently supported versionplatform/androidregressed-in-9.0.0s/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
With MAUI v8 we could create styles based on other styles
<Style x:Key="BaseLabel" TargetType="Label">
<Setter Property="BackgroundColor" Value="Transparent" />
<Setter Property="FontFamily" Value="OpenSansRegular" />
<Setter Property="FontSize" Value="20" />
<Setter Property="VisualStateManager.VisualStateGroups">
<VisualStateGroupList>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Disabled">
<VisualState.Setters>
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateGroupList>
</Setter>
</Style>
<Style BasedOn="{StaticResource BaseLabel}" TargetType="local:MyLabel">
<Setter Property="TextColor" Value="Green" />
</Style>
<Style BasedOn="{StaticResource BaseLabel}" TargetType="local:MyLabel2">
<Setter Property="TextColor" Value="Blue" />
</Style>
<VerticalStackLayout Padding="30,0" Spacing="25">
<local:MyLabel Text="Label with derrived style with derrived disabled visual state" />
<local:MyLabel2 Text="Label with derrived style with explicit disabled visual state" />
<local:MyLabel IsEnabled="False" Text="Disabled label with derrived style with derrived disabled visual state" />
<local:MyLabel2 IsEnabled="False" Text="Disabled label with derrived style with explicit disabled visual state" />
</VerticalStackLayout>
This does not work with MAUI 9.0.30 anymore

Steps to Reproduce
- Create custom control derived from label. No other customizations needed
- Create the styles as in
Descriptiondescribed - Create a new ContentPage with the VerticalStackLayout as in Description described.
Link to public reproduction project repository
No response
Version with bug
9.0.30 SR3
Is this a regression from previous behavior?
Yes, this used to work in .NET MAUI
Last version that worked well
8.0.100 SR10
Affected platforms
Android, I was not able test on other platforms
Affected platform versions
No response
Did you find any workaround?
Set VisualStates explicit on derived styles.
<Style BasedOn="{StaticResource BaseLabel}" TargetType="local:MyLabel2">
<Setter Property="TextColor" Value="Blue" />
<Setter Property="VisualStateManager.VisualStateGroups">
<VisualStateGroupList>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Disabled">
<VisualState.Setters>
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateGroupList>
</Setter>
</Style>
Relevant log output
bronteq and ivosnozataenito
Metadata
Metadata
Assignees
Labels
area-xamlXAML, CSS, Triggers, BehaviorsXAML, CSS, Triggers, Behaviorsi/regressionThis issue described a confirmed regression on a currently supported versionThis issue described a confirmed regression on a currently supported versionplatform/androidregressed-in-9.0.0s/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

