如何将元素添加到PagedCollectionView的源 [英] How to Add an element to the source of a PagedCollectionView

查看:52
本文介绍了如何将元素添加到PagedCollectionView的源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的Silverlight-4-App中,我有一个PagedCollectionView.最终,我想在其来源中添加一个新项目.不幸的是,我找不到如何执行此操作的示例.

in my Silverlight-4-App, I have a PagedCollectionView. Eventually, I want to add a new item to it's source. Unfortunately, I find no example how to do this.

AddNew()方法没有参数.

The AddNew() methode excepts no parameter.

CurrentAddItem是只读的.

The CurrentAddItem is readonly.

SourceCollection是IEnumerable<>.

The SourceCollection is a IEnumerable<>.

我没有想到,像添加元素到集合这样的简单,标准的任务可能会如此复杂.我没有找到任何如何执行此操作的示例.谁能给我一个例子,如何向PagedCollectionView中添加元素?

I didn't think, that such a simple, standard task like adding an element to a collection could be so complicated. I didn't find any examples how to do this. Can anyone give me an example, how to add an element to a PagedCollectionView?

在此先感谢,
弗兰克

Thanks in advance,
Frank

推荐答案

MyObject newO = (MyObject)_PagedList.AddNew(); 
newO.SetProperty="Make the changes to the object";
_PagedList.CommitNew(); 

这篇关于如何将元素添加到PagedCollectionView的源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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