[UWP] Fixes default button padding (#6455)
authorPavel Yakovlev <v-payako@microsoft.com>
Mon, 29 Jul 2019 23:49:18 +0000 (02:49 +0300)
committerSamantha Houts <samhouts@users.noreply.github.com>
Mon, 29 Jul 2019 23:49:18 +0000 (16:49 -0700)
fixes #6450

Xamarin.Forms.Platform.UAP/ButtonRenderer.cs
Xamarin.Forms.Platform.UAP/ImageButtonRenderer.cs

index 38160ad..7edbda1 100644 (file)
@@ -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();
index 5e950c2..9c7021c 100644 (file)
@@ -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);