diff options
author | Samantha Houts <samantha.houts@xamarin.com> | 2016-03-29 15:41:39 -0700 |
---|---|---|
committer | Samantha Houts <samantha.houts@xamarin.com> | 2016-03-29 15:41:39 -0700 |
commit | 0817c7a4580a01fe03336276e3ec325b9c1bdf2f (patch) | |
tree | b0ca94775dc87da9f48ef700f195119628feaece /Xamarin.Forms.Platform.WinRT/ButtonRenderer.cs | |
parent | 346338b5dc3c84b80969376bc87e886f4ef880a8 (diff) | |
download | xamarin-forms-0817c7a4580a01fe03336276e3ec325b9c1bdf2f.tar.gz xamarin-forms-0817c7a4580a01fe03336276e3ec325b9c1bdf2f.tar.bz2 xamarin-forms-0817c7a4580a01fe03336276e3ec325b9c1bdf2f.zip |
[W] Button BG Color & BorderRadius are consistent
UWP Buttons now respect the BorderRadius.
BackgroundColor no longer extends past the Border.
Diffstat (limited to 'Xamarin.Forms.Platform.WinRT/ButtonRenderer.cs')
-rw-r--r-- | Xamarin.Forms.Platform.WinRT/ButtonRenderer.cs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Xamarin.Forms.Platform.WinRT/ButtonRenderer.cs b/Xamarin.Forms.Platform.WinRT/ButtonRenderer.cs index 60ee6418..131e5f9f 100644 --- a/Xamarin.Forms.Platform.WinRT/ButtonRenderer.cs +++ b/Xamarin.Forms.Platform.WinRT/ButtonRenderer.cs @@ -88,6 +88,14 @@ namespace Xamarin.Forms.Platform.WinRT } } + protected override void UpdateBackgroundColor() + { + // Button is a special case; we don't want to set the Control's background + // because it goes outside the bounds of the Border/ContentPresenter, + // which is where we might change the BorderRadius to create a rounded shape. + return; + } + void OnButtonClick(object sender, RoutedEventArgs e) { Button buttonView = Element; @@ -97,7 +105,7 @@ namespace Xamarin.Forms.Platform.WinRT void UpdateBackground() { - Control.Background = Element.BackgroundColor != Color.Default ? Element.BackgroundColor.ToBrush() : (Brush)Windows.UI.Xaml.Application.Current.Resources["ButtonBackgroundThemeBrush"]; + Control.BackgroundColor = Element.BackgroundColor != Color.Default ? Element.BackgroundColor.ToBrush() : (Brush)Windows.UI.Xaml.Application.Current.Resources["ButtonBackgroundThemeBrush"]; } void UpdateBorderColor() |