【发布时间】:2013-09-11 07:33:27
【问题描述】:
我的 Windows Phone 应用程序的 xaml 页面中有一个列表框。
列表框的 itemsource 设置为来自服务器的数据。
我需要根据从服务器接收到的数据来设置这个列表框内的文本块/按钮的文本。
我不能直接绑定数据,也不能更改来自服务器的数据。
我需要做这样的事情:-
if (Data from server == "Hey this is free")
{ Set textblock/button text to free }
else
{ Set textblock/button text to Not Free/Buy }
来自服务器的数据(对于这个特定元素)可以有超过 2-3 种类型,例如它可以是 $5、$10、$15、Free 或其他任何东西
所以只有在免费的情况下,我需要将文本设置为免费,否则将其设置为非免费/购买。
如何访问列表框中的这个文本块/按钮?
【问题讨论】:
标签: c# xaml windows-phone-7 windows-phone-8 listbox