【问题标题】:ListPicker, how to get the text from the selected item?ListPicker,如何从所选项目中获取文本?
【发布时间】:2013-12-08 17:36:48
【问题描述】:

如何从所选项目中获取文本?如何分配字符串文本 ListPicker 类型的变量?

<toolkit:ListPicker x:Name="EncodingList">
                    <toolkit:ListPickerItem HorizontalAlignment="Center" Content="UTF-8" />
                    <toolkit:ListPickerItem HorizontalAlignment="Center" Content="Windows-1251" />
        </toolkit:ListPicker>

【问题讨论】:

    标签: c# windows-phone-8


    【解决方案1】:

    如何从选中的项目中获取文本?

    最简单的方法是:

    var content = ((ListPickerItem)EncodingList.SelectedItem).Content;
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-06-22
      • 1970-01-01
      • 2013-05-31
      • 2014-11-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多