This repository was archived by the owner on Apr 29, 2024. It is now read-only.
File tree 3 files changed +13
-8
lines changed
GetStarted/Tutorials/LocalDatabaseTutorial
3 files changed +13
-8
lines changed Original file line number Diff line number Diff line change 9
9
Placeholder =" Enter age" />
10
10
<Button Text =" Add to Database"
11
11
Clicked =" OnButtonClicked" />
12
- <ListView x : Name =" listView " >
13
- <ListView .ItemTemplate>
12
+ <CollectionView x : Name =" collectionView " >
13
+ <CollectionView .ItemTemplate>
14
14
<DataTemplate >
15
- <TextCell Text =" {Binding Name}"
16
- Detail =" {Binding Age}" />
15
+ <StackLayout >
16
+ <Label Text =" {Binding Name}"
17
+ FontSize =" Medium" />
18
+ <Label Text =" {Binding Age}"
19
+ TextColor =" Silver"
20
+ FontSize =" Small" />
21
+ </StackLayout >
17
22
</DataTemplate >
18
- </ListView .ItemTemplate>
19
- </ListView >
23
+ </CollectionView .ItemTemplate>
24
+ </CollectionView >
20
25
</StackLayout >
21
26
</ContentPage >
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ public MainPage()
13
13
protected override async void OnAppearing ( )
14
14
{
15
15
base . OnAppearing ( ) ;
16
- listView . ItemsSource = await App . Database . GetPeopleAsync ( ) ;
16
+ collectionView . ItemsSource = await App . Database . GetPeopleAsync ( ) ;
17
17
}
18
18
19
19
async void OnButtonClicked ( object sender , EventArgs e )
@@ -27,7 +27,7 @@ await App.Database.SavePersonAsync(new Person
27
27
} ) ;
28
28
29
29
nameEntry . Text = ageEntry . Text = string . Empty ;
30
- listView . ItemsSource = await App . Database . GetPeopleAsync ( ) ;
30
+ collectionView . ItemsSource = await App . Database . GetPeopleAsync ( ) ;
31
31
}
32
32
}
33
33
}
You can’t perform that action at this time.
0 commit comments