如何从所选项目中获取文字?如何分配字符串文本ListPicker的变量?
<toolkit:ListPicker x:Name="EncodingList">
<toolkit:ListPickerItem HorizontalAlignment="Center" Content="UTF-8" />
<toolkit:ListPickerItem HorizontalAlignment="Center" Content="Windows-1251" />
</toolkit:ListPicker>
答案 0 :(得分:3)
如何从所选项目中获取文字?
最简单的方法是:
var content = ((ListPickerItem)EncodingList.SelectedItem).Content;