Ejemplo n.º 1
0
        /* ---------------------------------------------------- */
        //       Initialize
        /* ---------------------------------------------------- */
        private void InitEventHandler()
        {
            // キー
            MainWindow.Current.KeyDown += this.MainWindow_KeyDown;

            // マウスインプット マウスジェスチャー
            MainWindow.Current.MouseWheel       += this.MainWindow_MouseWheel;
            MainWindow.Current.MouseDown        += this.MainWindow_MouseDown;
            MainWindow.Current.MouseUp          += this.MainWindow_MouseUp;
            MainWindow.Current.MouseMove        += this.MainWindow_MouseMove;
            MainWindow.Current.MouseDoubleClick += this.MainWindow_MouseDoubleClick;

            // 左クリック後、ドラッグでウインドウドラッグ可能に
            windowDragMove = new WindowDragMove(MainWindow.Current);
            windowDragMove.CanDragStart = () => {
                if (MainWindow.Current.Setting.TempProfile.IsFullScreenMode.Value)
                {
                    return(false);
                }
                if (MainWindow.Current.TileExpantionPanel.IsShowing && MainWindow.Current.TileExpantionPanel.ZoomFactor > 1.0)
                {
                    return(false);
                }
                return(true);
            };
            windowDragMove.DragMoved += (s, e) => { mouseButtonStateSet.L.CommandExecuted = true; };

            // 左クリック後、拡大パネル拡大中ならパネルを移動可能に
            tileExpantionPanelDragMove = new TileExpantionPanelDragMove(MainWindow.Current);
            tileExpantionPanelDragMove.CanDragStart = () => {
                var panel = MainWindow.Current.TileExpantionPanel;
                if (panel.IsShowing && panel.IsAnimationCompleted && panel.ZoomFactor > 1.0)
                {
                    return(true);
                }
                return(false);
            };
            tileExpantionPanelDragMove.DragMoved += (s, e) => { mouseButtonStateSet.L.CommandExecuted = true; };
        }
 private void OnDrag() => WindowDragMove?.Invoke();