private void UpdateBlur() { if (AssociatedObject == null) { return; } var windowHelper = new WindowInteropHelper(AssociatedObject); if (AssociatedObject.IsActive || KeepBlurEffectWhenInactive) { var a = Background.A; var r = Background.R; var g = Background.G; var b = Background.B; WindowUtils.EnableBlur(windowHelper, a, r, g, b); AssociatedObject.Background = BlurUtilBackground; } else { AssociatedObject.Background = _originalBackground; WindowUtils.DisableBlur(windowHelper); } }