Urgent.News

What's breaking now, across thousands of outlets.

Tech

Making a WPF Expander Faster with UI Reuse and Virtualization

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…

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.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

It broke again: a short about the same bug coming back, and the incident note I write now

Episode 2 of our Rozz shorts is about a bug that comes back. Customers got three payment emails for one invoice. Rozz opens the Incidents dashboard, then the incident note, and works through it…

  • Customers received duplicate payment emails for a single invoice
  • Bug caused by webhook handler being slower than provider's timeout
  • Incident note outlines Symptom, Root Cause, Fix, and Prevention

Trojans: the malware you invite in, and how the FBI uninstalled it

The original Trojan Horse did not knock down the walls of Troy. The Trojans pulled it inside themselves , because it looked like a gift.

  • Trojans disguise as harmless files/software, tricking users into installing them
  • FBI dismantled Emotet network in 2021, then Qakbot in 2023, seizing millions in crypto
  • Human trust exploited by trojans, but authorities can neutralize threat with proper tactics

WannaCry: the global ransomware stopped by a $10.69 domain

On Friday, 12 May 2017 , hospital staff across England walked up to their computers and found a red window demanding Bitcoin. Ambulances were diverted. Appointments were cancelled.

  • WannaCry ransomware affected over 150 countries on May 12, 2017
  • Exploited EternalBlue flaw in outdated Windows SMBv1 protocol
  • Marcus Hutchins registered kill switch domain for $10.69 to stop spread

More from Saturday 31 October →