如何从另一个视图UI引用一个视图UI [英] How to referesh one view UI from other view UI

查看:149
本文介绍了如何从另一个视图UI引用一个视图UI的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个名为UserView和RoleView的视图.

UserView.xaml包含RadGridView,其中包含三列
用户ID (标签)| 用户名(标签)| 角色(下拉).

RoleView.xaml包含一个TextBox,可在其中将Roles添加到数据库中.
角色(文本框).

步骤1.现在,我首先打开UserView.xaml,它将显示数据库中具有适当角色的记录.
第2步.现在,我打开新页面RoleView.xaml(最小化UserView.xaml).
第3步.我添加了一个角色. (AdminRole)
第4步.现在,我打开UserView.xaml(它已经在内存中,所以我导航到此页面)

第5步.现在,我双击带有角色"的任何行(下拉"列),它将进入编辑模式并填充角色列表.

,但不会在下拉列表中显示最近添加的角色(AdminRole).因为数据源不会刷新.

如果我要关闭UserView.xaml并重新打开此页面,则它将在下拉列表中显示最近添加的角色(AdminRole).

注意:
我的要求是,一旦从任何地方进行任何更改,我都必须更新或通知所有打开的视图.

我正在使用Silverlight 4(MVVM)PRISM telerik RadGridView

您的帮助/意见/建议将不胜感激!

谢谢,
Imdadhusen

I have two Views called UserView and RoleView.

UserView.xaml contains RadGridView which contain three columns
UserID (Label) | UserName (Label)| Role (Dropdown).

RoleView.xaml contains one TextBox where i can add Roles into database.
Role (Textbox).

Step 1. Now first i open the UserView.xaml and it will display records from database with appropriate roles.
Step 2. Now i open new page RoleView.xaml (minimize UserView.xaml).
Step 3. I have added one role. (AdminRole)
Step 4. Now i open UserView.xaml (it is already in memory, so just i navigate to this page)

Step 5. Now i double click to any of the row with Role (Dropdown column) it will comes into edit mode and populate list of roles.

but it will not display recently added role (AdminRole) in dropdown. because of the data source will not getting refresh.

If i am closing the UserView.xaml and reopen this page then it will display recently added role (AdminRole) in dropdown.

Note:
my requirement is like, i have to update or notify all opened views once any of the change from anywhere.

I am using Silverlight 4 (MVVM) PRISM telerik RadGridView

Your help/comment/suggestion would be highly appreciated!

Thanks,
Imdadhusen

推荐答案

这取决于您的Model实现,但通常此类通知是通过INotifyCollectionChanged事件接收的. 如果您的模型尚未实现,则可以考虑在ViewModel中实现此接口.
It depends on your Model implementation but in general such notifications are received via INotifyCollectionChanged events.
You may consider implementing this interface in your ViewModel if your Model does not implement it already.


这篇关于如何从另一个视图UI引用一个视图UI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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