Пример #1
0
 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 BlurEffectV2();
             blur.Attach(window);
             window.SetValue(WindowBlurProperty, blur);
         }
     }
 }
Пример #2
0
 public static void SetWindowBlur(DependencyObject element, BlurEffectV2 value)
 {
     element.SetValue(WindowBlurProperty, value);
 }
Пример #3
0
 public WindowTest()
 {
     InitializeComponent();
     BlurEffectV2.SetIsEnabled(this, true);
 }