mirror of
https://github.com/QL-Win/QuickLook.git
synced 2026-02-27 01:00:11 +08:00
Refactor null check in OnSpinPropertyChanged
Replaces explicit null check and cast with pattern matching for improved readability and conciseness.
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user