Enumerator中的ObservableCollection [英] ObservableCollection in Enumerator

查看:89
本文介绍了Enumerator中的ObservableCollection的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,


我有创建可枚举对象的视图模型,在该对象中我有observableCollection对象。所以我使用可枚举对象作为itemsSource来报告。我正在使用ItemsSource.MoveNext()方法并获取当前项目。
如何从当前项访问observableCollection并通过它进行枚举?这是一个例子:


Report.ItemsSource = DataVal;


另一种形式:


而(ItemsSource.MoveNext())


{


}


// DataVal是enumertor,它有多个int和string字段,然后它还有一个可观察的集合。


如何访问observable collection字段并通过它进行迭代。


谢谢。

解决方案

在While循环中,当前项目是


ItemsSource.Current


如果你向我们展示一些实际的代码,我们可以告诉你你需要的代码,但它会像


foreach(itemsSource.Current.TheObservableCollectionInsideThisObject中的var项目){\\做你的东西}


Hello,

I have view model that is creating an enumerable object and in that object i have observableCollection object. So i am using the enumerable object as itemsSource to a report. I am using ItemsSource.MoveNext() method and getting the current item. How can i access the observableCollection from the current item and enumerate thru it? Here is an example:

Report.ItemsSource = DataVal;

In another form:

While(ItemsSource.MoveNext())

{

}

//DataVal is the enumertor and it has number of int and string fields and then it also has an observable collection.

How do i access the observable collection field and iterate thru it.

Thanks.

解决方案

Inside the While loop the current item is

ItemsSource.Current

If you show us some actual code we can tell you the code that you need but it will be something like

foreach (var item in ItemsSource.Current.TheObservableCollectionInsideThisObject) { \\ Do your stuff}


这篇关于Enumerator中的ObservableCollection的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆