如果在调试期间发生绑定表达式错误,则会将错误记录到Visual Studio的"输出"窗口中.它看起来像这样:
System.Windows.Data Error: BindingExpression path error: 'User' property not found
on 'MainPageVM' 'MainPageVM' (HashCode=38694667). BindingExpression: Path='User.FullName'
DataItem='MainPageVM' (HashCode=38694667); target element is 'System.Windows.Controls.TextBlock'
Name=''); target property is 'Text' (type 'System.String')..
Run Code Online (Sandbox Code Playgroud)
有没有办法将此错误视为未处理的异常?如果发生绑定错误,我不希望我的Silverlight应用程序继续运行.