private void ForceParentCommand(SystemCommands HitTest)
 {
     TopLevelWindow.ReleaseCapture();
     _skinWindow.Parent.Activate();
     //Parent.SendMessageTimeOut(WindowMessages.SysCommand, _
     //                          New IntPtr(HitTest), _
     //                          IntPtr.Zero, _
     //                          SendMessageTimeOutFlags.Normal Or SendMessageTimeOutFlags.AbortIfHang, _
     //                          0, IntPtr.Zero)
     _skinWindow.Parent.PostMessage(WindowMessages.SysCommand, new IntPtr((int)HitTest), IntPtr.Zero);
     //using SendMessageTimeOut make hang when trying to close a window
     // and hangs the window on vista when moving so much because it causes the thread to hold until it return
 }
Exemple #2
0
 private void Svern(object sender, RoutedEventArgs e)
 {
     SystemCommands.MinimizeWindow(this);
 }
 private void MaximizeCommandHandler(object sender, ExecutedRoutedEventArgs e)
 {
     SystemCommands.MaximizeWindow(this);
 }
Exemple #4
0
 private void MinimizeWindow(object sender, ExecutedRoutedEventArgs e)
 {
     SystemCommands.MinimizeWindow(this);
 }
 private void MaximizeWindow(object s, ExecutedRoutedEventArgs e)
 {
     SystemCommands.MaximizeWindow(this);
 }
Exemple #6
0
 void MinButtonClick(object sender, RoutedEventArgs e)
 {
     sender.ForWindowFromTemplate(w => SystemCommands.MinimizeWindow(w));
 }
Exemple #7
0
 private void OnMinimizeWindow(object target, ExecutedRoutedEventArgs e)
 {
     SystemCommands.MinimizeWindow(this);
 }
Exemple #8
0
 private void MinimizeWindow()
 {
     SystemCommands.MinimizeWindow(this);
 }
Exemple #9
0
 void MinButton_Click(object sender, RoutedEventArgs e) => SystemCommands.MinimizeWindow(this);
Exemple #10
0
 /// <summary>
 /// 显示系统菜单,当点击Icon的时候
 /// </summary>
 protected void WindowMenu(object sender, RoutedEventArgs e)
 {
     SystemCommands.ShowSystemMenu(this, GetMousePosition());//弹出系统菜单
 }
Exemple #11
0
        private void onCloseWindowCommand(object sender, ExecutedRoutedEventArgs e)
        {
            Window window = Window.GetWindow(this);

            SystemCommands.CloseWindow(window);
        }
Exemple #12
0
 protected virtual void OnCloseWindowExecuted(object sender, ExecutedRoutedEventArgs e)
 {
     SystemCommands.CloseWindow(this);
 }
Exemple #13
0
 private void Minimize_Click(object sender, RoutedEventArgs e)
 {
     SystemCommands.MinimizeWindow(Window.GetWindow(sender as Button));
 }
Exemple #14
0
 public static void ForceParentCommand(TopLevelWindow window, SystemCommands HitTest)
 {
     TopLevelWindow.ReleaseCapture();
     window.Activate();
     window.PostMessage(WindowMessages.SysCommand, new IntPtr((int)HitTest), IntPtr.Zero);
 }
Exemple #15
0
 private void CloseButtonClick(object sender, RoutedEventArgs e)
 {
     sender.ForWindowFromTemplate(w => SystemCommands.CloseWindow(w));
 }
 private void Fullscreen_Click(object sender, RoutedEventArgs e)
 {
     SystemCommands.MaximizeWindow(this);
     Fullscreen.Visibility     = Visibility.Hidden;
     FullscreenExit.Visibility = Visibility.Visible;
 }
Exemple #17
0
 public static extern bool EnableMenuItem(IntPtr hMenu, SystemCommands uIDEnableItem, MenuFlags uEnable);
Exemple #18
0
        internal static void MainWindow_KeysDown(object sender, KeyEventArgs e)
        {
            // Don't allow keys when typing in text
            if (GetMainWindow.TitleText.IsKeyboardFocusWithin)
            {
                return;
            }

            var ctrlDown  = (Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.Control;
            var altDown   = (Keyboard.Modifiers & ModifierKeys.Alt) == ModifierKeys.Alt;
            var shiftDown = (Keyboard.Modifiers & ModifierKeys.Shift) == ModifierKeys.Shift;

            #region CroppingKeys

            if (GetCropppingTool != null)
            {
                if (GetCropppingTool.IsVisible)
                {
                    if (e.Key == Key.Escape)
                    {
                        CropFunctions.CloseCrop();
                        e.Handled = true;
                        return;
                    }

                    if (e.Key == Key.Enter)
                    {
                        CropFunctions.PerformCrop();
                        e.Handled = true;
                        return;
                    }
                    e.Handled = true;
                    return;
                }
            }

            #endregion CroppingKeys

            #region Keys where it can be held down

            switch (e.Key)
            {
            case Key.BrowserForward:
            case Key.Right:
            case Key.D:
                if (GetPicGallery != null)
                {
                    if (GalleryFunctions.IsOpen)
                    {
                        if (Properties.Settings.Default.PicGallery == 1)
                        {
                            return;
                        }
                    }
                }
                if (!e.IsRepeat)
                {
                    // Go to first if Ctrl held down
                    if (ctrlDown)
                    {
                        Pic(true, true);
                    }
                    else
                    {
                        Pic();
                    }
                }
                else if (CanNavigate)
                {
                    FastPic(true);
                }
                return;

            case Key.BrowserBack:
            case Key.Left:
            case Key.A:
                if (GetPicGallery != null)
                {
                    if (GalleryFunctions.IsOpen)
                    {
                        if (Properties.Settings.Default.PicGallery == 1)
                        {
                            return;
                        }
                    }
                }
                if (!e.IsRepeat)
                {
                    // Go to last if Ctrl held down
                    if (ctrlDown)
                    {
                        Pic(false, true);
                    }
                    else
                    {
                        Pic(false);
                    }
                }
                else if (CanNavigate)
                {
                    FastPic(false);
                }
                return;

            case Key.PageUp:
                if (GetPicGallery != null)
                {
                    if (GalleryFunctions.IsOpen)
                    {
                        ScrollTo(true, ctrlDown);
                        return;
                    }
                }
                if (Properties.Settings.Default.ScrollEnabled)
                {
                    GetMainWindow.Scroller.ScrollToVerticalOffset(GetMainWindow.Scroller.VerticalOffset - 30);
                }

                return;

            case Key.PageDown:
                if (GetPicGallery != null)
                {
                    if (GalleryFunctions.IsOpen)
                    {
                        ScrollTo(false, (Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.Control);
                        return;
                    }
                }
                if (Properties.Settings.Default.ScrollEnabled)
                {
                    GetMainWindow.Scroller.ScrollToVerticalOffset(GetMainWindow.Scroller.VerticalOffset + 30);
                }

                return;

            case Key.Up:
                if (GetPicGallery != null)
                {
                    if (GalleryFunctions.IsOpen)
                    {
                        if (Properties.Settings.Default.PicGallery == 1)
                        {
                            return;
                        }

                        ScrollTo(true, ctrlDown);
                    }
                    else if (ctrlDown)
                    {
                        Rotate(true);
                    }
                }
                else if (ctrlDown)
                {
                    Rotate(false);
                }
                if (Properties.Settings.Default.ScrollEnabled)
                {
                    GetMainWindow.Scroller.ScrollToVerticalOffset(GetMainWindow.Scroller.VerticalOffset - 30);
                }
                return;

            case Key.W:
                if (GetPicGallery != null)
                {
                    if (GalleryFunctions.IsOpen)
                    {
                        if (Properties.Settings.Default.PicGallery == 2)
                        {
                            ScrollTo(true, ctrlDown);
                        }

                        return;
                    }
                }
                if (Properties.Settings.Default.ScrollEnabled)
                {
                    GetMainWindow.Scroller.ScrollToVerticalOffset(GetMainWindow.Scroller.VerticalOffset - 30);
                }
                return;

            case Key.Down:
                if (GetPicGallery != null)
                {
                    if (GalleryFunctions.IsOpen)
                    {
                        if (Properties.Settings.Default.PicGallery == 1)
                        {
                            return;
                        }

                        ScrollTo(false, ctrlDown);
                    }
                    else if (ctrlDown)
                    {
                        Rotate(true);
                    }
                }
                else if (ctrlDown)
                {
                    Rotate(true);
                }
                else if (Properties.Settings.Default.ScrollEnabled)
                {
                    GetMainWindow.Scroller.ScrollToVerticalOffset(GetMainWindow.Scroller.VerticalOffset + 30);
                }
                return;

            case Key.S:
                if (ctrlDown)
                {
                    SaveFiles();
                }
                else if (GetPicGallery != null)
                {
                    if (GalleryFunctions.IsOpen)
                    {
                        if (Properties.Settings.Default.PicGallery == 2)
                        {
                            ScrollTo(false, ctrlDown);
                        }

                        return;
                    }
                }
                else if (Properties.Settings.Default.ScrollEnabled)
                {
                    GetMainWindow.Scroller.ScrollToVerticalOffset(GetMainWindow.Scroller.VerticalOffset + 30);
                }
                return;

            // Zoom
            case Key.Add:
            case Key.OemPlus:
                Zoom(true);
                return;

            case Key.Subtract:
            case Key.OemMinus:
                Zoom(false);
                return;

            default: break;
            }

            #endregion Keys where it can be held down

            #region Key is not held down

            if (!e.IsRepeat)
            {
                switch (e.Key)
                {
                // Esc
                case Key.Escape:
                    if (UserControls_Open())
                    {
                        Close_UserControls();
                    }
                    else if (Properties.Settings.Default.Fullscreen)
                    {
                        if (GalleryFunctions.IsOpen)
                        {
                            Toggle();
                        }
                        else
                        {
                            Fullscreen_Restore();
                        }
                    }
                    else if (Slideshow.SlideTimer != null && Slideshow.SlideTimer.Enabled)
                    {
                        Slideshow.StopSlideshow();
                    }
                    else if (GalleryFunctions.IsOpen)
                    {
                        Toggle();
                    }
                    else if (IsDialogOpen)
                    {
                        IsDialogOpen = false;
                    }
                    else if (Color_Picking.IsRunning)
                    {
                        Color_Picking.StopRunning(false);
                    }
                    else if (!cm.IsVisible)
                    {
                        SystemCommands.CloseWindow(GetMainWindow);
                    }
                    break;

                // Ctrl + Q
                case Key.Q:
                    if (ctrlDown)
                    {
                        SystemCommands.CloseWindow(GetMainWindow);
                    }
                    break;

                // O, Ctrl + O
                case Key.O:
                    Open();
                    break;

                // X, Ctrl + X
                case Key.X:
                    if (ctrlDown)
                    {
                        Cut(Pics[FolderIndex]);
                    }
                    else
                    {
                        ConfigureSettings.UpdateUIValues.SetScrolling(sender, e);
                    }
                    break;

                // F
                case Key.F:
                    Flip();
                    break;

                // Delete, Shift + Delete
                case Key.Delete:
                    DeleteFile(!shiftDown);
                    break;

                // Ctrl + C, Ctrl + Shift + C, Ctrl + Alt + C
                case Key.C:
                    if (ctrlDown)
                    {
                        if (GetResizeAndOptimize != null)
                        {
                            if (GetResizeAndOptimize.IsVisible)
                            {
                                return;     // Prevent paste errors
                            }
                        }

                        if (shiftDown)
                        {
                            Copyfile();
                        }
                        else if (altDown)
                        {
                            System.Threading.Tasks.Task task = Base64.SendToClipboard();
                        }
                        else
                        {
                            CopyBitmap();
                        }
                    }
                    else if (!GalleryFunctions.IsOpen)
                    {
                        CropFunctions.StartCrop();
                    }
                    break;

                // Ctrl + V
                case Key.V:
                    if (ctrlDown)
                    {
                        Paste();
                    }
                    break;

                // Ctrl + I
                case Key.I:
                    if (ctrlDown)
                    {
                        SystemIntegration.NativeMethods.ShowFileProperties(Pics[FolderIndex]);
                    }
                    break;

                // Ctrl + P
                case Key.P:
                    if (ctrlDown)
                    {
                        Print(Pics[FolderIndex]);
                    }
                    break;

                // Ctrl + R
                case Key.R:
                    if (ctrlDown)
                    {
                        Reload();
                    }
                    break;

                // L
                case Key.L:
                    ConfigureSettings.UpdateUIValues.SetLooping(sender, e);
                    break;

                // E
                case Key.E:
                    OpenWith(Pics[FolderIndex]);
                    break;

                // T
                case Key.T:
                    ConfigureSettings.ConfigColors.ChangeBackground(sender, e);
                    break;

                // Space
                case Key.Space:
                    if (GetPicGallery != null)
                    {
                        if (GalleryFunctions.IsOpen)
                        {
                            ScrollTo();
                            return;
                        }
                    }
                    CenterWindowOnScreen();
                    break;

                // 1
                case Key.D1:
                    if (QuickSettingsMenuOpen || GalleryFunctions.IsOpen ||
                        Properties.Settings.Default.Fullscreen)
                    {
                        break;
                    }

                    Tooltip.ShowTooltipMessage(Application.Current.Resources["CenterImageInWindow"]);
                    ConfigureSettings.UpdateUIValues.SetScalingBehaviour(false, false);
                    break;

                // 2
                case Key.D2:
                    if (QuickSettingsMenuOpen || GalleryFunctions.IsOpen ||
                        Properties.Settings.Default.Fullscreen)
                    {
                        break;
                    }

                    Tooltip.ShowTooltipMessage(Application.Current.Resources["CenterImageInWindowFillHeight"]);
                    ConfigureSettings.UpdateUIValues.SetScalingBehaviour(false, true);
                    break;

                // 3
                case Key.D3:
                    if (QuickSettingsMenuOpen || GalleryFunctions.IsOpen ||
                        Properties.Settings.Default.Fullscreen)
                    {
                        break;
                    }

                    Tooltip.ShowTooltipMessage(Application.Current.Resources["CenterApplicationToWindow"]);
                    ConfigureSettings.UpdateUIValues.SetScalingBehaviour(true, false);
                    break;

                // 4
                case Key.D4:
                    if (QuickSettingsMenuOpen || GalleryFunctions.IsOpen ||
                        Properties.Settings.Default.Fullscreen)
                    {
                        break;
                    }

                    Tooltip.ShowTooltipMessage(Application.Current.Resources["CenterApplicationToWindowFillHeight"]);
                    ConfigureSettings.UpdateUIValues.SetScalingBehaviour(true, true);
                    break;

                // F1
                case Key.F1:
                    InfoWindow();
                    break;

                // F2
                case Key.F2:
                    EditTitleBar.EditTitleBar_Text();
                    break;

                // F3
                case Key.F3:
                    Open_In_Explorer();
                    break;

                // F4
                case Key.F4:
                    AllSettingsWindow();
                    break;

                // F5
                case Key.F5:
                    Slideshow.StartSlideshow();
                    break;

                // F6
                case Key.F6:
                    EffectsWindow();
                    break;

                // F7
                case Key.F7:
                    ResetZoom();
                    break;

#if DEBUG
                // F8
                case Key.F8:
                    Unload();
                    break;
#endif
                // F11
                case Key.F11:
                    Fullscreen_Restore();
                    break;

                // Home
                case Key.Home:
                    GetMainWindow.Scroller.ScrollToHome();
                    break;

                // End
                case Key.End:
                    GetMainWindow.Scroller.ScrollToEnd();
                    break;

                default: break;
                }
            }

            #endregion Key is not held down

            #region Alt + keys

            // Alt doesn't work in switch? Waiting for key up is confusing in this case

            if (altDown && !e.IsRepeat)
            {
                // Alt + Z
                if ((e.SystemKey == Key.Z) && !GalleryFunctions.IsOpen)
                {
                    HideInterfaceLogic.ToggleInterface();
                }

                // Alt + Enter
                else if ((e.SystemKey == Key.Enter))
                {
                    if (Properties.Settings.Default.PicGallery != 2)
                    {
                        Fullscreen_Restore();
                    }
                }
            }

            #endregion Alt + keys
        }
Exemple #19
0
 private void RestoreWindow()
 {
     SystemCommands.RestoreWindow(this);
 }
 private void ShowSystemMenu(Point pt)
 {
     SystemCommands.ShowSystemMenu(this, PointToScreen(pt));
 }
Exemple #21
0
 private void OnRestoreWindow(object target, ExecutedRoutedEventArgs e)
 {
     SystemCommands.RestoreWindow(this);
     //alskjdasdlkfalksjdf;
 }
Exemple #22
0
        private void Window_ContentRendered(object sender, EventArgs e)
        {
            KeyUp += (_, e) =>
            {
                if (e.Key == Key.Escape)
                {
                    Hide();
                    LoadWindows.GetMainWindow.Focus();
                }
                else if (e.Key == Key.Q)
                {
                    if ((Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.Control)
                    {
                        Environment.Exit(0);
                    }
                }
            };

            // Hack to deselect border on mouse click
            MouseLeftButtonDown += delegate
            {
                FocusManager.SetFocusedElement(FocusManager.GetFocusScope(this), null);
                Keyboard.ClearFocus();
                Focus();
            };

            // CloseButton
            CloseButton.TheButton.Click += delegate { Hide(); LoadWindows.GetMainWindow.Focus(); };

            // MinButton
            MinButton.TheButton.Click += delegate { SystemCommands.MinimizeWindow(this); };

            TitleBar.MouseLeftButtonDown       += delegate { DragMove(); };
            MainBackground.MouseLeftButtonDown += delegate { DragMove(); };

            // FileProperties
            FileProperties.PreviewMouseLeftButtonDown += delegate { PreviewMouseButtonDownAnim(FilePropertiesFill); };
            FileProperties.MouseEnter += delegate { ButtonMouseOverAnim(FilePropertiesFill); };
            FileProperties.MouseEnter += delegate { AnimationHelper.MouseEnterBgTexColor(FilePropertiesBrush); };
            FileProperties.MouseLeave += delegate { ButtonMouseLeaveAnim(FilePropertiesFill); };
            FileProperties.MouseLeave += delegate { AnimationHelper.MouseLeaveBgTexColor(FilePropertiesBrush); };
            FileProperties.Click      += delegate
            {
                SystemIntegration.NativeMethods.ShowFileProperties(Pics[FolderIndex]);
            };

            // Print
            Print.PreviewMouseLeftButtonDown += delegate { PreviewMouseButtonDownAnim(PrintFill); };
            Print.MouseEnter += delegate { ButtonMouseOverAnim(PrintFill); };
            Print.MouseEnter += delegate { AnimationHelper.MouseEnterBgTexColor(PrintBrush); };
            Print.MouseLeave += delegate { ButtonMouseLeaveAnim(PrintFill); };
            Print.MouseLeave += delegate { AnimationHelper.MouseLeaveBgTexColor(PrintBrush); };
            Print.Click      += delegate
            {
                FileHandling.Open_Save.Print(Pics[FolderIndex]);
            };

            // OpenWith
            OpenWith.PreviewMouseLeftButtonDown += delegate { PreviewMouseButtonDownAnim(OpenWithFill); };
            OpenWith.MouseEnter += delegate { ButtonMouseOverAnim(OpenWithFill); };
            OpenWith.MouseEnter += delegate { AnimationHelper.MouseEnterBgTexColor(OpenWithBrush); };
            OpenWith.MouseLeave += delegate { ButtonMouseLeaveAnim(OpenWithFill); };
            OpenWith.MouseLeave += delegate { AnimationHelper.MouseLeaveBgTexColor(OpenWithBrush); };
            OpenWith.Click      += delegate
            {
                FileHandling.Open_Save.OpenWith(Pics[FolderIndex]);
            };

            // ShowInFoler
            ShowInFoler.PreviewMouseLeftButtonDown += delegate { PreviewMouseButtonDownAnim(ShowInFolerFill); };
            ShowInFoler.MouseEnter += delegate { ButtonMouseOverAnim(ShowInFolerFill); };
            ShowInFoler.MouseEnter += delegate { AnimationHelper.MouseEnterBgTexColor(ShowInFolerBrush); };
            ShowInFoler.MouseLeave += delegate { ButtonMouseLeaveAnim(ShowInFolerFill); };
            ShowInFoler.MouseLeave += delegate { AnimationHelper.MouseLeaveBgTexColor(ShowInFolerBrush); };
            ShowInFoler.Click      += delegate
            {
                FileHandling.Open_Save.Open_In_Explorer();
            };

            FilenameCopy.TheButton.Click += delegate
            {
                Clipboard.SetText(FilenameBox.Text);
            };

            FolderCopy.TheButton.Click += delegate
            {
                Clipboard.SetText(FolderBox.Text);
            };

            FullpathCopy.TheButton.Click += delegate
            {
                Clipboard.SetText(FullPathBox.Text);
            };

            CreatedCopy.TheButton.Click += delegate
            {
                Clipboard.SetText(CreatedBox.Text);
            };

            ModifiedCopy.TheButton.Click += delegate
            {
                Clipboard.SetText(ModifiedBox.Text);
            };

            SizePxCopy.TheButton.Click += delegate
            {
                Clipboard.SetText(SizePxBox.Text);
            };

            SizeMpCopy.TheButton.Click += delegate
            {
                Clipboard.SetText(SizeMpBox.Text);
            };

            DpiCopy.TheButton.Click += delegate
            {
                Clipboard.SetText(ResolutionBox.Text);
            };

            PrintSizeCmCopy.TheButton.Click += delegate
            {
                Clipboard.SetText(PrintSizeCmBox.Text);
            };

            PrintSizeInCopy.TheButton.Click += delegate
            {
                Clipboard.SetText(PrintSizeInBox.Text);
            };

            AspectRatioCopy.TheButton.Click += delegate
            {
                Clipboard.SetText(AspectRatioBox.Text);
            };

            if (Pics.Count > 0)
            {
                UpdateValues();
            }
        }
 private void CloseWindow(object s, ExecutedRoutedEventArgs e)
 {
     SystemCommands.CloseWindow(this);
 }
Exemple #24
0
 private void btnBack_Click(object sender, RoutedEventArgs e)
 {
     SystemCommands.CloseWindow(this);
 }
 private void RestoreWindow(object s, ExecutedRoutedEventArgs e)
 {
     SystemCommands.RestoreWindow(this);
 }
Exemple #26
0
 private void SpecialCloseButton_Click(object sender, RoutedEventArgs e)
 {
     SystemCommands.CloseWindow(Window.GetWindow(this));
 }
 //MinimizeWindow
 private void Button_Click_MinimizeWindow(object sender, RoutedEventArgs e)
 {
     SystemCommands.MinimizeWindow(this);
 }
Exemple #28
0
 private void WindowIcon_MouseDown(object sender, RoutedEventArgs e)
 {
     SystemCommands.ShowSystemMenu(this, WindowIcon.PointToScreen(new System.Windows.Point(0, WindowIcon.ActualHeight)));
 }
 private void RestoreCommandHandler(object sender, ExecutedRoutedEventArgs e)
 {
     SystemCommands.RestoreWindow(this);
 }
Exemple #30
0
        private void AddGenericEvents(ColorAnimation colorAnimation)
        {
            KeyDown += (_, e) => Shortcuts.GenericWindowShortcuts.KeysDown(null, e, this);

            // CloseButton
            CloseButton.TheButton.Click += delegate { Hide(); };

            // MinButton
            MinButton.TheButton.Click += delegate { SystemCommands.MinimizeWindow(this); };

            TitleBar.MouseLeftButtonDown += delegate { DragMove(); };

            // BlueRadio
            BlueRadio.PreviewMouseLeftButtonDown += BlueRadio_PreviewMouseLeftButtonDown;
            BlueRadio.MouseEnter += BlueRadio_MouseEnter;
            BlueRadio.MouseLeave += BlueRadio_MouseLeave;
            BlueRadio.Click      += Blue;

            // PinkRadio
            PinkRadio.PreviewMouseLeftButtonDown += PinkRadio_PreviewMouseLeftButtonDown;
            PinkRadio.MouseEnter += PinkRadio_MouseEnter;
            PinkRadio.MouseLeave += PinkRadio_MouseLeave;
            PinkRadio.Click      += Pink;

            // OrangeRadio
            OrangeRadio.PreviewMouseLeftButtonDown += OrangeRadio_PreviewMouseLeftButtonDown;
            OrangeRadio.MouseEnter += OrangeRadio_MouseEnter;
            OrangeRadio.MouseLeave += OrangeRadio_MouseLeave;
            OrangeRadio.Click      += Orange;

            // GreenRadio
            GreenRadio.PreviewMouseLeftButtonDown += GreenRadio_PreviewMouseLeftButtonDown;
            GreenRadio.MouseEnter += GreenRadio_MouseEnter;
            GreenRadio.MouseLeave += GreenRadio_MouseLeave;
            GreenRadio.Click      += Green;

            // RedRadio
            RedRadio.PreviewMouseLeftButtonDown += RedRadio_PreviewMouseLeftButtonDown;
            RedRadio.MouseEnter += RedRadio_MouseEnter;
            RedRadio.MouseLeave += RedRadio_MouseLeave;
            RedRadio.Click      += Red;

            // TealRadio
            TealRadio.PreviewMouseLeftButtonDown += TealRadio_PreviewMouseLeftButtonDown;
            TealRadio.MouseEnter += TealRadio_MouseEnter;
            TealRadio.MouseLeave += TealRadio_MouseLeave;
            TealRadio.Click      += Teal;

            // AquaRadio
            AquaRadio.PreviewMouseLeftButtonDown += AquaRadio_PreviewMouseLeftButtonDown;
            AquaRadio.MouseEnter += AquaRadio_MouseEnter;
            AquaRadio.MouseLeave += AquaRadio_MouseLeave;
            AquaRadio.Click      += Aqua;

            // GoldenRadio
            GoldenRadio.PreviewMouseLeftButtonDown += GoldenRadio_PreviewMouseLeftButtonDown;
            GoldenRadio.MouseEnter += GoldenRadio_MouseEnter;
            GoldenRadio.MouseLeave += GoldenRadio_MouseLeave;
            GoldenRadio.Click      += Golden;

            // PurpleRadio
            PurpleRadio.PreviewMouseLeftButtonDown += PurpleRadio_PreviewMouseLeftButtonDown;
            PurpleRadio.MouseEnter += PurpleRadio_MouseEnter;
            PurpleRadio.MouseLeave += PurpleRadio_MouseLeave;
            PurpleRadio.Click      += Purple;

            // CyanRadio
            CyanRadio.PreviewMouseLeftButtonDown += CyanRadio_PreviewMouseLeftButtonDown;
            CyanRadio.MouseEnter += CyanRadio_MouseEnter;
            CyanRadio.MouseLeave += CyanRadio_MouseLeave;
            CyanRadio.Click      += Cyan;

            // MagentaRadio
            MagentaRadio.PreviewMouseLeftButtonDown += MagentaRadio_PreviewMouseLeftButtonDown;
            MagentaRadio.MouseEnter += MagentaRadio_MouseEnter;
            MagentaRadio.MouseLeave += MagentaRadio_MouseLeave;
            MagentaRadio.Click      += Magenta;

            // LimeRadio
            LimeRadio.Click += Lime;
            LimeRadio.PreviewMouseLeftButtonDown += LimeRadio_PreviewMouseLeftButtonDown;
            LimeRadio.MouseEnter += LimeRadio_MouseEnter;
            LimeRadio.MouseLeave += Lime_MouseLeave;

            // WallpaperApply
            WallpaperApply.MouseEnter += delegate
            {
                colorAnimation.From = AnimationHelper.GetPrefferedColorOver();
                colorAnimation.To   = AnimationHelper.GetPrefferedColorDown();
                WallpaperApplyBrush.BeginAnimation(SolidColorBrush.ColorProperty, colorAnimation);
            };
            WallpaperApply.MouseLeave += delegate
            {
                colorAnimation.From = AnimationHelper.GetPrefferedColorDown();
                colorAnimation.To   = AnimationHelper.GetPrefferedColorOver();
                WallpaperApplyBrush.BeginAnimation(SolidColorBrush.ColorProperty, colorAnimation);
            };

            // SetAsDefaultTxt
            SetAsDefaultTxt.MouseEnter += delegate
            {
                colorAnimation.From = AnimationHelper.GetPrefferedColorOver();
                colorAnimation.To   = AnimationHelper.GetPrefferedColorDown();
                SetAsDefaultTxtBrush.BeginAnimation(SolidColorBrush.ColorProperty, colorAnimation);
            };
            SetAsDefaultTxt.MouseLeave += delegate
            {
                colorAnimation.From = AnimationHelper.GetPrefferedColorDown();
                colorAnimation.To   = AnimationHelper.GetPrefferedColorOver();
                SetAsDefaultTxtBrush.BeginAnimation(SolidColorBrush.ColorProperty, colorAnimation);
            };

            // RestartTheme
            ThemeRestart.MouseEnter += delegate
            {
                colorAnimation.From = mainColor;
                colorAnimation.To   = AnimationHelper.GetPrefferedColorDown();
                ThemeRestartTxt.BeginAnimation(SolidColorBrush.ColorProperty, colorAnimation);
            };
            ThemeRestart.MouseLeave += delegate
            {
                colorAnimation.From = AnimationHelper.GetPrefferedColorDown();
                colorAnimation.To   = mainColor;
                ThemeRestartTxt.BeginAnimation(SolidColorBrush.ColorProperty, colorAnimation);
            };

            // LanguageRestart
            LanguageRestart.MouseEnter += delegate
            {
                colorAnimation.From = mainColor;
                colorAnimation.To   = AnimationHelper.GetPrefferedColorDown();
                LanguageRestartTxt.BeginAnimation(SolidColorBrush.ColorProperty, colorAnimation);
            };
            LanguageRestart.MouseLeave += delegate
            {
                colorAnimation.From = AnimationHelper.GetPrefferedColorDown();
                colorAnimation.To   = mainColor;
                LanguageRestartTxt.BeginAnimation(SolidColorBrush.ColorProperty, colorAnimation);
            };

            // DarkThemeRadio
            DarkThemeRadio.PreviewMouseLeftButtonDown += delegate { PreviewMouseButtonDownAnim(DarkThemeText); };
            DarkThemeRadio.MouseEnter += delegate { ButtonMouseOverAnim(DarkThemeText); };
            DarkThemeRadio.MouseEnter += delegate { AnimationHelper.MouseEnterBgTexColor(DarkThemeBrush); };
            DarkThemeRadio.MouseLeave += delegate { ButtonMouseLeaveAnim(DarkThemeText); };
            DarkThemeRadio.MouseLeave += delegate { AnimationHelper.MouseLeaveBgTexColor(DarkThemeBrush); };

            // LightThemeRadio
            LightThemeRadio.PreviewMouseLeftButtonDown += delegate { PreviewMouseButtonDownAnim(LightThemeText); };
            LightThemeRadio.MouseEnter += delegate { ButtonMouseOverAnim(LightThemeText); };
            LightThemeRadio.MouseEnter += delegate { AnimationHelper.MouseEnterBgTexColor(LightThemeBrush); };
            LightThemeRadio.MouseLeave += delegate { ButtonMouseLeaveAnim(LightThemeText); };
            LightThemeRadio.MouseLeave += delegate { AnimationHelper.MouseLeaveBgTexColor(LightThemeBrush); };

            // SubDirRadio
            SubDirRadio.PreviewMouseLeftButtonDown += delegate { PreviewMouseButtonDownAnim(SubDirText); };
            SubDirRadio.MouseEnter += delegate { ButtonMouseOverAnim(SubDirText); };
            SubDirRadio.MouseLeave += delegate { ButtonMouseLeaveAnim(SubDirText); };

            // TopmostRadio
            TopmostRadio.PreviewMouseLeftButtonDown += delegate { PreviewMouseButtonDownAnim(TopMostDirText); };
            TopmostRadio.MouseEnter += delegate { ButtonMouseOverAnim(TopMostDirText); };
            TopmostRadio.MouseLeave += delegate { ButtonMouseLeaveAnim(TopMostDirText); };

            // CenterRadio
            CenterRadio.PreviewMouseLeftButtonDown += delegate { PreviewMouseButtonDownAnim(CenterubDirText); };
            CenterRadio.MouseEnter += delegate { ButtonMouseOverAnim(CenterubDirText); };
            CenterRadio.MouseLeave += delegate { ButtonMouseLeaveAnim(CenterubDirText); };

            // BorderRadio
            BorderRadio.PreviewMouseLeftButtonDown += delegate { PreviewMouseButtonDownAnim(BorderBrushText); };
            BorderRadio.MouseEnter += delegate { ButtonMouseOverAnim(BorderBrushText); };
            BorderRadio.MouseLeave += delegate { ButtonMouseLeaveAnim(BorderBrushText); };

            // AltUIRadio
            AltUIRadio.PreviewMouseLeftButtonDown += delegate { PreviewMouseButtonDownAnim(AltUIText); };
            AltUIRadio.MouseEnter += delegate { ButtonMouseOverAnim(AltUIText); };
            AltUIRadio.MouseLeave += delegate { ButtonMouseLeaveAnim(AltUIText); };

            // ScrollZoom
            ScrollZoom.PreviewMouseLeftButtonDown += delegate { PreviewMouseButtonDownAnim(ScrollZoomText); };
            ScrollZoom.MouseEnter += delegate { ButtonMouseOverAnim(ScrollZoomText); };
            ScrollZoom.MouseLeave += delegate { ButtonMouseLeaveAnim(ScrollZoomText); };

            // CtrlZoom
            CtrlZoom.PreviewMouseLeftButtonDown += delegate { PreviewMouseButtonDownAnim(CtrlZoomText); };
            CtrlZoom.MouseEnter += delegate { ButtonMouseOverAnim(CtrlZoomText); };
            CtrlZoom.MouseLeave += delegate { ButtonMouseLeaveAnim(CtrlZoomText); };

            if (!Properties.Settings.Default.DarkTheme)
            {
                BlueRadio.MouseEnter += delegate
                {
                    colorAnimation.From = Color.FromArgb(mainColor.A, mainColor.R, mainColor.G, mainColor.B);
                    colorAnimation.To   = Colors.White;
                    BlueText.BeginAnimation(SolidColorBrush.ColorProperty, colorAnimation);
                };
                BlueRadio.MouseLeave += delegate
                {
                    colorAnimation.From = Colors.White;
                    colorAnimation.To   = Color.FromArgb(mainColor.A, mainColor.R, mainColor.G, mainColor.B);
                    BlueText.BeginAnimation(SolidColorBrush.ColorProperty, colorAnimation);
                };

                CyanRadio.MouseEnter += delegate
                {
                    colorAnimation.From = Color.FromArgb(mainColor.A, mainColor.R, mainColor.G, mainColor.B);
                    colorAnimation.To   = Colors.White;
                    CyanText.BeginAnimation(SolidColorBrush.ColorProperty, colorAnimation);
                };
                CyanRadio.MouseLeave += delegate
                {
                    colorAnimation.From = Colors.White;
                    colorAnimation.To   = Color.FromArgb(mainColor.A, mainColor.R, mainColor.G, mainColor.B);
                    CyanText.BeginAnimation(SolidColorBrush.ColorProperty, colorAnimation);
                };

                AquaRadio.MouseEnter += delegate
                {
                    colorAnimation.From = Color.FromArgb(mainColor.A, mainColor.R, mainColor.G, mainColor.B);
                    colorAnimation.To   = Colors.White;
                    AquaText.BeginAnimation(SolidColorBrush.ColorProperty, colorAnimation);
                };
                AquaRadio.MouseLeave += delegate
                {
                    colorAnimation.From = Colors.White;
                    colorAnimation.To   = Color.FromArgb(mainColor.A, mainColor.R, mainColor.G, mainColor.B);
                    AquaText.BeginAnimation(SolidColorBrush.ColorProperty, colorAnimation);
                };

                TealRadio.MouseEnter += delegate
                {
                    colorAnimation.From = Color.FromArgb(mainColor.A, mainColor.R, mainColor.G, mainColor.B);
                    colorAnimation.To   = Colors.White;
                    TealText.BeginAnimation(SolidColorBrush.ColorProperty, colorAnimation);
                };
                TealRadio.MouseLeave += delegate
                {
                    colorAnimation.From = Colors.White;
                    colorAnimation.To   = Color.FromArgb(mainColor.A, mainColor.R, mainColor.G, mainColor.B);
                    TealText.BeginAnimation(SolidColorBrush.ColorProperty, colorAnimation);
                };

                LimeRadio.MouseEnter += delegate
                {
                    colorAnimation.From = Color.FromArgb(mainColor.A, mainColor.R, mainColor.G, mainColor.B);
                    colorAnimation.To   = Colors.White;
                    LimeText.BeginAnimation(SolidColorBrush.ColorProperty, colorAnimation);
                };
                LimeRadio.MouseLeave += delegate
                {
                    colorAnimation.From = Colors.White;
                    colorAnimation.To   = Color.FromArgb(mainColor.A, mainColor.R, mainColor.G, mainColor.B);
                    LimeText.BeginAnimation(SolidColorBrush.ColorProperty, colorAnimation);
                };

                GreenRadio.MouseEnter += delegate
                {
                    colorAnimation.From = Color.FromArgb(mainColor.A, mainColor.R, mainColor.G, mainColor.B);
                    colorAnimation.To   = Colors.White;
                    GreenText.BeginAnimation(SolidColorBrush.ColorProperty, colorAnimation);
                };
                GreenRadio.MouseLeave += delegate
                {
                    colorAnimation.From = Colors.White;
                    colorAnimation.To   = Color.FromArgb(mainColor.A, mainColor.R, mainColor.G, mainColor.B);
                    GreenText.BeginAnimation(SolidColorBrush.ColorProperty, colorAnimation);
                };

                GoldenRadio.MouseEnter += delegate
                {
                    colorAnimation.From = Color.FromArgb(mainColor.A, mainColor.R, mainColor.G, mainColor.B);
                    colorAnimation.To   = Colors.White;
                    GoldenText.BeginAnimation(SolidColorBrush.ColorProperty, colorAnimation);
                };
                GoldenRadio.MouseLeave += delegate
                {
                    colorAnimation.From = Colors.White;
                    colorAnimation.To   = Color.FromArgb(mainColor.A, mainColor.R, mainColor.G, mainColor.B);
                    GoldenText.BeginAnimation(SolidColorBrush.ColorProperty, colorAnimation);
                };

                OrangeRadio.MouseEnter += delegate
                {
                    colorAnimation.From = Color.FromArgb(mainColor.A, mainColor.R, mainColor.G, mainColor.B);
                    colorAnimation.To   = Colors.White;
                    OrangeText.BeginAnimation(SolidColorBrush.ColorProperty, colorAnimation);
                };
                OrangeRadio.MouseLeave += delegate
                {
                    colorAnimation.From = Colors.White;
                    colorAnimation.To   = Color.FromArgb(mainColor.A, mainColor.R, mainColor.G, mainColor.B);
                    OrangeText.BeginAnimation(SolidColorBrush.ColorProperty, colorAnimation);
                };

                RedRadio.MouseEnter += delegate
                {
                    colorAnimation.From = Color.FromArgb(mainColor.A, mainColor.R, mainColor.G, mainColor.B);
                    colorAnimation.To   = Colors.White;
                    RedText.BeginAnimation(SolidColorBrush.ColorProperty, colorAnimation);
                };
                RedRadio.MouseLeave += delegate
                {
                    colorAnimation.From = Colors.White;
                    colorAnimation.To   = Color.FromArgb(mainColor.A, mainColor.R, mainColor.G, mainColor.B);
                    RedText.BeginAnimation(SolidColorBrush.ColorProperty, colorAnimation);
                };

                PinkRadio.MouseEnter += delegate
                {
                    colorAnimation.From = Color.FromArgb(mainColor.A, mainColor.R, mainColor.G, mainColor.B);
                    colorAnimation.To   = Colors.White;
                    PinkText.BeginAnimation(SolidColorBrush.ColorProperty, colorAnimation);
                };
                PinkRadio.MouseLeave += delegate
                {
                    colorAnimation.From = Colors.White;
                    colorAnimation.To   = Color.FromArgb(mainColor.A, mainColor.R, mainColor.G, mainColor.B);
                    PinkText.BeginAnimation(SolidColorBrush.ColorProperty, colorAnimation);
                };

                MagentaRadio.MouseEnter += delegate
                {
                    colorAnimation.From = Color.FromArgb(mainColor.A, mainColor.R, mainColor.G, mainColor.B);
                    colorAnimation.To   = Colors.White;
                    MagentaText.BeginAnimation(SolidColorBrush.ColorProperty, colorAnimation);
                };
                MagentaRadio.MouseLeave += delegate
                {
                    colorAnimation.From = Colors.White;
                    colorAnimation.To   = Color.FromArgb(mainColor.A, mainColor.R, mainColor.G, mainColor.B);
                    MagentaText.BeginAnimation(SolidColorBrush.ColorProperty, colorAnimation);
                };

                PurpleRadio.MouseEnter += delegate
                {
                    colorAnimation.From = Color.FromArgb(mainColor.A, mainColor.R, mainColor.G, mainColor.B);
                    colorAnimation.To   = Colors.White;
                    PurpleText.BeginAnimation(SolidColorBrush.ColorProperty, colorAnimation);
                };
                PurpleRadio.MouseLeave += delegate
                {
                    colorAnimation.From = Colors.White;
                    colorAnimation.To   = Color.FromArgb(mainColor.A, mainColor.R, mainColor.G, mainColor.B);
                    PurpleText.BeginAnimation(SolidColorBrush.ColorProperty, colorAnimation);
                };
            }
        }
 private void HideWindow_Click(object sender, RoutedEventArgs e)
 {
     SystemCommands.MinimizeWindow(this);
 }
Exemple #32
0
 private void OnShowSystemMenu(object sender, ExecutedRoutedEventArgs e)
 {
     SystemCommands.ShowSystemMenu(this, GetMousePosition());
 }
 // Close
 private void CommandBinding_Executed_Close(object sender, ExecutedRoutedEventArgs e)
 {
     SystemCommands.CloseWindow(this);
 }
Exemple #34
0
 public static async Task ExecuteAction(SystemCommands command)
 {
     await ConnectionManager.ExecuteRPCRequest("System." + command.ToString());
 }