我正在尝试调试MVVM程序(基于Josh Smith )中的一些数据库/性能问题。有很多不同列表和对象的并发加载,所以我一直在使用isAsync和一些线程来提高性能和网络瓶颈。
但是,我注意到很多消息是从ItemsSource绑定输出到回退值上的。对于命令,我创建了一个哑命令,它禁用命令,在大多数情况下,我可以绑定到已知的回退基元类型。当我将ItemsSource的回退绑定到{x:Null}时,问题似乎就出现了。
注意:这发生在许多地方,而不仅仅是chartingToolkit控件。
A first chance exception of type 'System.NotSupportedException' occurred in PresentationFramework.dll
A first chance exception of type 'System.Xaml.XamlObjectWriterException' occurred in System.Xaml.dll
System.Windows.Data Information: 41 : BindingExpression path error: 'LineValueList' property not found for 'object' because data item is null. This could happen because the data provider has not produced any data yet. BindingExpression:Path=LineValueList; DataItem=null; target element is 'LineSeries' (Name=''); target property is 'ItemsSource' (type 'IEnumerable')
System.Windows.Data Information: 20 : BindingExpression cannot retrieve value due to missing information. BindingExpression:Path=LineValueList; DataItem=null; target element is 'LineSeries' (Name=''); target property is 'ItemsSource' (type 'IEnumerable')
System.Windows.Data Information: 21 : BindingExpression cannot retrieve value from null data item. This could happen when binding is detached or when binding to a Nullable type that has no value. BindingExpression:Path=LineValueList; DataItem=null; target element is 'LineSeries' (Name=''); target property is 'ItemsSource' (type 'IEnumerable')<chartingToolkit:LineSeries DependentValuePath="Value" IndependentValuePath="Key" ItemsSource="{Binding Path=LineValueList,IsAsync=True,FallbackValue={x:Null}}">我有以下问题:
提前谢谢。
发布于 2012-11-08 16:19:06
在加载真实源时,可以使用PriorityBinding绑定到虚拟数据源。我希望这能帮到你。
https://stackoverflow.com/questions/13282175
复制相似问题