【发布时间】:2011-10-07 20:00:08
【问题描述】:
我正在尝试制作要在 Silverlight MediaElement 中播放的 WMV 视频。它适用于此 XAML 代码:
<MediaElement
x:Name="VideoElement"
Stretch="Fill"
Source=""http://ecn.channel9.msdn.com/o9/pdc09/wmv/CL20.wmv""
Grid.Row="0"
Grid.Column="0"
AutoPlay="True"/>
但是当我尝试将源绑定到我的代码中的某些属性时:
<MediaElement
x:Name="VideoElement"
Stretch="Fill"
Source="{Binding VidPath}"
Grid.Row="0"
Grid.Column="0"
AutoPlay="True"/>
VidPath 在哪里:
public Uri VidPath
{
get
{
return new Uri("http://ecn.channel9.msdn.com/o9/pdc09/wmv/CL20.wmv", UriKind.Absolute);
}
set;
}
它不起作用。你能帮我找出原因吗?
【问题讨论】:
标签: silverlight xaml binding