Silverlight内存泄漏 [英] silverlight memory leak
本文介绍了Silverlight内存泄漏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用以下代码创建通过回调方法更改的DependencyProperty:
i was creating a DependencyProperty Changed with a callback method using the following code:
public void RegisterForNotification(string propertyName, FrameworkElement element, PropertyChangedCallback callback)
{
Binding b = new Binding(propertyName) { Source = element };
var prop = System.Windows.DependencyProperty.RegisterAttached(
"ListenAttached" + propertyName,
typeof(object),
typeof(UserControl),
new System.Windows.PropertyMetadata(callback));
element.SetBinding(prop, b);
}
回调方法导致应用程序内存泄漏,如何注销该回调方法?
The callback method caused a memory leak in my application, how can i unregister this callback method?
thanks in advance.
推荐答案
看看这篇文章
这篇关于Silverlight内存泄漏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文