【发布时间】:2011-01-14 08:44:35
【问题描述】:
我有以下列表视图,但它不显示实际记录,而只显示对象的命名空间。我想知道是否需要在 XAML 中创建列以显示记录,然后将其绑定到对象的某些属性,或者这有什么问题?
<ListView
Name="ListCustomers"
ItemsSource="{Binding Path=ListOfCustomers}"
SelectedItem="{Binding Path=SelectedCustomer}"
SelectionMode="Single"
IsSynchronizedWithCurrentItem="True"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
MinHeight="100"
></ListView>
ListOfCustomers 是 ObservableCollection<Customer> 类型。实际客户确实会加载到 ObservableCollection 中,但不会显示。缺少什么?
【问题讨论】: