private void OnTouchAction(object sender, TouchActionEventArgs args)
        {
            if (args.Type == TouchActionType.Entered)
            {
                IsMouseOver = true;
            }
            else if (args.Type == TouchActionType.Exited)
            {
                IsPressed   = false;
                IsMouseOver = false;
            }
            else if (args.Type == TouchActionType.Pressed)
            {
                IsPressed = true;
            }
            else if (args.Type == TouchActionType.Released && IsPressed)
            {
                IsPressed = false;

                IsToggled = !IsToggled;

                IsToggledChanged?.Invoke(this, IsToggled);

                ToggledCommand?.Execute(null);
            }
        }
Esempio n. 2
0
 public void OnTouchAction(Element element, TouchActionEventArgs args)
 {
     TouchAction?.Invoke(element, args);
 }