MaterialDesignInXamlToolkit icon indicating copy to clipboard operation
MaterialDesignInXamlToolkit copied to clipboard

Event handler leak on drawerHost

Open salty-kambi opened this issue 1 year ago • 0 comments

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.

dotmemory_eventleak

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

salty-kambi avatar Oct 29 '24 12:10 salty-kambi