我们如何在Silverlight4.0中的不同页面之间传递值 [英] How we can pass value between diffrent pages in silverlight4.0

查看:72
本文介绍了我们如何在Silverlight4.0中的不同页面之间传递值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两页,第一页有一个datagrid控件,并且有一些值.我想通过单击按钮将带有值的datagrid控件显示到下一页.....

I have two pages, first page is having a datagrid control and have some values. I want to display that datagrid control with values into the next page by the click of a button.....

推荐答案

0)您可以创建一个指向的委托转到第1页中的方法,然后由第2页调用.连接到委托的方法实际上可以返回绑定到页面#1中的数据网格的集合.

1)您可以使datagrid成为应用程序的全局对象,以便Silverlight中的任何组件都可以绑定到它(或检索其中的数据).

2)这是您在几分钟内提出的第三个易于研究的问题,没有明显的迹象表明您实际上已经尝试过自己解决这些问题,因此得出了我的最终建议-您可以寻找另一个因为您比一袋锤子还要笨,所以会被占领.
0) You could create a delegate that points to a method in page #1 and that is called by page #2. the method connected to the delegate could actually return the collection that''s bound to the datagrid in page #1.

1) You could make the datagrid global to the application so that any component in your silverlight could be bound to it (or retrieve the data in it).

2) This is the third easily researchable question you''ve asked in a matter of minutes with no obvious indication that you''ve actually tried to work these answers out yourself, so that leads to my final suggestion - you could look for another occupation because you''re dumber than a bag of hammers.


如果您使用的是Microsoft Prism之类的工具应用程序块,则实际上可以使用事件聚合器在视图之间传递值-推荐的方法但是,使用事件聚合器是在不同模块内的视图之间而不是同一模块内的不同视图之间使用它们.
If you are using a tool application block like Microsoft Prism you could actually use event aggregators to pass values across views - the recommended approach, however, to use event aggregators is to use them across views within different modules rather than different views within the same module.


这篇关于我们如何在Silverlight4.0中的不同页面之间传递值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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