summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.WP8
diff options
context:
space:
mode:
authorAndrei N <nitescua@yahoo.com>2016-10-09 10:52:38 +0300
committerJason Smith <jason.smith@xamarin.com>2016-11-15 11:56:03 -0800
commit4554e822e3cf5ae71724a8fc89d1a8728118f060 (patch)
treef7befe212762dd6af5e4d8ae9c90a606c5ee7fc6 /Xamarin.Forms.Platform.WP8
parent0cc2fd2b6742a29fedc03de942801cc14ff6b499 (diff)
downloadxamarin-forms-4554e822e3cf5ae71724a8fc89d1a8728118f060.tar.gz
xamarin-forms-4554e822e3cf5ae71724a8fc89d1a8728118f060.tar.bz2
xamarin-forms-4554e822e3cf5ae71724a8fc89d1a8728118f060.zip
Added CornerRadius property To Frame control
Diffstat (limited to 'Xamarin.Forms.Platform.WP8')
-rw-r--r--Xamarin.Forms.Platform.WP8/FrameRenderer.cs14
1 files changed, 13 insertions, 1 deletions
diff --git a/Xamarin.Forms.Platform.WP8/FrameRenderer.cs b/Xamarin.Forms.Platform.WP8/FrameRenderer.cs
index 00472161..2149033b 100644
--- a/Xamarin.Forms.Platform.WP8/FrameRenderer.cs
+++ b/Xamarin.Forms.Platform.WP8/FrameRenderer.cs
@@ -19,6 +19,7 @@ namespace Xamarin.Forms.Platform.WinPhone
PackChild();
UpdateBorder();
+ UpdateCornerRadius();
}
protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)
@@ -29,6 +30,8 @@ namespace Xamarin.Forms.Platform.WinPhone
PackChild();
else if (e.PropertyName == Frame.OutlineColorProperty.PropertyName || e.PropertyName == Frame.HasShadowProperty.PropertyName)
UpdateBorder();
+ else if (e.PropertyName == Frame.CornerRadiusProperty.PropertyName)
+ UpdateCornerRadius();
}
void PackChild()
@@ -44,7 +47,6 @@ namespace Xamarin.Forms.Platform.WinPhone
void UpdateBorder()
{
- Control.CornerRadius = new CornerRadius(5);
if (Element.OutlineColor != Color.Default)
{
Control.BorderBrush = Element.OutlineColor.ToBrush();
@@ -53,5 +55,15 @@ namespace Xamarin.Forms.Platform.WinPhone
else
Control.BorderBrush = new Color(0, 0, 0, 0).ToBrush();
}
+
+ void UpdateCornerRadius()
+ {
+ float cornerRadius = Element.CornerRadius;
+
+ if (cornerRadius == -1f)
+ cornerRadius = 5f; // default corner radius
+
+ Control.CornerRadius = new CornerRadius(cornerRadius);
+ }
}
} \ No newline at end of file