HeaderedContentControl的内容设置过程会增加内存使用率(内存泄漏) [英] HeaderedContentControl's content setting process increases memory usage (Memory Leak)

查看:75
本文介绍了HeaderedContentControl的内容设置过程会增加内存使用率(内存泄漏)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



HeaderedContentControl的内容设置过程会增加内存使用率(内存泄漏)

我在WPF应用程序中使用HeaderedContentControl control.

并且我已经绑定了内容属性以使用数据绑定来查看模型属性.

Hi,

HeaderedContentControl''s content setting process increases memory usage (Memory Leak)

I am using HeaderedContentControl control in my WPF application.

and I have bound content property to view model property using Data binding.

<HeaderedContentControl HorizontalContentAlignment="Center" FocusVisualStyle="{x:Null}"  Margin="20" Grid.Row="1" Grid.Column="0" Content="{Binding Path=CurrentPage}" />



每次在其中加载页面时,都会增加内存大小.

我想知道,这里发生了什么.为什么每次我在其中加载页面时都会增加内存大小.

在此先感谢:)



Everytime it loads page in it, increases memory size.

I would like to know, what''s happening here. Why it increases memory size everytime I load a page in it.

Thanks in advance :)

推荐答案

没有看到您的代码,很难说,但是我怀疑问题可能出在事件处理程序泄漏(它们是是.NET中最常见的泄漏原因).离开页面之前,请确保取消分配已分配的所有事件处理程序.
Without seeing your code, it''s difficult to say, but I have a suspicion that the problem is probably event handler leaks (they are the commonest cause of leaks in .NET). Make sure that you are deallocating any event handlers that you have allocated before you leave the page.


这篇关于HeaderedContentControl的内容设置过程会增加内存使用率(内存泄漏)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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