MahApps / MahApps/MahApps.Metro
CheckBox performance is very bad
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 9.8k
- Forks
- 2.4k
- Avg merge
- 1h 2m
- Merged PRs (30d)
- 56
Description
Describe the bug
Compared to the built-in WPF checkbox style, the rendering performance is really bad. Perhaps due to the massive amount of attached properties?
I saw some PRs that added fallback values, and have tried that but it didn't help with rendering speed. Only thing that works is removing the checkboxes or going back to WPF's own style.
Steps to reproduce
A description of how to trigger this bug.
- Add a listbox with am item template with a checkbox and some other stuff, such as some of the MahApps icons 🙂
- Add several hundred items.
- Virtualization can be enabled or disabled, it doesn't matter.
- Scroll, and see how laggy it is.
Expected behavior
It should not lag.
Actual behavior
It lags.
Environment
MahApps.Metro version: v2.4.9
Windows build number: Win10 22H1
Visual Studio: 2022
Target Framework: .NET v4.7.2, also .NET 6.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 lag with a WPF ListBox item template containing a CheckBox and other MahApps icons, using several hundred items with virtualization both enabled and disabled. Compare scrolling against the built-in WPF checkbox style and inspect the CheckBox styling and attached-property usage. Done means scrolling is no longer noticeably laggy in the reported .NET Framework and .NET 6 environments.
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
- Mostly clear
- Newbie friendliness
- 25/100