首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >用于IEnumerable异步的虚拟IEnumerable

用于IEnumerable异步的虚拟IEnumerable
EN

Stack Overflow用户
提问于 2012-11-08 03:57:01
回答 1查看 887关注 0票数 1

我正在尝试调试MVVM程序(基于Josh Smith )中的一些数据库/性能问题。有很多不同列表和对象的并发加载,所以我一直在使用isAsync和一些线程来提高性能和网络瓶颈。

但是,我注意到很多消息是从ItemsSource绑定输出到回退值上的。对于命令,我创建了一个哑命令,它禁用命令,在大多数情况下,我可以绑定到已知的回退基元类型。当我将ItemsSource的回退绑定到{x:Null}时,问题似乎就出现了。

注意:这发生在许多地方,而不仅仅是chartingToolkit控件。

代码语言:javascript
复制
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')
代码语言:javascript
复制
<chartingToolkit:LineSeries DependentValuePath="Value" IndependentValuePath="Key" ItemsSource="{Binding Path=LineValueList,IsAsync=True,FallbackValue={x:Null}}">

我有以下问题:

  1. 这些信息令人担忧吗?我的很多终端用户都有老机器(并且拒绝升级--),所以我一直在努力最大限度地提高性能。
  2. 创建虚拟基类型并从App.xaml引用它们安全吗?
  3. 我把这些清单中的大多数都列出来了,是因为这个原因吗?

提前谢谢。

EN

回答 1

Stack Overflow用户

发布于 2012-11-08 16:19:06

在加载真实源时,可以使用PriorityBinding绑定到虚拟数据源。我希望这能帮到你。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/13282175

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档