MaterialDesignInXAML / MaterialDesignInXAML/MaterialDesignInXamlToolkit
Event handler leak on drawerHost
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 16.3k
- Forks
- 3.5k
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 8
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the repeated open/close sequence with the DrawerHost example, using dotMemory to confirm the VisualStateManager and FreezableDefaultValueFactory handler leak. Inspect DrawerHost event handling and compare memory snapshots before and after repeated cycles; done means the reported handlers no longer accumulate.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 28/100