Exemplo n.º 1
0
        public override void OnAccept(UserInterfaceActionEventArgs args)
        {
            if (!Props.Enabled)
            {
                return;
            }

            if (Props.OnAccept != null)
            {
                Props.OnAccept.Invoke(EventData);
                args.Handled = true;
            }
        }
Exemplo n.º 2
0
        public override void OnChildAction(IRenderElement child, UserInterfaceActionEventArgs action)
        {
            bool moved      = false;
            int  FocusIndex = focusChildren.IndexOf(child);
            var  button     = action.Action;

            if (Direction == FlexDirection.Column || Direction == FlexDirection.ColumnReverse)
            {
                if (button == UserInterfaceAction.Up)
                {
                    moved = MovePrevious();
                }
                if (button == UserInterfaceAction.Down)
                {
                    moved = MoveNext();
                }
            }
            else
            {
                if (button == UserInterfaceAction.Left)
                {
                    moved = MovePrevious();
                }
                if (button == UserInterfaceAction.Right)
                {
                    moved = MoveNext();
                }
            }

            action.Handled = moved;

            if (!moved)
            {
                if (button == UserInterfaceAction.Cancel && Props.OnCancel != null)
                {
                    Props.OnCancel(EventData);
                    action.Handled = moved;
                }
            }

            if (!Props.AllowNavigate)
            {
                action.Handled = true;
            }

            base.OnChildAction(this, action);
        }