如何在windows phone winrt的listview的每个子项按钮中设置属性isEnabled? [英] How to set property isEnabled in each subitem button of listview in windows phone winrt?

查看:22
本文介绍了如何在windows phone winrt的listview的每个子项按钮中设置属性isEnabled?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有列表视图.在这个列表视图中,我有包含按钮的 listview.item.我将我的列表视图绑定到某个数据源,所以我有很多按钮.如何禁用所有这些按钮?

I have listview. In this listview I have listview.item that contains button. I bind my listview to some datasource, so I have many buttons. How to disable all of this buttons?

http://pastebin.com/6MFDfX9S

推荐答案

查看您的代码,除了绑定到Title"、Date"、DownloadedOrNot"和Info"之外,您还可以添加另一个属性并将其绑定到按钮的 IsEnable 属性,如IsEnable.

Looking at your code, besides binding to "Title", "Date", "DownloadedOrNot" and "Info" you can add another property and bind that to the IsEnable property of the buttons, like "IsEnable.

如果你需要改变这个属性的值,你可以像这样遍历你的 ListView 项:

If you need to change the value of this property you can always traverse your ListView Items like this:

foreach (var item in listview.Items)
{
    (item as your_object).IsEnable = false;
}

这篇关于如何在windows phone winrt的listview的每个子项按钮中设置属性isEnabled?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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