コード例 #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 WindowBlur();
             blur.Attach(window);
             window.SetValue(WindowBlurProperty, blur);
         }
     }
 }
コード例 #2
0
        public MainWindow()
        {
            InitializeComponent();
            WindowBlur.SetIsEnabled(this, true);
            MouseDown += Window_MouseDown;

            try
            {
                InitializeSinP();
            }
            catch (Exception e)
            {
                MessageBox.Show("System info data error: " + e.Message);
            }

            Timer99.Tick     += Timer99_Tick; // don't freeze the ui
            Timer99.Interval  = new TimeSpan(0, 0, 0, 0, 1024);
            Timer99.IsEnabled = true;
        }
コード例 #3
0
 public static void SetWindowBlur(DependencyObject element, WindowBlur value)
 {
     element.SetValue(WindowBlurProperty, value);
 }