summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.ControlGallery.MacOS/BrokenNativeControl.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Xamarin.Forms.ControlGallery.MacOS/BrokenNativeControl.cs')
-rw-r--r--Xamarin.Forms.ControlGallery.MacOS/BrokenNativeControl.cs23
1 files changed, 23 insertions, 0 deletions
diff --git a/Xamarin.Forms.ControlGallery.MacOS/BrokenNativeControl.cs b/Xamarin.Forms.ControlGallery.MacOS/BrokenNativeControl.cs
new file mode 100644
index 00000000..5c353664
--- /dev/null
+++ b/Xamarin.Forms.ControlGallery.MacOS/BrokenNativeControl.cs
@@ -0,0 +1,23 @@
+using System;
+using AppKit;
+using CoreGraphics;
+
+namespace Xamarin.Forms.ControlGallery.MacOS
+{
+ /// <summary>
+ /// This is a custom Android control which deliberately does some incorrect measuring/layout
+ /// </summary>
+ public class BrokenNativeControl : NSTextField
+ {
+ public override string StringValue
+ {
+ get { return base.StringValue; }
+ set { base.StringValue = value.ToUpper(); }
+ }
+
+ public override CGSize SizeThatFits(CGSize size)
+ {
+ return new CGSize(size.Width, 150);
+ }
+ }
+}