【发布时间】:2010-09-27 18:25:43
【问题描述】:
我的 WPF 项目中的窗口上有一个图像控件
XAML:
<Image
Source="{Binding NotifyOnSourceUpdated=True, NotifyOnTargetUpdated=True}"
Binding.SourceUpdated="bgMovie_SourceUpdated"
Binding.TargetUpdated="bgMovie_TargetUpdated" />
在代码中我正在更改图像的来源
C#:
myImage = new BitmapImage();
myImage.BeginInit();
myImage.UriSource = new Uri(path);
myImage.EndInit();
this.bgMovie.Source = myImage;
但从未触发 bgMovie_SourceUpdated 事件。
谁能解释我做错了什么?
【问题讨论】:
-
protip:去掉废话,把所有东西都放在屏幕上,以增加有人回答你问题的可能性!