summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.ControlGallery.MacOS/BrokenNativeControl.cs
blob: 5c35366492ac6b8cf4fa22a9f1edf0e055dd0266 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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);
		}
	}
}