The VisualStateBehaviourFactory in WPF Toolkit (VSM) makes memory leak when use DatePicker. In the reference path it holds the list of VisualStateBehavior instances, the VisualStateBeahvior holds ButtonBaseBehavior and this ButtonBaseBehavior
holds the CalendarButton instances. This leads the DatePicker object still alive in the memory after closing the application that contain the DatePicker control. Try the following scenario
1. Create a window (Window1.xaml) with DatePicker control and implement the destructor for Window1
2. Then create another window (Window2.xaml) with the button to show the Window1.xaml.
3. Now open the Window2 and click on the button
4. Now the Window1 is opened and DatePicker control displayed.
5. Close the Window1, but its destructor does not executed until close the Window2(Parent window) or it is executed after taking some time.
View Complete Post