From: Pavel Yakovlev Date: Mon, 29 Jul 2019 23:49:18 +0000 (+0300) Subject: [UWP] Fixes default button padding (#6455) X-Git-Tag: accepted/tizen/5.5/unified/20200421.150457~232^2~42 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=58d4d6a33cf5d073f334edc5a3d038a0b3bfd8b4;p=platform%2Fcore%2Fcsapi%2Fxsf.git [UWP] Fixes default button padding (#6455) fixes #6450 --- diff --git a/Xamarin.Forms.Platform.UAP/ButtonRenderer.cs b/Xamarin.Forms.Platform.UAP/ButtonRenderer.cs index 38160ad..7edbda1 100644 --- a/Xamarin.Forms.Platform.UAP/ButtonRenderer.cs +++ b/Xamarin.Forms.Platform.UAP/ButtonRenderer.cs @@ -55,7 +55,8 @@ namespace Xamarin.Forms.Platform.UWP if (Element.IsSet(Button.CornerRadiusProperty) && Element.CornerRadius != (int)Button.CornerRadiusProperty.DefaultValue) UpdateBorderRadius(); - if (Element.IsSet(Button.PaddingProperty) && Element.Padding != (Thickness)Button.PaddingProperty.DefaultValue) + // By default Button loads width padding 8, 4, 8 ,4 + if (Element.IsSet(Button.PaddingProperty)) UpdatePadding(); UpdateFont(); diff --git a/Xamarin.Forms.Platform.UAP/ImageButtonRenderer.cs b/Xamarin.Forms.Platform.UAP/ImageButtonRenderer.cs index 5e950c2..9c7021c 100644 --- a/Xamarin.Forms.Platform.UAP/ImageButtonRenderer.cs +++ b/Xamarin.Forms.Platform.UAP/ImageButtonRenderer.cs @@ -112,7 +112,9 @@ namespace Xamarin.Forms.Platform.UWP if (Element.IsSet(ImageButton.CornerRadiusProperty) && Element.CornerRadius != (int)ImageButton.CornerRadiusProperty.DefaultValue) UpdateBorderRadius(); - if (Element.IsSet(Button.PaddingProperty) && Element.Padding != (Thickness)Button.PaddingProperty.DefaultValue) + + // By default Button loads width padding 8, 4, 8 ,4 + if (Element.IsSet(Button.PaddingProperty)) UpdatePadding(); await TryUpdateSource().ConfigureAwait(false);