-
Notifications
You must be signed in to change notification settings - Fork 913
Expand file tree
/
Copy pathCheckListsView.xaml.cs
More file actions
134 lines (118 loc) · 3.41 KB
/
Copy pathCheckListsView.xaml.cs
File metadata and controls
134 lines (118 loc) · 3.41 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
/***************************************************************************************
Toolkit for WPF
Copyright (C) 2007-2016 Xceed Software Inc.
This program is provided to you under the terms of the Microsoft Public
License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license
For more features, controls, and fast professional support,
pick up the Plus Edition at https://xceed.com/xceed-toolkit-plus-for-wpf/
Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids
*************************************************************************************/
using System.Collections.Generic;
using System.ComponentModel;
namespace Xceed.Wpf.Toolkit.LiveExplorer.Samples.CheckLists.Views
{
/// <summary>
/// Interaction logic for CheckListsView.xaml
/// </summary>
public partial class CheckListsView : DemoView
{
public CheckListsView()
{
InitializeComponent();
_itemModels.ItemsSource = GetData();
_checkListBox.ItemsSource = GetData();
_checkComboBox.ItemsSource = GetData();
}
private static List<Person> GetData()
{
return new List<Person>
{
new Person {ID=101, FirstName="John", LastName="Smith"},
new Person {ID=102, FirstName="Janel", LastName="Leverling"},
new Person {ID=103, FirstName="Laura", LastName="Callahan"},
new Person {ID=104, FirstName="Robert", LastName="King"},
new Person {ID=105, FirstName="Margaret", LastName="Peacock"},
new Person {ID=106, FirstName="Andrew", LastName="Fuller"},
new Person {ID=107, FirstName="Anne", LastName="Dodsworth"},
new Person {ID=108, FirstName="Nancy", LastName="Davolio"},
new Person {ID=109, FirstName="Naomi", LastName="Suyama"},
};
}
}
public class Person : INotifyPropertyChanged
{
private bool _isSelected;
private int _ID;
private string _firstName;
private string _lastName;
public bool IsSelected
{
get
{
return _isSelected;
}
set
{
_isSelected = value;
OnPropertyChanged( "IsSelected" );
}
}
public int ID
{
get
{
return _ID;
}
set
{
_ID = value;
OnPropertyChanged( "ID" );
}
}
public string FirstName
{
get
{
return _firstName;
}
set
{
_firstName = value;
OnPropertyChanged( "FirstName" );
}
}
public string LastName
{
get
{
return _lastName;
}
set
{
_lastName = value;
OnPropertyChanged( "LastName" );
}
}
public string ModelDisplay
{
get
{
string completeName = string.Format("{0} {1}", FirstName, LastName).PadRight(20);
return string.Format(
"ID={0}: Name= {1}, IsSelected= {2}",
ID,
completeName,
IsSelected );
}
}
public event PropertyChangedEventHandler PropertyChanged;
protected void OnPropertyChanged( string propertyName )
{
if( PropertyChanged != null )
{
PropertyChanged( this, new PropertyChangedEventArgs( propertyName ) );
PropertyChanged( this, new PropertyChangedEventArgs( "ModelDisplay" ) );
}
}
}
}