Welcome to mirror list, hosted at ThFree Co, Russian Federation.

ResourceTableDataSource.cs « RequestResource « Controls « Xamarin.PropertyEditing.Mac - github.com/xamarin/Xamarin.PropertyEditing.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 6c4ad8a51678913cf035584cd2fb4b3d24792df0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
using System;
using AppKit;
using Xamarin.PropertyEditing.ViewModels;

namespace Xamarin.PropertyEditing.Mac
{
	internal class ResourceTableDataSource
		: NSTableViewDataSource
	{
		private ResourceSelectorViewModel viewModel;
		internal ResourceTableDataSource (ResourceSelectorViewModel resourceSelectorViewModel)
		{
			if (resourceSelectorViewModel == null)
				throw new ArgumentNullException (nameof (resourceSelectorViewModel));

			this.viewModel = resourceSelectorViewModel;
		}

		public ResourceSelectorViewModel ViewModel => this.viewModel;
		public nint ResourceCount => this.viewModel.Resources.Count;

		public override nint GetRowCount (NSTableView tableView)
		{
			return ResourceCount;
		}
	}
}