0
Wenn ich eine ListBox
habe und es an MyObject.MyCollection
gebunden ist, wie kann ich auch MyObject.MyValue
bekommen?Binding Eigenschaften außerhalb ListBox Sammlung
<ListBox ItemsSource="{Binding Path=MyObject.MyCollection}">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel>
<TextBlock Text="{Binding Path=Name}"/>
<TextBlock Text="{Binding Path=MyObject.MyValue}"/>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
public class MyObject {
public ObservableCollection<CollectionThing> MyCollection {get; set;}
public string MyValue {get; set;}
}