0
我正在写我自己的UserControl,它在ListBox中显示数据。我想实现类似于“DisplayMemberPath”之类的属性。在我的例子中,它是“EditableMemberPath”,它应该确定哪个成员将显示在文本框中。但是,在绑定上使用绑定不起作用。我该如何实现一个绑定路径,该绑定路径被另一个绑定绑定?
<ListBox ItemsSource="{Binding Path=Items, ElementName=me}"
SelectedItem="{Binding Path=SelectedItem, ElementName=me}">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel>
<Image Source="{Binding Converter={Binding Path=ItemToImageConverter, ElementName=me}}" />
<TextBlock Text="{Binding Path={Binding Path=EditableMemberPath, ElementName=me}}" />
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
你能帮我找到一个合适的解决方案吗?
问候
奥利弗Hanappi
我已经张贴在这里回答了这个问题代码:http://stackoverflow.com/questions/777991/how-do-i-bind -the结合路径属性到底层数据/ 778146#778146 – 2009-08-21 11:21:00