{
  "id": 17442230,
  "title": "Making a WPF Expander Faster with UI Reuse and Virtualization",
  "url": "https://urgent.news/2026/10/31/making-a-wpf-expander-faster-with-ui-reuse-and-virtualization",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-10-31T17:42:25.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/rishabhrawat05/making-a-wpf-expander-faster-with-ui-reuse-and-virtualization-2a94"
  },
  "original_language": "en",
  "account": "In a recent project, a WPF Expander containing around 1,000 sequences experienced slow opening performance. Each sequence included a three-dot button for additional actions. The issue stemmed from the implementation of the UI, where a separate three-dot button was created for each sequence item, leading to unnecessary UI element creation overhead. To optimize the Expander, two approaches were taken: reusing the button and implementing UI virtualization. By reusing the button reference instead of repeatedly creating it, and by implementing virtualization to generate UI elements only for the visible portion of the collection, the Expander now opens much faster, even with approximately 1,000 sequences. This demonstrates the importance of efficient UI structure in handling large collections, encouraging developers to consider avoiding unnecessary UI element creation, reusing common UI definitions, implementing virtualization, examining DataTemplates and visual tree complexity, and understanding UI element creation and rendering processes.",
  "summary": "Working with large collections in WPF can introduce performance issues that aren't always obvious at first. Recently, I worked on optimizing an Expander in our application that contained around 1,000 sequences. Opening it was noticeably slow, so I started investigating what was happening behind the scenes. The Problem We had an Expander that displayed approximately 1,000 sequences. Each sequence…",
  "key_points": [
    "WPF Expander with 1,000 sequences experienced slow opening performance",
    "Reused three-dot button and implemented UI virtualization to optimize",
    "Expander now opens faster with efficient UI structure and element reuse"
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}