xamarin/Xamarin.Forms

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

开放

#6,797 创建于 2019年7月5日

 (1 条评论) (0 个反应) (0 位负责人)C# (1,926 个派生)batch import
a/stylee/3 :clock3:help wantedt/bug :bug:up-for-grabs

仓库指标

星标
 (5,644 个星标)
PR 合并指标
 (30 天内没有已合并 PR)

描述

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

贡献者指南