使用MVVM命令列表框静态项 [英] Commanding Listbox Static Items using MVVM

查看:68
本文介绍了使用MVVM命令列表框静态项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我是新手.开发Windows Phone.请根据以下内容提供帮助.

我在视图中有一个列表框,其中有三个静态items(Name,Age,Gender),当我选择ListBox中的一个项目时,我希望ViewModel做一些事情.我想要 使用MVVM模式,无需任何代码即可完成此操作.

Hey Guys,

I'm a newbie in  developing Windows phone. Please help based on the below.

I have a list box in my view with three static items(Name,Age,Gender), and I want my ViewModel to do something when an item in the ListBox is selected. I want to do this without any code-behind, using the MVVM pattern.

推荐答案

看看这个 http://msdn.microsoft.com/zh-cn/library/gg405492%28v=pandp.40%29.aspx   and http://stackoverflow.com/questions/451748/wpf-m-v-vm-get-selected-items-from-a-listcollectionview 适用于棱镜框架.

take a look at this http://msdn.microsoft.com/en-us/library/gg405492%28v=pandp.40%29.aspx and http://stackoverflow.com/questions/451748/wpf-m-v-vm-get-selected-items-from-a-listcollectionview for the Prism Framework.

这也可能有用:) http://hintdesk.com/mvvm-listview-selecteditem-and-databinding/

This one could be useful too :) http://hintdesk.com/mvvm-listview-selecteditem-and-databinding/


这篇关于使用MVVM命令列表框静态项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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