Some Background
I have noticed that setting the EditTemplate of a DataForm (from the Silverlight Toolkit) can cause the DataForm to not be garbage collected. Consequently, the parent control of the DataForm cannot be garbage collected either, causing a very significant memory leak.
Here's some XAML which demonstrates the case.
<toolkit:DataForm HorizontalAlignment="Stretch" Margin="10" VerticalAlignment="Stretch">
<toolkit:DataForm.EditTemplate>
<DataTemplate>
<toolkit:DataField Label="Dummy Binding:">
<TextBox Text="{Binding DummyBinding, Mode=TwoWay}" />
</toolkit:DataField>
</DataTemplate>
</toolkit:DataForm.EditTemplate>
</toolkit:DataForm>
I have opened an issue on CodePlex. The isssue has an attachment which has a project which desmonstrates the case.
So, My Question Is
Has anyone else encountered this issue? More importantly, does anyone know of any workarounds? How can I force this DataForm to be garbage collected?