@@ -9,33 +9,20 @@ namespace CollectionsExperiment.Samples;
9
9
[ ToolkitSample ( id : nameof ( IncrementalLoadingCollectionSample ) , "Incremental Loading Collection" , description : $ "A sample for showing how to create and use a IncrementalLoadingCollection.") ]
10
10
public sealed partial class IncrementalLoadingCollectionSample : Page
11
11
{
12
+ // IncrementalLoadingCollection can be bound to a GridView or a ListView. In this case it is a ListView called PeopleListView.
13
+ public IncrementalLoadingCollection < PeopleSource , Person > PeopleSource { get ; set ; } = new ( new PeopleSource ( ) ) ;
14
+
12
15
public IncrementalLoadingCollectionSample ( )
13
16
{
14
17
this . InitializeComponent ( ) ;
15
- Load ( ) ;
16
- }
17
- private void Load ( )
18
- {
19
- // IncrementalLoadingCollection can be bound to a GridView or a ListView. In this case it is a ListView called PeopleListView.
20
- var collection = new IncrementalLoadingCollection < PeopleSource , Person > ( new PeopleSource ( ) ) ;
21
- PeopleListView . ItemsSource = collection ;
22
-
23
- // Binds the collection to the page DataContext in order to use its IsLoading and HasMoreItems properties.
24
- DataContext = collection ;
25
- }
26
-
27
- private async void RefreshCollection ( object sender , RoutedEventArgs e )
28
- {
29
- var collection = ( IncrementalLoadingCollection < PeopleSource , Person > ) PeopleListView . ItemsSource ;
30
- await collection . RefreshAsync ( ) ;
31
18
}
32
19
}
33
20
34
21
/// <summary>
35
22
/// A sample implementation of the <see cref="IIncrementalSource{TSource}"/> interface.
36
23
/// </summary>
37
24
/// <seealso cref="IIncrementalSource{TSource}"/>
38
- public class PeopleSource : IIncrementalSource < Person >
25
+ public partial class PeopleSource : IIncrementalSource < Person >
39
26
{
40
27
private readonly List < Person > _people ;
41
28
@@ -94,7 +81,7 @@ public PeopleSource()
94
81
/// <summary>
95
82
/// A sample class used to show how to use the <see cref="IIncrementalSource{TSource}"/> interface.
96
83
/// </summary>
97
- public class Person
84
+ public partial class Person
98
85
{
99
86
/// <summary>
100
87
/// Gets or sets the name of the person.
0 commit comments