@@ -10,7 +10,7 @@ namespace CollectionsExperiment.Samples;
10
10
[ ToolkitSample ( id : nameof ( AdvancedCollectionViewSample ) , "AdvancedCollectionView" , description : $ "A sample for showing how to create and use a { nameof ( AdvancedCollectionView ) } for sorting and filtering.") ]
11
11
public sealed partial class AdvancedCollectionViewSample : Page
12
12
{
13
- public ObservableCollection < Person > Original { get ; private set ; }
13
+ public ObservableCollection < Employee > Original { get ; private set ; }
14
14
15
15
public AdvancedCollectionView CollectionView { get ; private set ; }
16
16
@@ -25,30 +25,30 @@ public AdvancedCollectionViewSample()
25
25
private void Setup ( )
26
26
{
27
27
// left list
28
- Original = new ObservableCollection < Person >
28
+ Original = new ObservableCollection < Employee >
29
29
{
30
- new Person { Name = "Staff" } ,
31
- new Person { Name = "42" } ,
32
- new Person { Name = "Swan" } ,
33
- new Person { Name = "Orchid" } ,
34
- new Person { Name = "15" } ,
35
- new Person { Name = "Flame" } ,
36
- new Person { Name = "16" } ,
37
- new Person { Name = "Arrow" } ,
38
- new Person { Name = "Tempest" } ,
39
- new Person { Name = "23" } ,
40
- new Person { Name = "Pearl" } ,
41
- new Person { Name = "Hydra" } ,
42
- new Person { Name = "Lamp Post" } ,
43
- new Person { Name = "4" } ,
44
- new Person { Name = "Looking Glass" } ,
45
- new Person { Name = "8" } ,
30
+ new Employee { Name = "Staff" } ,
31
+ new Employee { Name = "42" } ,
32
+ new Employee { Name = "Swan" } ,
33
+ new Employee { Name = "Orchid" } ,
34
+ new Employee { Name = "15" } ,
35
+ new Employee { Name = "Flame" } ,
36
+ new Employee { Name = "16" } ,
37
+ new Employee { Name = "Arrow" } ,
38
+ new Employee { Name = "Tempest" } ,
39
+ new Employee { Name = "23" } ,
40
+ new Employee { Name = "Pearl" } ,
41
+ new Employee { Name = "Hydra" } ,
42
+ new Employee { Name = "Lamp Post" } ,
43
+ new Employee { Name = "4" } ,
44
+ new Employee { Name = "Looking Glass" } ,
45
+ new Employee { Name = "8" } ,
46
46
} ;
47
47
48
48
// right list
49
49
var acv = new AdvancedCollectionView ( Original ) ;
50
50
int nul ;
51
- acv . Filter = x => ! int . TryParse ( ( ( Person ) x ) . Name , out nul ) ;
51
+ acv . Filter = x => ! int . TryParse ( ( ( Employee ) x ) . Name , out nul ) ;
52
52
acv . SortDescriptions . Add ( new SortDescription ( "Name" , SortDirection . Ascending ) ) ;
53
53
54
54
CollectionView = acv ;
@@ -58,19 +58,19 @@ private void Add_Click(object sender, RoutedEventArgs e)
58
58
{
59
59
if ( ! string . IsNullOrWhiteSpace ( NewItemBox . Text ) )
60
60
{
61
- Original . Insert ( 0 , new Person { Name = NewItemBox . Text } ) ;
61
+ Original . Insert ( 0 , new Employee { Name = NewItemBox . Text } ) ;
62
62
NewItemBox . Text = "" ;
63
63
}
64
64
}
65
+ }
65
66
67
+ /// <summary>
68
+ /// A sample class used to show how to use the <see cref="AdvancedCollectionView"/> class.
69
+ /// </summary>
70
+ public partial class Employee
71
+ {
66
72
/// <summary>
67
- /// A sample class used to show how to use the <see cref="IIncrementalSource{TSource}"/> interface .
73
+ /// Gets or sets the name of the person .
68
74
/// </summary>
69
- public class Person
70
- {
71
- /// <summary>
72
- /// Gets or sets the name of the person.
73
- /// </summary>
74
- public string ? Name { get ; set ; }
75
- }
75
+ public string ? Name { get ; set ; }
76
76
}
0 commit comments