WPF - TextBox memory leak issue
Earlier today on the WPF Forum I hit upon this issue about memory leak in TextBox. MS has responded saying it is by design. I am not entirely convinced as to how consuming unlimited memory could be a good design decision. I have been using WPF for a while now and wasn't even aware of this property on TextBox. I am sure many others won't be.
Anyway, the solution discussed there is to set the UndoLimit property of TextBox to 0. Instead of setting this for all TextBoxes in your code, it can more easily set in App.xaml as an application resource so that it is applicable to all TextBoxes by default. You can explicitly undo for specific ones via code or local property setting.
<Application.Resources><Style TargetType="{x:Type TextBox}">
<Setter Property="UndoLimit" Value="0" />
</Style>
</Application.Resources>


