Refactor null check in OnSpinPropertyChanged
Some checks failed
build / build (push) Has been cancelled
build / publish (push) Has been cancelled

Replaces explicit null check and cast with pattern matching for improved readability and conciseness.
This commit is contained in:
ema
2025-12-16 19:14:42 +08:00
parent 97ebb410fb
commit 91c6323be6

View File

@@ -33,9 +33,7 @@ internal class SpinIcon : TextBlock, ISpinable
private static void OnSpinPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var b = d as SpinIcon;
if (b == null) return;
if (d is not SpinIcon b) return;
if ((bool)e.NewValue)
b.BeginSpin();