|
12 | 12 | Title="ListViewPage"
|
13 | 13 | d:DataContext="{d:DesignInstance local:ListViewPage,
|
14 | 14 | IsDesignTimeCreatable=False}"
|
15 |
| - d:DesignHeight="450" |
| 15 | + d:DesignHeight="750" |
16 | 16 | d:DesignWidth="800"
|
17 | 17 | ui:Design.Background="{DynamicResource ApplicationBackgroundBrush}"
|
18 | 18 | ui:Design.Foreground="{DynamicResource TextFillColorPrimaryBrush}"
|
|
30 | 30 | \t</ListView.ItemTemplate>\n
|
31 | 31 | </ListView>
|
32 | 32 | </controls:ControlExample.XamlCode>
|
33 |
| - <ListView |
34 |
| - Height="200" |
| 33 | + <ui:ListView |
| 34 | + MaxHeight="200" |
| 35 | + d:ItemsSource="{d:SampleData ItemCount=2}" |
35 | 36 | ItemsSource="{Binding ViewModel.BasicListViewItems, Mode=TwoWay}"
|
36 | 37 | SelectedIndex="2"
|
37 | 38 | SelectionMode="Single">
|
38 |
| - <ListView.ItemTemplate> |
| 39 | + <ui:ListView.ItemTemplate> |
39 | 40 | <DataTemplate DataType="{x:Type models:Person}">
|
40 | 41 | <TextBlock Margin="8,4" Text="{Binding Name, Mode=OneWay}" />
|
41 | 42 | </DataTemplate>
|
42 |
| - </ListView.ItemTemplate> |
43 |
| - </ListView> |
| 43 | + </ui:ListView.ItemTemplate> |
| 44 | + </ui:ListView> |
44 | 45 | </controls:ControlExample>
|
45 | 46 |
|
46 | 47 | <controls:ControlExample Margin="0,36,0,0" HeaderText="ListView with Selection Support.">
|
|
58 | 59 | <ColumnDefinition Width="*" />
|
59 | 60 | <ColumnDefinition Width="Auto" />
|
60 | 61 | </Grid.ColumnDefinitions>
|
61 |
| - <ListView |
| 62 | + <ui:ListView |
62 | 63 | Grid.Column="0"
|
63 |
| - Height="200" |
| 64 | + MaxHeight="200" |
| 65 | + d:ItemsSource="{d:SampleData ItemCount=2}" |
64 | 66 | ItemsSource="{Binding ViewModel.BasicListViewItems, Mode=TwoWay}"
|
65 | 67 | SelectedIndex="1"
|
66 | 68 | SelectionMode="{Binding ViewModel.ListViewSelectionMode, Mode=OneWay}">
|
67 |
| - <ListView.ItemTemplate> |
| 69 | + <ui:ListView.ItemTemplate> |
68 | 70 | <DataTemplate DataType="{x:Type models:Person}">
|
69 | 71 | <Grid Margin="8,0">
|
70 | 72 | <Grid.RowDefinitions>
|
|
98 | 100 | Text="{Binding Company, Mode=OneWay}" />
|
99 | 101 | </Grid>
|
100 | 102 | </DataTemplate>
|
101 |
| - </ListView.ItemTemplate> |
102 |
| - </ListView> |
| 103 | + </ui:ListView.ItemTemplate> |
| 104 | + </ui:ListView> |
103 | 105 | <StackPanel
|
104 | 106 | Grid.Column="1"
|
105 | 107 | MinWidth="120"
|
|
114 | 116 | </StackPanel>
|
115 | 117 | </Grid>
|
116 | 118 | </controls:ControlExample>
|
| 119 | + |
| 120 | + <controls:ControlExample Margin="0,36,0,0" HeaderText="ListView with GridView"> |
| 121 | + <controls:ControlExample.XamlCode> |
| 122 | + <ListView ItemsSource="{Binding ViewModel.BasicListViewItems}">\n |
| 123 | + \t<ListView.View>\n |
| 124 | + \t\t<GridView>\n |
| 125 | + \t\t\t<GridViewColumn DisplayMemberBinding="{Binding FirstName}" Header="First Name"/>\n |
| 126 | + \t\t\t<GridViewColumn DisplayMemberBinding="{Binding LastName}" Header="Last Name"/>\n |
| 127 | + \t\t\t<GridViewColumn DisplayMemberBinding="{Binding Company}" Header="Company"/>\n |
| 128 | + \t\t</GridView>\n |
| 129 | + \t</ListView.View>\n |
| 130 | + </ListView> |
| 131 | + </controls:ControlExample.XamlCode> |
| 132 | + <ui:ListView |
| 133 | + MaxHeight="200" |
| 134 | + d:ItemsSource="{d:SampleData ItemCount=3}" |
| 135 | + BorderThickness="0" |
| 136 | + ItemsSource="{Binding ViewModel.BasicListViewItems, Mode=TwoWay}"> |
| 137 | + <ui:ListView.View> |
| 138 | + <GridView> |
| 139 | + <GridViewColumn |
| 140 | + Width="100" |
| 141 | + DisplayMemberBinding="{Binding FirstName}" |
| 142 | + Header="First Name" /> |
| 143 | + <GridViewColumn |
| 144 | + Width="100" |
| 145 | + DisplayMemberBinding="{Binding LastName}" |
| 146 | + Header="Last Name" /> |
| 147 | + <GridViewColumn DisplayMemberBinding="{Binding Company}" Header="Company" /> |
| 148 | + </GridView> |
| 149 | + </ui:ListView.View> |
| 150 | + </ui:ListView> |
| 151 | + </controls:ControlExample> |
117 | 152 | </StackPanel>
|
118 | 153 | </Page>
|
0 commit comments