我用 c# 为 windows 8 开发了一个游戏指南应用程序。我试图将 2 个 youtube 视频放在游戏的特定章节中,我想通过一个按钮更改 Webview 的 Uri。当未按下按钮时,将显示第一个视频 uri,当按下按钮时,将显示第二个视频。我怎样才能做到这一点?例如:
private void Chapters_SelectionChanged(object sender, Windows.UI.Xaml.Controls.SelectionChangedEventArgs e)
{
switch (Chapters.SelectedIndex)
{
case 0:
Chapter2C.Visibility = Visibility.Visible;
Chapter2T.Visibility = Visibility.Visible;
next_but.Visibility = Visibility.Visible;
prev_but.Visibility = Visibility.Visible;
Mywebview.Visibility = Visibility.Visible;
if (next_button.Clicked)
{
Mywebview.Source = new Uri("http://www.youtube.com/embed/F65paVQ0wn8?feature=player_detailpage")
}
else
{
Mywebview.Source = new Uri ("http://www.youtube.com/embed/rLdrc7K5vdw");
}
break;
}
}
任何人??