Esempio n. 1
0
        private void Canvas_MouseMove(object sender, MouseEventArgs e)
        {
            {
                if (Mouse.LeftButton == MouseButtonState.Pressed)
                {
                    if (this.Cursor != Cursors.SizeAll)
                    {
                        this.Cursor = Cursors.SizeAll;
                    }
                    if (ObservableFigure != null)
                    {
                        Point pt = e.GetPosition(canvas);

                        menuState.MouseMove(pt);

                        return;
                    }
                    if (SelectedFigure != null)
                    {
                        Point pt = e.GetPosition(canvas);
                        menuState.MouseMove(pt);
                        return;
                    }
                    if (menuState != null)
                    {
                        // zaleznie od stanu podejmujemy akcje

                        if (this.Cursor != Cursors.Hand) //Cursors.SizeNESW
                        {
                            this.Cursor = Cursors.Hand;
                        }

                        Point pt = e.GetPosition(canvas); // punkt przechwycony ze zdarzenia myszy

                        menuState.MouseMove(pt);          //to draw and resize
                    }
                }
            }
        }