Ejemplo n.º 1
0
        public void OpenRadialMenu(Rect viewport, Point center, RadialMenuState.Levels level)
        {
            if (CurrentState.State != LayerStackState.States.OnlyManipulating)
            {
                // Need to temporarily disable the Drawing (to undo the current drawing)
                var previousState = CurrentState.State;
                CurrentState.SetState(LayerStackState.States.OnlyManipulating);
                RaisePropertyChanged("CurrentState");
                CurrentState.SetState(previousState);
                RaisePropertyChanged("CurrentState");
            }

            var radialMenuRadius = 150;

            center.X = Math.Max(center.X, 0 + radialMenuRadius);
            center.Y = Math.Max(center.Y, 0 + radialMenuRadius);
            center.X = Math.Min(center.X, viewport.Width - radialMenuRadius);
            center.Y = Math.Min(center.Y, viewport.Height - radialMenuRadius);
            RadialMenuState.Open(level, center);
        }
Ejemplo n.º 2
0
        public void OpenRadialMenu(Rect viewport, Point center, RadialMenuState.Levels level)
        {
            if (CurrentState.State != LayerStackState.States.OnlyManipulating)
            {
                // Need to temporarily disable the Drawing (to undo the current drawing)
                var previousState = CurrentState.State;
                CurrentState.SetState(LayerStackState.States.OnlyManipulating);
                RaisePropertyChanged("CurrentState");
                CurrentState.SetState(previousState);
                RaisePropertyChanged("CurrentState");
            }

            var radialMenuRadius = 150;
            center.X = Math.Max(center.X, 0 + radialMenuRadius);
            center.Y = Math.Max(center.Y, 0 + radialMenuRadius);
            center.X = Math.Min(center.X, viewport.Width - radialMenuRadius);
            center.Y = Math.Min(center.Y, viewport.Height - radialMenuRadius);
            RadialMenuState.Open(level, center);
        }