Exemple #1
0
    protected override void OnEnable()
    {
        CreateGustures();
        if (_ScaleDetector != null)
        {
            _ScaleDetector.IsEnabled = true;
        }
        if (_DragDetector != null)
        {
            _DragDetector.IsEnabled = SelectedElement != null;
        }
        if (_TapDetector != null)
        {
            _TapDetector.IsEnabled = true;
        }

        if (Elements != null)
        {
            foreach (var e in Elements)
            {
                if (e != null)
                {
                    e.enabled = false;
                }
            }
        }
        if (SelectedElement == null && Elements != null)
        {
            SelectedElement = Elements[0];
        }
    }
Exemple #2
0
    protected virtual void OnDisable()
    {
        SelectedElement = null;

        if (_ScaleDetector != null)
        {
            _ScaleDetector.IsEnabled = false;
        }
        if (_DragDetector != null)
        {
            _DragDetector.IsEnabled = false;
        }
        if (_TapDetector != null)
        {
            _TapDetector.IsEnabled = false;
        }

        if (Elements != null)
        {
            foreach (var e in Elements)
            {
                if (e != null)
                {
                    e.enabled = true;
                }
            }
        }
    }
Exemple #3
0
 void JoyElementResizer_Tap(object sender, TapGestureEventArgs args)
 {
     foreach (var item in Elements)
     {
         if (item != null)
         {
             if (item.RenderArea.Contains(args.Positions[0]))
             {
                 SelectedElement = item;
                 break;
             }
         }
     }
 }