summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.MacOS/Extensions/NSTableViewExtensions.cs
blob: c81e31ebe8573052eb5dec73cc0af215a7a653fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
´╗┐using AppKit;

namespace Xamarin.Forms.Platform.MacOS
{
	internal static class NSTableViewExtensions
	{
		public static NSTableView AsListViewLook(this NSTableView self)
		{
			self.SelectionHighlightStyle = NSTableViewSelectionHighlightStyle.SourceList;

			self.AllowsColumnReordering = false;
			self.AllowsColumnResizing = false;
			self.AllowsColumnSelection = false;

			//this is needed .. can we go around it ?
			self.AddColumn(new NSTableColumn("1"));
			//this line hides the header by default
			self.HeaderView = new CustomNSTableHeaderView();
			return self;
		}
	}
}