Пример #1
0
 internal static void OpenWindow()
 {
     if (Common.Window.Visibility != Visibility.Visible)
     {
         Common.Window.Show();
         Common.Window.Opacity = 0D;
         Common.Window.Top     = Common.Window.Top + 100;
         WindowEffect.BlurWindow(Common.Window, AccentState.ACCENT_ENABLE_BLURBEHIND);
         Common.Window.BeginAnimation(UIElement.OpacityProperty, new DoubleAnimation(1, TimeSpan.FromSeconds(0.2D)));
         Common.Window.BeginAnimation(Window.TopProperty, new DoubleAnimation(Common.Window.Top - 100, TimeSpan.FromSeconds(0.4D)));
     }
     else
     {
         Common.Window.Focus();
     }
 }
Пример #2
0
        public AppControllerCore(AppKeeper keeper, SettingsCore settings)
        {
            this._keeper  = keeper ?? throw new ArgumentNullException(nameof(keeper));
            this.Settings = settings ?? throw new ArgumentNullException(nameof(settings));

            LanguageService.SwitchDefault();
            WindowEffect.ChangeTheme();

            Monitors = new ObservableCollection <MonitorViewModel>();
            BindingOperations.EnableCollectionSynchronization(Monitors, _monitorsLock);

            NotifyIconContainer = new NotifyIconContainer();

            _displayWatcher    = new DisplayWatcher();
            _sessionWatcher    = new SessionWatcher();
            _powerWatcher      = new PowerWatcher();
            _brightnessWatcher = new BrightnessWatcher();
        }
Пример #3
0
 /// <summary>
 ///     无参构造函数
 /// </summary>
 private MarkingMessageBox()
 {
     // 初始化组件
     InitializeComponent();
     // 背景模糊效果
     SourceInitialized += (e, a) =>
     {
         WindowEffect.EnableBackgroundBlur(this);
         //System.Windows.Shell.WindowChrome.SetWindowChrome(this,
         //    new System.Windows.Shell.WindowChrome
         //    {
         //        GlassFrameThickness = new Thickness(0),
         //        CaptionHeight = 0,
         //        CornerRadius = new CornerRadius(0),
         //        NonClientFrameEdges = System.Windows.Shell.NonClientFrameEdges.None,
         //        UseAeroCaptionButtons = false
         //    });
     };
 }