summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.MacOS/Extensions/ButtonExtensions.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Xamarin.Forms.Platform.MacOS/Extensions/ButtonExtensions.cs')
-rw-r--r--Xamarin.Forms.Platform.MacOS/Extensions/ButtonExtensions.cs25
1 files changed, 25 insertions, 0 deletions
diff --git a/Xamarin.Forms.Platform.MacOS/Extensions/ButtonExtensions.cs b/Xamarin.Forms.Platform.MacOS/Extensions/ButtonExtensions.cs
new file mode 100644
index 0000000..1bdc62a
--- /dev/null
+++ b/Xamarin.Forms.Platform.MacOS/Extensions/ButtonExtensions.cs
@@ -0,0 +1,25 @@
+´╗┐using System;
+using AppKit;
+
+namespace Xamarin.Forms.Platform.MacOS
+{
+ internal static class ButtonExtensions
+ {
+ public static NSCellImagePosition ToNSCellImagePosition(this Button control)
+ {
+ switch (control.ContentLayout.Position)
+ {
+ case Button.ButtonContentLayout.ImagePosition.Left:
+ return NSCellImagePosition.ImageLeft;
+ case Button.ButtonContentLayout.ImagePosition.Top:
+ return NSCellImagePosition.ImageAbove;
+ case Button.ButtonContentLayout.ImagePosition.Right:
+ return NSCellImagePosition.ImageRight;
+ case Button.ButtonContentLayout.ImagePosition.Bottom:
+ return NSCellImagePosition.ImageBelow;
+ default:
+ return NSCellImagePosition.ImageOnly;
+ }
+ }
+ }
+} \ No newline at end of file