MaterialDesignInXamlToolkit
MaterialDesignInXamlToolkit copied to clipboard
Event handler leak on drawerHost
Bug explanation
Hi, i'm using MaterialDesign's DrawerHost but when i repeatedly open/close the drawer, it generate System.Windows.VisualStateManager+<>c__DisplayClass12_0 and MS.Internal.FreezableDefaultValueFactory+FreezableDefaultPromoter event handler leak according to dotMemory.
here is the simplified implementation, the elements use the base style of materialDesign and the binding is a property using PropertyChanged:
<materialDesign:DrawerHost IsLeftDrawerOpen="{Binding IsDrawerOpen}" OpenMode="Standard"
LeftDrawerCloseOnClickAway="True">
<materialDesign:DrawerHost.LeftDrawerContent>
<TextBlock Text="oui"/>
</materialDesign:DrawerHost.LeftDrawerContent>
<ToggleButton IsChecked="{Binding IsDrawerOpen}"/>
</materialDesign:DrawerHost>
Thanks
Version
5.1.0