Make the binding use Items
This commit is contained in:
entvex 2021-05-16 18:29:32 +02:00 коммит произвёл GitHub
Родитель 8a721a9f74
Коммит 6fd6da6e27
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -37,7 +37,7 @@ This will generate a DataGrid with column header names. FirstName and LastName.
x:Class="AvaloniaAppTemplate.MainWindow"
Title="AvaloniaAppTemplate">
<Grid>
<DataGrid Name="MyDataGrid" ItemsSource="{Binding People}" >
<DataGrid Name="MyDataGrid" Items="{Binding People}" >
</DataGrid>
</Grid>
</Window>
@ -64,7 +64,7 @@ The DataGrid uses the same class Person as before, but now with custom column he
x:Class="AvaloniaAppTemplate.MainWindow"
Title="AvaloniaAppTemplate">
<Grid>
<DataGrid Name="MyDataGrid" ItemsSource="{Binding People}" AutoGenerateColumns="False" >
<DataGrid Name="MyDataGrid" Items="{Binding People}" AutoGenerateColumns="False" >
<DataGrid.Columns>
<DataGridTextColumn Header="Forename" Binding="{Binding FirstName}"/>
<DataGridTextColumn Header="Surname" Binding="{Binding LastName}" />
@ -82,4 +82,4 @@ The DataGrid uses the same class Person as before, but now with custom column he
| `Items` | Gets or sets a collection that is used to generate the content of the control. |
| `CanUserReorderColumns` |Indicates whether the user can change the column display order by dragging column headers with the mouse. |
| `CanUserResizeColumns` | Indicates whether the user can adjust column widths using the mouse. |
| `CanUserSortColumns` | Indicates whether the user can sort columns by clicking the column header. |
| `CanUserSortColumns` | Indicates whether the user can sort columns by clicking the column header. |