xamarin/Xamarin.Forms

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

Aperta

#6797 aperta il 5 lug 2019

 (1 commento) (0 reazioni) (0 assegnatari)C# (1926 fork)batch import
a/stylee/3 :clock3:help wantedt/bug :bug:up-for-grabs

Metriche repository

Star
 (5644 stelle)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

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

Guida contributor