简体   繁体   English

在后面的代码中为图像设置NotifyOnSourceUpdate

[英]Set NotifyOnSourceUpdate for Image in code behind

Is it possible to set NotifyOnSourceUpdate property in code behind for Image in WPF ? 是否可以在WPF Image后面的代码中设置NotifyOnSourceUpdate属性? I need to do this in code behind. 我需要在后面的代码中执行此操作。 I can't use: MSDN 我不能使用: MSDN

If the Binding has already been set in Xaml or code you cannot change the Binding properties, but you can just create and assign a new binding to your Image 如果Binding已在设定Xaml或代码,你不能改变的结合特性,但你可以创建并分配一个新的绑定到你的Image

 Binding binding = new Binding("MyImageProperty") { NotifyOnSourceUpdated = true };
 image.SetBinding(Image.SourceProperty, binding);

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

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