Search code examples
c#xamlwindows-phone-8

XAML removing element from code behind


I'd like to know if its correct to remove an element from a xaml grid as I do in this example

myGrid.Children.Remove(myElement);

Is that all or I have to do something more? I ask this because I'm having memory issue and from the memory profiler there are some string that aren't being released from object of type PropertyPathParser, Binding and other related to XAML (I think)


Solution

  • You can also try using myGrid.Children.clear();

    children.removeAll();