3 using System.Reflection;
5 using Tizen.NUI.Binding;
8 using Tizen.NUI.UIComponents;
9 using Tizen.NUI.BaseComponents;
10 using System.ComponentModel;
12 namespace Tizen.NUI.Examples
15 // class MyAppViewModel : INotifyPropertyChanged
18 // public event PropertyChangedEventHandler PropertyChanged;
19 // private Command _firstClick;
20 // private int count = 0;
22 // private string[] colors = new string[] {"Black", "Blue", "Gray", "Green", "Purple", "Pink", "Red" };
23 // public string TextColor = "Red";
24 // public Command ChangeColor {
26 // return _firstClick ?? (_firstClick = new Command (() => {
27 // Console.WriteLine ("First button clicked");
29 // TextColor = colors[count % 7];
34 // public MyAppViewModel()
39 class MyAppViewModel : INotifyPropertyChanged
42 public event PropertyChangedEventHandler PropertyChanged;
43 private Command _firstClick;
44 private int clickCounter = 0;
45 public string message;
47 //static readonly BindableProperty MessageProperty = BindableProperty.Create<MyAppViewModel, string> ((MyAppViewModel v) => v.Message, "- - - - - Message - - -");
52 Console.WriteLine ("Message : {0}, {1}",message,value);
57 Console.WriteLine ("Message111 : {0}",message);
59 if (PropertyChanged != null)
61 Console.WriteLine ("Message222 : {0}",message);
63 new PropertyChangedEventArgs("Message"));
73 public Command ShowClickCount {
75 return _firstClick ?? (_firstClick = new Command (() => {
76 Console.WriteLine ("First button clicked");
78 Message = "Clicked " + clickCounter.ToString() + " times";
83 public MyAppViewModel()
85 this.message = String.Format("------test-----");
86 this.Message = String.Format("------test111-----");;
91 public class TempTest : NUIApplication
94 protected override void OnCreate()
97 Window window = Window.Instance;
98 window.BackgroundColor = Color.White;
100 TempPage myPage = new TempPage(window);
101 // myPage.InitializeComponents(myPage, typeof(TempPage));
102 Extensions.LoadFromXaml(myPage, typeof(TempPage));
103 // myPage.BindingContext = new MyAppViewModel ();
104 Console.WriteLine("================== Set BindingContext in Application !!!! ==================");
108 public static void _Main(string[] args)
110 TempTest p = new TempTest();