带有wp8 sdk的System.Windows.Markup.XamlParseException

时间:2014-01-23 17:13:13

标签: c# xaml exception windows-phone-8

我刚刚开始开发wp8应用程序(没有以前的经验)。刚刚开始:

http://channel9.msdn.com/Series/Windows-Phone-8-Development-for-Absolute-Beginners/Part-3-Writing-your-First-Windows-Phone-8-App

完全如图所示,并得到了这个:

“System.Windows.ni.dll中出现'System.Windows.Markup.XamlParseException'类型的第一次机会异常 如果存在此异常的处理程序,则可以安全地继续该程序。“

代码:

(带有foll。添加的默认代码):

private void PlayAudioButton_Click_1 (object sender, RoutedEventArgs e)
    {
        QuackMediaElement.Play();
    }

并使用foll默认xaml。补充:

<Button Name="PlayAudioButton"
                Width="200"
                Height="200 "
                HorizontalAlignment="Left" 
                VerticalAlignment="Top"
                Background="Crimson"
                Click="PlayAudioButton_Click_1"
                >
            Quack

        </Button>

        <MediaElement x:Name="QuackMediaElement"
                      Source="/Assets/quack.mp3 "
                      Volume=" 1"
                      AutoPlay="False" 
                      />

它有什么用?

感谢名单

1 个答案:

答案 0 :(得分:1)

由于

,可能会发生异常
Source="/Assets/quack.mp3 "
Volume=" 1" 

而不是

Source="/Assets/quack.mp3"    
Volume="1"