简体   繁体   English

WP7列表框绑定:更改图像uri不会反映在列表框中

[英]WP7 Listbox Binding: Changing image uri in does not reflect in listbox

I have a view with a list box, bound to am obvervable collection of DisplayItems, which has 'Label', 'DisplayValue' and 'IconUri' properties. 我有一个带有列表框的视图,该列表框绑定到DisplayItems的可收集集合,该集合具有'Label','DisplayValue'和'IconUri'属性。 I have a View Model which exposes this observable collection. 我有一个View模型,它公开了这个可观察的集合。 The List Box is correctly populated first time around. 第一次正确填充列表框。 I then have a button which takes action on the selected item. 然后,我有一个按钮,它将对所选项目执行操作。 I need to indicate that action has been taken by changing the image. 我需要指出已通过更改图像采取了措施。 I am changing the IconUri of the selected item, and can see the new value present when debugging, but the image doesn't change. 我正在更改所选项目的IconUri,并且可以在调试时看到新的值,但图像不会改变。 I can also change the 'Label' and 'DisplayValue' properties and see the new values correctly there when debugging, but the list doesn't change. 我还可以更改'Label'和'DisplayValue'属性,并在调试时在那里正确看到新值,但列表不会更改。 My ViewModel implements INotifyPropertyChanged. 我的ViewModel实现了INotifyPropertyChanged。 My DisplayItem class implements INotifyPropertyChanged. 我的DisplayItem类实现INotifyPropertyChanged。 I'm calling RaisePropertyChanged I'm sure in too many places rather than too few. 我肯定会在很多地方而不是太少的地方打电话给RaisePropertyChanged。 None of the changes are ever reflected on screen. 任何更改都不会反映在屏幕上。

I'm using a DataItemTemplate for the generated rows. 我正在为生成的行使用DataItemTemplate。 If I could access the image of the selected row I could change it manually, but I can't even do that. 如果我可以访问所选行的图像,则可以手动更改它,但是我什至不能这样做。

Any help greatly appreciated. 任何帮助,不胜感激。 I could actually do with a example of a list box displaying items from a bound observable collection, where one property of the selected item is changed and that change is reflected in the list box. 我实际上可以用一个列表框示例显示一个绑定的可观察集合中的项目,其中所选项目的一个属性已更改,并且该更改反映在列表框中。

Thanks in advance A 在此先感谢

您没有正确实现INotifyPropertyChanged ,或者您使用的是错误的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM