7
Kişiler sık sık aşağıdaki gibi bir şey kullanır:WPF'de bütün bir nesneyi bir kullanıcı denetimine bağlama nasıl?
<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>
Ama etiketler yerine bir kontrol kullanmak istiyorum, şöyle:
<ListBox ItemsSource="{Binding ElementName=thisControl, Path=ListIndexes}">
<ListBox.ItemTemplate>
<DataTemplate>
<local:Index Item="**{Binding}**"/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
Şüpheye yer vermek için bu Binding içine koymak ne koleksiyondan tüm öğe.