Пример #1
0
        //#FF5E98D9


        /// <summary>
        ///     Interaction logic for PlexWindow.xaml
        /// </summary>
        public PlexWindow()
        {
            _shadowWindow      = new ShadowWindow(this);
            WindowStyle        = WindowStyle.None;
            AllowsTransparency = true;
            //SyncShadowToWindow();
            //SyncShadowToWindowSize();
            _shadowTimer.Elapsed += delegate
            {
                Dispatcher.Invoke(new Action(() =>
                {
                    {
                        SyncShadowToWindow();
                    }
                }));
            };
            Loaded      += PlexWindow_Loaded;
            Activated   += PlexWindow_Activated;
            Deactivated += PlexWindow_Deactivated;

            /*StoreMaxWidth = MaxWidth;
             * StoreMaxHeight = MaxHeight;*/

            var restoreMinSettings = new RoutedCommand();

            restoreMinSettings.InputGestures.Add(new KeyGesture(Key.Down, ModifierKeys.Windows));
            CommandBindings.Add(new CommandBinding(restoreMinSettings, RestoreMinimizeWindow));
        }
Пример #2
0
        /// <summary>
        ///     Interaction logic for PlexWindow.xaml
        /// </summary>
        public PlexWindow()
        {
            _shadowWindow      = new ShadowWindow(this);
            WindowStyle        = WindowStyle.None;
            AllowsTransparency = true;
            //SyncShadowToWindow();
            //SyncShadowToWindowSize();

            /*_shadowTimer.Elapsed += delegate
             * {
             *      Dispatcher.Invoke(new Action(() =>
             *      {
             *              {
             *                      SyncShadowToWindow();
             *              }
             *      }));
             * };*/

            _shadowScaleTimer.Elapsed += delegate
            {
                Dispatcher.Invoke(new Action(() =>
                {
                    {
                        SyncShadowToWindowScale();
                    }
                }));
            };
            Loaded           += PlexWindow_Loaded;
            IsVisibleChanged += PlexWindow_IsVisibleChanged;
            Activated        += PlexWindow_Activated;
            Deactivated      += PlexWindow_Deactivated;

            /*StoreMaxWidth = MaxWidth;
             * StoreMaxHeight = MaxHeight;*/

            var restoreMinSettings = new RoutedCommand();

            restoreMinSettings.InputGestures.Add(new KeyGesture(Key.Down, ModifierKeys.Windows));
            CommandBindings.Add(new CommandBinding(restoreMinSettings, RestoreMinimizeWindow));
            ScaleTransform ScaleTransform = new ScaleTransform()
            {
                CenterX = (ActualWidth / 2),
                CenterY = (ActualHeight / 2),
                ScaleX  = 1,
                ScaleY  = 1
            };

            this.RenderTransform = ScaleTransform;
        }