summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.MacOS/Extensions/NSTableViewExtensions.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Xamarin.Forms.Platform.MacOS/Extensions/NSTableViewExtensions.cs')
-rw-r--r--Xamarin.Forms.Platform.MacOS/Extensions/NSTableViewExtensions.cs22
1 files changed, 22 insertions, 0 deletions
diff --git a/Xamarin.Forms.Platform.MacOS/Extensions/NSTableViewExtensions.cs b/Xamarin.Forms.Platform.MacOS/Extensions/NSTableViewExtensions.cs
new file mode 100644
index 0000000..c81e31e
--- /dev/null
+++ b/Xamarin.Forms.Platform.MacOS/Extensions/NSTableViewExtensions.cs
@@ -0,0 +1,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;
+ }
+ }
+} \ No newline at end of file