7
dân sử dụng thường xuyên một cái gì đó như:Làm thế nào để ràng buộc trong WPF một đối tượng toàn bộ để kiểm soát người dùng?
<ListBox ItemsSource="{Binding ElementName=thisControl, Path=ListIndexes}">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel>
<Label Content="{Binding Path=IndexName}"/>
<Label Content="{Binding Path=IndexValue}"/>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
Nhưng tôi muốn sử dụng, thay vì nhãn, một điều khiển, như thế này:
<ListBox ItemsSource="{Binding ElementName=thisControl, Path=ListIndexes}">
<ListBox.ItemTemplate>
<DataTemplate>
<local:Index Item="**{Binding}**"/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
nghi ngờ của tôi là những gì để đưa vào Binding này bao gồm toàn bộ mục từ bộ sưu tập.