【发布时间】:2016-04-25 17:15:37
【问题描述】:
对不起,我的英语不好。我试图在列表视图的 itemsource 中绑定图像列表:
ItemsSource="{x:Bind ViewModel.Images,Mode=TwoWay}"
In ViewModel I have a list of Images :
public List<Image> Images
{
get { return _images; }
set
{
_images = value;
base.RaisePropertyChanged();
}
}
绑定模式设置为双向时,出现以下错误:
Invalid binding path 'View Model.Reports': You can not associate the type 'System.Collections.Generic.List (posytron.epart.uwp.Models.DOM.Report)' to 'System.Object' without a converter
如果我将绑定模式设置为 OneWay 就可以了!
我已经开发了一个转换器来将布尔值转换为可见性属性。
转换器应该包含什么?有人能帮我吗?为什么会出现这个错误?
谢谢!!
【问题讨论】:
-
请发布 ListView xaml 和模型类。没有它就很难给出解决方案
-
@LovetoCode +1,还有为什么你需要在 Listview 中使用 TwoWay?
标签: win-universal-app template10