-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainPage.xaml.cs
48 lines (43 loc) · 1.85 KB
/
MainPage.xaml.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 System;
using System.Collections.ObjectModel;
using System.Diagnostics;
using Windows.UI.Xaml.Controls;
namespace EditingServiceBug
{
public sealed partial class MainPage : Page
{
// A few rows of sample data.
ObservableCollection<TestRow> TestCollection = new ObservableCollection<TestRow>()
{
new TestRow { MvvmProperty = "A", NonMvvmProperty = "B" },
new TestRow { MvvmProperty = "C", NonMvvmProperty = "D" },
new TestRow { MvvmProperty = "E", NonMvvmProperty = "F" },
new TestRow { MvvmProperty = "G", NonMvvmProperty = "H" },
new TestRow { MvvmProperty = "I", NonMvvmProperty = "J" },
new TestRow { MvvmProperty = "K", NonMvvmProperty = "L" },
new TestRow { MvvmProperty = "M", NonMvvmProperty = "N" },
new TestRow { MvvmProperty = "O", NonMvvmProperty = "P" },
new TestRow { MvvmProperty = "Q", NonMvvmProperty = "R" },
new TestRow { MvvmProperty = "S", NonMvvmProperty = "T" },
new TestRow { MvvmProperty = "U", NonMvvmProperty = "V" },
new TestRow { MvvmProperty = "W", NonMvvmProperty = "X" },
new TestRow { MvvmProperty = "Y", NonMvvmProperty = "Z" },
};
public MainPage()
{
this.InitializeComponent();
foreach (var row in TestCollection)
{
row.PropertyChanged += Row_PropertyChanged;
}
DataGrid.ItemsSource = TestCollection;
}
private void Row_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
{
if (sender is TestRow row)
{
Debug.WriteLine($"TestRow.PropertyChanged: property={e.PropertyName} value={row.MvvmProperty} instanceId={row.InstanceId}");
}
}
}
}