diff options
Diffstat (limited to 'Xamarin.Forms.Platform.MacOS/Extensions/NSTableViewExtensions.cs')
-rw-r--r-- | Xamarin.Forms.Platform.MacOS/Extensions/NSTableViewExtensions.cs | 22 |
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 00000000..c81e31eb --- /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 |