WPF Memory Usage

前端 未结 5 734
礼貌的吻别
礼貌的吻别 2021-02-08 20:56

Application:

  • WPF Application consisting of a textbox on top and a listbox below
  • Users type a string in the TextBox to find employees, and search results
5条回答
  •  借酒劲吻你
    2021-02-08 21:36

    I've noticed that there are some issues in WPF and .NET 3.5 SP1 w.r.t memory issues in seemingly innocuous situations.

    I did find a couple of resources, but I'm not sure they would be helpful to you:

    http://blog.ramondeklein.nl/?p=58

    That blog post describes a situation whereupon when

    1. A style is defined in the application’s ResourceDictionary.
    2. The style uses a control template that uses media effects (i.e. DropShadowEffect).
    3. The media effect should be referenced using a StaticResource

    In a nutshell, I think your solution would be to ensure that any media effects (dropshadow, etc) use static resources.

提交回复
热议问题