xamarin/Xamarin.Forms

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

Aberta

#6.797 aberto em 5 de jul. de 2019

 (1 comentário) (0 reação) (0 responsável)C# (1.926 forks)batch import
a/stylee/3 :clock3:help wantedt/bug :bug:up-for-grabs

Métricas do repositório

Stars
 (5.644 estrelas)
Métricas de merge de PR
 (Nenhuma PRs mesclada em 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

Guia do colaborador