I often insert/delete 20-30 very complicated UserControls into StackPanel
.
All UserControls already created and cached for reusing. Before reusing control I clean old parent and remember control.
Operations like StackPanel.Children.Remove
, StackPanel.Children.Add
take a lot of time in my scenarios.
How can I optimize these operations? E.g. insert all controls in StackPanel
at a time or freeze notifications during collection's modifications or else?
May who known useful articles regrading wpf optimization (except MSDN)?