我试图将数据输入<代码>。 清单: 控制:
<ListView Margin="8" Height="400" Width="650"
ItemsSource="{Binding Path=MyData}">
<ListView.View>
<GridView>
<GridViewColumn Header="ID" Width="Auto"
DisplayMemberBinding="Binding Path=ID}" >
</GridViewColumn>
<GridViewColumn DisplayMemberBinding="{Binding Path=Name}"
Header="Name" Width="100"/>
<GridViewColumn DisplayMemberBinding="{Binding Path=Price}"
Header="Price" Width="100"/>
<GridViewColumn DisplayMemberBinding="{Binding Path=Author}"
Header="Author" Width="100"/>
<GridViewColumn DisplayMemberBinding="{Binding Path=Catalog}"
Header="Catalog" Width="100"/>
</GridView>
</ListView.View>
</ListView>
ObservableCollection<TableInfo> _MyData
public ObservableCollection<TableInfo> MyData{ get; set; }
但是,它没有在窗户中展示任何东西,但<代码>MyData为。 ObservableCollection
。 我如何约束数据?