private static void OnIsEnabledChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { if (d is Window window) { if (true.Equals(e.OldValue)) { GetWindowBlur(window)?.Detach(); window.ClearValue(WindowBlurProperty); } if (true.Equals(e.NewValue)) { var blur = new WindowBlur(); blur.Attach(window); window.SetValue(WindowBlurProperty, blur); } } }
public static void SetWindowBlur(DependencyObject element, WindowBlur value) => element.SetValue(WindowBlurProperty, value);