aboutsummaryrefslogtreecommitdiffstatsci
path: root/Samples/BindingTest/Program.cs
blob: 469e34735b6a355fb0f1464f556e8fb3e57cb5aa (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
// Copyright (c) 2013-2020  Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
//
// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
using System;
using System.Runtime.CompilerServices;
using Crow;

namespace BindingTest
{
	class Program : SampleBase
	{

		static void Main ()
		{
			using (Program app = new Program ()) {
				app.Run ();
				//DbgLogger.save (app);
			}			
		}

		protected override void OnInitialized ()
		{
			Load ("#ui.test.crow").DataSource = this;
			TcVCInstance = new TestClassVC ();
		}


		void setDataSourceNull (object sender, MouseButtonEventArgs e)
		{
			TcVCInstance = null;
			Console.WriteLine ("set data source null");
		}
		void setDataSourceThis (object sender, MouseButtonEventArgs e)
		{
			TcVCInstance = new TestClassVC () { Prop1 = "instance 1 prop1 value", Prop2 = "instance 1 prop2 value" };
			Console.WriteLine ("set data source not null");
		}

	}
}