-
Notifications
You must be signed in to change notification settings - Fork 24
/
MyUI3.cs
48 lines (40 loc) · 1.01 KB
/
MyUI3.cs
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
45
46
47
48
using UnityEngine;
using System.ComponentModel;
using UnityWeld.Binding;
[Binding]
public class MyUI3 : MonoBehaviour, INotifyPropertyChanged
{
private ObservableList<ItemViewModel> items = new ObservableList<ItemViewModel>()
{
new ItemViewModel("1"),
new ItemViewModel("2"),
new ItemViewModel("3")
};
[Binding]
public ObservableList<ItemViewModel> Items
{
get
{
return items;
}
}
/// <summary>
/// Event to raise when a property's value has changed.
/// </summary>
public event PropertyChangedEventHandler PropertyChanged;
// Use this for initialization
void Start()
{
}
// Update is called once per frame
void Update()
{
}
private void OnPropertyChanged(string propertyName)
{
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}
}