6
我显示了所有我的顾客,我从一个ViewModel ObservableCollectoin财产得到一个ComboBox内像这样的:如何从XAML获取ObservableCollection中的项目数量?
<ComboBox
ItemsSource="{Binding Customers}"
ItemTemplate="{StaticResource CustomerComboBoxTemplate}"
Margin="20"
HorizontalAlignment="Left"
SelectedItem="{Binding SelectedCustomer, Mode=TwoWay}"/>
有没有办法让在的ObservableCollection 项目的数量,而不创建其他视图模型属性,例如是这样的:
伪代码:
<TextBlock Text="{Binding Customers.Count()}"/>
确定它只是这样的: ,并且它似乎在ObservableCollection更改时不断更新,很好。 –
2009-06-18 13:02:12