wpf-rule-rendering-antipatterns — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited wpf-rule-rendering-antipatterns (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Common WPF rendering mistakes that cause performance problems or visual corruption.
Calling InvalidateVisual() inside a loop schedules a separate render pass for each iteration. WPF does not coalesce these — each call queues a layout/render cycle, causing frame drops or freezes.
// Prohibited: InvalidateVisual inside a loop
foreach (var item in items)
{
item.Value = ComputeNewValue(item);
InvalidateVisual(); // ← queues N render passes
}Mutate all state first, then invalidate once after the loop completes.
// Correct: one invalidation after all state is updated
foreach (var item in items)
{
item.Value = ComputeNewValue(item);
}
InvalidateVisual(); // ← single render passFor data-driven scenarios where items notify individually, suppress notifications during bulk update and raise a single reset at the end:
// Correct: bulk update with deferred notification
_suppressNotifications = true;
try
{
foreach (var item in items)
item.Value = ComputeNewValue(item);
}
finally
{
_suppressNotifications = false;
InvalidateVisual();
}OnRender is called on every render pass (layout changes, animations, window resize). Allocating Brush, Pen, Geometry, or other objects inside OnRender creates garbage on every frame.
// Prohibited: resource allocation inside OnRender
protected override void OnRender(DrawingContext dc)
{
var brush = new SolidColorBrush(Colors.Red); // ← allocated every frame
var pen = new Pen(brush, 1.0); // ← allocated every frame
dc.DrawEllipse(brush, pen, _center, _rx, _ry);
}Move resource creation to the constructor or a property setter. See freezable-performance.md for the correct constructor-initialize-and-freeze pattern.
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.