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 +36
-20
lines changed
XAML/ResourceDictionaries/ResourceDictionaryDemo Expand file tree Collapse file tree 3 files changed +36
-20
lines changed Original file line number Diff line number Diff line change 11<?xml version =" 1.0" encoding =" UTF-8" ?>
22<ContentPage xmlns =" http://xamarin.com/schemas/2014/forms"
33 xmlns : x =" http://schemas.microsoft.com/winfx/2009/xaml"
4+ xmlns : local =" clr-namespace:ResourceDictionaryDemo"
5+ xmlns : scg =" clr-namespace:System.Collections.Generic;assembly=netstandard"
46 x : Class =" ResourceDictionaryDemo.ListDataPage"
57 Title =" List Data Page" >
68 <ContentPage .Resources>
1315 </Style >
1416 </ContentPage .Resources>
1517
16- <ListView x : Name =" listView"
17- Margin =" {StaticResource PageMargin}"
18- ItemTemplate =" {StaticResource PersonDataTemplate}" />
19- </ContentPage >
18+ <ListView Margin =" {StaticResource PageMargin}"
19+ ItemTemplate =" {StaticResource PersonDataTemplate}" >
20+ <ListView .ItemsSource>
21+ <scg : List x : TypeArguments =" local:Person" >
22+ <local : Person Name =" Steve"
23+ Age =" 21"
24+ Location =" USA" />
25+ <local : Person Name =" John"
26+ Age =" 37"
27+ Location =" USA" />
28+ <local : Person Name =" Tom"
29+ Age =" 42"
30+ Location =" UK" />
31+ <local : Person Name =" Lucas"
32+ Age =" 29"
33+ Location =" Germany" />
34+ <local : Person Name =" Tariq"
35+ Age =" 39"
36+ Location =" UK" />
37+ <local : Person Name =" Jane"
38+ Age =" 30"
39+ Location =" USA" />
40+ </scg : List >
41+ </ListView .ItemsSource>
42+ </ListView >
43+ </ContentPage >
Original file line number Diff line number Diff line change 1- using System . Collections . Generic ;
2- using Xamarin . Forms ;
1+ using Xamarin . Forms ;
32
43namespace ResourceDictionaryDemo
54{
@@ -8,17 +7,6 @@ public partial class ListDataPage : ContentPage
87 public ListDataPage ( )
98 {
109 InitializeComponent ( ) ;
11-
12- var people = new List < Person > {
13- new Person ( "Steve" , 21 , "USA" ) ,
14- new Person ( "John" , 37 , "USA" ) ,
15- new Person ( "Tom" , 42 , "UK" ) ,
16- new Person ( "Lucas" , 29 , "Germany" ) ,
17- new Person ( "Tariq" , 39 , "UK" ) ,
18- new Person ( "Jane" , 30 , "USA" )
19- } ;
20-
21- listView . ItemsSource = people ;
2210 }
2311 }
2412}
Original file line number Diff line number Diff line change 22{
33 public class Person
44 {
5- public string Name { get ; private set ; }
6- public int Age { get ; private set ; }
7- public string Location { get ; private set ; }
5+ public string Name { get ; set ; }
6+ public int Age { get ; set ; }
7+ public string Location { get ; set ; }
8+
9+ public Person ( )
10+ {
11+ }
812
913 public Person ( string name , int age , string location )
1014 {
You can’t perform that action at this time.
0 commit comments