列表框包含图像,分配给列表框的对象具有相应的wmv文件路径。如何通过{binding}将所选路径绑定到mediaelement。
格塔。
答案 0 :(得分:0)
您可以使用ElementName将绑定源设置为列表框,然后绑定到SelectedItem的属性:
<ListBox Name="imageListBox" ... />
<MediaElement Source="{Binding ElementName=imageListBox, Path=SelectedItem.WmvPath}"/>