如何在silverlight中使用mvvm模式 [英] how to use mvvm pattern in silverlight

查看:152
本文介绍了如何在silverlight中使用mvvm模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是MVVM的新手。我创建了一个silverlight应用程序..我创建了dataservice na branchMaster视图...我在该视图中有一个数据网格。我想用来自branchMaster table.n的记录填充数据网格。也做插入,更新n删除功能..我有一个显示按钮,更新按钮n删除按钮,文本框(即Cmpy_cd,输入branchname,n等)..在显示点击我必须填写网格与记录branchMaster table..how我能得到它...我一直在阅读它...但是发现很难实现... plz做帮助...

解决方案

< blockquote>看看以下链接开头:



MVVM Silverlight 4.0 Simplified [ ^ ]

Silverlight MVVM应用程序的数据和命令绑定 [ ^ ]

WPF / Silverlight:MVVM循序渐进指南 [ ^ ]


要遵循的步骤。



1.使用List绑定数据网格。

2.更新更新/保存/删除列表

3.使用UpdateSourceTrigger(推荐)在网格中引用List的值或与Item Source绑定。



享受MVVM:)


I am new to MVVM..I m creating a silverlight application ..i have created dataservice n a branchMaster view...i have a datagrid in that view.i want to populate the datagrid with the records from branchMaster table.n also do insert,update n delete function on it..i have a show button ,update button n delete button,textboxes (i.e Cmpy_cd,Enter branchname,n so on)..on show click i have to fill the grid with records in branchMaster table..how do i achive it...i have been reading about it..but finding it difficult to implement...plz do help...

解决方案

Have a look at below links for starters:

MVVM Silverlight 4.0 Simplified[^]
Data and Command Bindings for Silverlight MVVM Applications[^]
WPF/Silverlight: Step By Step Guide to MVVM[^]


Steps to be followed.

1.Bind the datagrid with a List.
2.Update the list on Update/Save/Delete
3.Use UpdateSourceTrigger(Recomended) to referesh the value of the List in Grid or bind with Item Source.

Enjoy MVVM :)


这篇关于如何在silverlight中使用mvvm模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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