0

列表框包含图像,分配给列表框的对象具有相应的 wmv 文件路径。如何通过 {binding} 将所选路径绑定到媒体元素。

吉萨。

4

1 回答 1

0

可以使用 ElementName 设置绑定源到列表框,然后绑定到 SelectedItem 的一个属性:

<ListBox Name="imageListBox" ... />
<MediaElement Source="{Binding ElementName=imageListBox, Path=SelectedItem.WmvPath}"/>
于 2010-07-05T13:39:52.657 回答