示例#1
0
        internal void SelectShape(MouseButtonEventArgs e, Point position)
        {
            Model.Shape shape = null;
            try
            {
                shape = _shapes.First(x => (x.Value == (FrameworkElement)e.OriginalSource)).Key;
                Mouse.OverrideCursor = Cursors.SizeAll;
            }
            catch (InvalidOperationException ex)
            {
            }
            switch (Modus)
            {
            case Modus.Move:
                _model.SelectShape(shape, position);
                break;

            case Modus.BottomCenter:
            case Modus.BottomLeft:
            case Modus.BottomRight:
            case Modus.CenterLeft:
            case Modus.CenterRight:
            case Modus.TopCenter:
            case Modus.TopLeft:
            case Modus.TopRight:
                _model.SetProjectedWidthAndHeight(position);
                break;

            case Modus.TurnHandle:
                _model.TurnShape(position);
                break;
            }
        }
示例#2
0
        internal void SelectShape(PointerRoutedEventArgs e, Point position)
        {
            Model.Shape shape = null;
            try
            {
                shape = _shapes.First(x => (x.Value == (FrameworkElement)e.OriginalSource)).Key;
                Window.Current.CoreWindow.PointerCursor = new Windows.UI.Core.CoreCursor(Windows.UI.Core.CoreCursorType.SizeAll, 1);
            }
            catch (InvalidOperationException ex)
            {
            }
            switch (Modus)
            {
            case Modus.Move:
                _model.SelectShape(shape, position);
                break;

            case Modus.BottomCenter:
            case Modus.BottomLeft:
            case Modus.BottomRight:
            case Modus.CenterLeft:
            case Modus.CenterRight:
            case Modus.TopCenter:
            case Modus.TopLeft:
            case Modus.TopRight:
                _model.SetProjectedWidthAndHeight(position);
                break;

            case Modus.TurnHandle:
                _model.TurnShape(position);
                break;
            }
        }