BitmapImage-> SetSource不更新Binding [英] BitmapImage->SetSource doesn't update Binding

查看:49
本文介绍了BitmapImage-> SetSource不更新Binding的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有自定义ItemTemplate的ListView。在模板中,我有带有绑定的Image对象:
$
< Image Source =" {Binding AlbumArt}"余量= QUOT; 0" Stretch =" Uniform" />


接下来在app中我将ItemsSource设置为Object ^的向量^:

ctrlListView- > ItemsSource = m_items; (m_items是IVector< Object ^> ^)


在这个向量中我有我的TItem对象 其中我还有BitmapImage和任何其他字段(String ^)。当项目已经在m_items中(并且在ListView中可见)时,更新到BitmapImage不会更新ListView。如果
我会更改数据中的任何内容(它不会自动生效),我如何刷新ListView?

解决方案
&NBSP;

Hello,


 


请您提供重现的完整代码这个问题,


 


您可以将项目上传到skydriver


http://skydrive.live.com/


 


It您没有必要发送整个项目。我们只需要一个最简单的样本来重现问题。您可以从中删除任何机密信息或业务详细信息。


 


祝你好运,


Jesse


I have a ListView with custom ItemTemplate. In the template i have Image object with Binding :
<Image Source="{Binding AlbumArt}" Margin="0" Stretch="Uniform"/>

Next in app i set ItemsSource to vector of Object^:
ctrlListView->ItemsSource = m_items; (m_items is IVector<Object^>^ )

In this vector i have my TItem objects where i have also BitmapImage and any other fields (String^). When items are already in m_items (and visible in ListView), then update to BitmapImage doesn't update ListView. How can i make ListView refreshed when i'll change anything in data (it does not work automatically) ?

解决方案

 

Hello,

 

Would you please provide us the whole codes to reproduce this issue,

 

You can upload your project to skydriver

http://skydrive.live.com/

 

It is not necessary that you send out the whole of your project. We just need a simplest sample to reproduce the problem. You can remove any confidential information or business details from it.

 

Best regards,

Jesse


这篇关于BitmapImage-&gt; SetSource不更新Binding的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆