Windows Phone 8 C中的Listbox SubItem# [英] Listbox SubItem in Windows Phone 8 C#
问题描述
我需要一些关于如何在Windows Phone开发中提取Listbox控件子项的小帮助。
I needed a small help on how to extract subitems of Listbox control in windows phone development.
我已经在.cs文件中编写了一个用于绑定列表框中数据的代码
I have written a code for binding data in listbox in .cs file
  ;      
列表 < MyImageData >
ds = new 列表 < MyImageData >() ;
List<MyImageData> ds = newList<MyImageData>();
&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP; ds.Add(
ds.Add(
new MyImageData ()
{MyI_Uri = " Images / Pic1。 png" ,
MyText = "关闭" 跨度> 跨度> 跨度> });
newMyImageData() { MyI_Uri = "Images/Pic1.png", MyText = "CLose"});
ds.Add(
ds.Add(
new MyImageData ()
{MyI_Uri = " Images / Pic2。 png" ,
MyText = "擦除" 跨度> 跨度> });
newMyImageData() { MyI_Uri = "Images/Pic2.png", MyText = "Erase"});
ds.Add(
ds.Add(
new MyImageData ()
{MyI_Uri = " Images / Pic3。 png" ,
MyText = " MyLogo" 跨度> 温泉n> });
newMyImageData() { MyI_Uri = "Images/Pic3.png", MyText = "MyLogo"});
&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;
此 。Mylist.ItemsSource = ds;
this.Mylist.ItemsSource = ds;
现在如何在ListBox的选择更改属性中提取MyText项。
Now how can I be able to extract the MyText Item in the selection changed property of the ListBox.
Sumit Tuladhar
Sumit Tuladhar
推荐答案
所选项目将返回您的MyImageData模型。
The selected item will return you your MyImageData model.
这篇关于Windows Phone 8 C中的Listbox SubItem#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!