This repository was archived by the owner on Apr 29, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +13
-8
lines changed
GetStarted/Tutorials/LocalDatabaseTutorial Expand file tree Collapse file tree 3 files changed +13
-8
lines changed Original file line number Diff line number Diff line change 99 Placeholder =" Enter age" />
1010 <Button Text =" Add to Database"
1111 Clicked =" OnButtonClicked" />
12- <ListView x : Name =" listView " >
13- <ListView .ItemTemplate>
12+ <CollectionView x : Name =" collectionView " >
13+ <CollectionView .ItemTemplate>
1414 <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 >
1722 </DataTemplate >
18- </ListView .ItemTemplate>
19- </ListView >
23+ </CollectionView .ItemTemplate>
24+ </CollectionView >
2025 </StackLayout >
2126</ContentPage >
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ public MainPage()
1313 protected override async void OnAppearing ( )
1414 {
1515 base . OnAppearing ( ) ;
16- listView . ItemsSource = await App . Database . GetPeopleAsync ( ) ;
16+ collectionView . ItemsSource = await App . Database . GetPeopleAsync ( ) ;
1717 }
1818
1919 async void OnButtonClicked ( object sender , EventArgs e )
@@ -27,7 +27,7 @@ await App.Database.SavePersonAsync(new Person
2727 } ) ;
2828
2929 nameEntry . Text = ageEntry . Text = string . Empty ;
30- listView . ItemsSource = await App . Database . GetPeopleAsync ( ) ;
30+ collectionView . ItemsSource = await App . Database . GetPeopleAsync ( ) ;
3131 }
3232 }
3333 }
You can’t perform that action at this time.
0 commit comments