xamarin/Xamarin.Forms

[Bug] [Core] Style.Setter is not applied for CornerRadius when using multiple StyleClasses

Open

#6,797 opened on Jul 5, 2019

 (1 comment) (0 reactions) (0 assignees)C# (1,926 forks)batch import
a/stylee/3 :clock3:help wantedt/bug :bug:up-for-grabs

Repository metrics

Stars
 (5,644 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

Description

Style.Setter is not applied for CornerRadius when using multiple StyleClasses

Steps to Reproduce

use the following:

       <StackLayout Padding="10">
           <StackLayout.Resources>
               <ResourceDictionary>
                   <Style Class="Border" TargetType="Button">
                       <Setter Property="CornerRadius" Value="0"/>
                       <Setter Property="BackgroundColor" Value="Yellow"/>
                       <Setter Property="BorderWidth" Value="1" />
                   </Style>
                   <Style Class="Color" TargetType="Button">
                       <!-- <Setter Property="CornerRadius" Value="0"/> not even if you set it again here -->
                       <Setter Property="BorderColor" Value="Black" />
                   </Style>
               </ResourceDictionary>
           </StackLayout.Resources>
           <Button StyleClass="Border,Color" Text="BackgroundColor and BorderWidth is applied from class 'Border', but CornerRadius not" />
           <Button StyleClass="Border" Text="All properties are applied from class 'Border'" />
       </StackLayout>

Expected Behavior

CornerRadius should be set to 0 for the first button as well.

Actual Behavior

CornerRadius is unset.

Basic Information

  • Version with issue: 3.6.0.539721
  • Platform Target Frameworks:
    • iOS: 12.3.1
    • Android: 9

Contributor guide