ben*_*lim 1 c# windows-phone-7
我正在尝试获取列表框中所选项目的文本.但我应该是"System.Windows.Controls.ListBoxItem"的结果
我的代码:listBox.SelectedItem.ToString();
我应该如何更改我的代码?
试试这个
if(null != listBox.SelectedItem)
{
string text = (listBox.SelectedItem as ListBoxItem).Content.ToString();
}
Run Code Online (Sandbox Code Playgroud)