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

ColorComponentViewController.cs « Custom « Controls « Xamarin.PropertyEditing.Mac - github.com/xamarin/Xamarin.PropertyEditing.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1b3e93bc49da4f0a0789c97c6616ab8c7caf6740 (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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
using System;
using System.ComponentModel;
using AppKit;
using CoreGraphics;
using Xamarin.PropertyEditing.ViewModels;

namespace Xamarin.PropertyEditing.Mac
{
	internal class ColorComponentViewController : NotifyingViewController<SolidBrushViewModel>
	{
		private ColorComponentEditor editor;

		public ColorComponentViewController (ChannelEditorType type) : base ()
		{
			PreferredContentSize = new CGSize (100, 400);
			EditorType = type;
		}

		public ChannelEditorType EditorType { get; }

		public override void OnViewModelChanged (SolidBrushViewModel oldModel)
		{
			base.OnViewModelChanged (oldModel);
			this.editor.ViewModel = ViewModel;
		}

		public override void ViewWillDisappear ()
		{
			base.ViewWillDisappear ();
			this.editor.ViewModel = null;
		}

		public override void ViewWillAppear ()
		{
			base.ViewWillAppear ();
			this.editor.ViewModel = ViewModel;
		}

		public override void LoadView ()
		{
			View = this.editor = new ColorComponentEditor (this.EditorType);
		}
	}
}