我刚才在你的
other question here
.
我从你的代码中看到
SelectedItem
似乎是个问题。
自从你
Picker
的
ItemsSource
(TestList属性)的类型为
List<Performance>
选择项目
采摘器
必须是类型
Performance
string
而不是
.
这个
ItemDisplayBinding
性能
对象,该对象在您的情况下是可以的,因为您有一个名为
ShortDesc
在你的内心
性能
上课。
肖德斯克
如下所示,并分配收藏中的任何一项
TestList
为了它。你的代码将开始正常工作。
private Performance _shortDesc;
public Performance ShortDesc
{
get { return _shortDesc; }
set
{
{
_shortDesc = value;
NotifyPropertyChanged();
}
}
}
documentation here
这解释了将对象绑定到Picker的明确示例。