示例#1
0
        protected override void TouchGestureMessage(object sender, TouchType type, float force, ref bool handled)
        {
            if (Children == null)
            {
                return;
            }

            if (type == TouchType.GestureRight)
            {
                int newSel = _selIndex - 1;
                if (newSel < 0)
                {
                    newSel = Children.Length - 1;
                }
                SelectedIndex = newSel;
            }
            else if (type == TouchType.GestureLeft)
            {
                int newSel = _selIndex + 1;
                if (newSel > Children.Length - 1)
                {
                    newSel = 0;
                }
                SelectedIndex = newSel;
            }

            if (ActiveChild != null)
            {
                handled = true;
                ActiveChild.SendTouchGesture(sender, type, force);
            }
        }
示例#2
0
文件: Tab.cs 项目: piwi1263/Tinkr
 protected override void TouchGestureMessage(object sender, TouchType type, float force, ref bool handled)
 {
     if (ActiveChild != null)
     {
         handled = true;
         ActiveChild.SendTouchGesture(sender, type, force);
     }
 }
示例#3
0
文件: Panel.cs 项目: valoni/Tinkr
 /// <summary>
 /// Override this message to handle touch events internally.
 /// </summary>
 /// <param name="sender">Object sending the event</param>
 /// <param name="type">Type of touch gesture</param>
 /// <param name="force">Force associated with gesture (0.0 to 1.0)</param>
 /// <param name="handled">true if the event is handled. Set to true if handled.</param>
 /// <remarks>
 /// Forwards the message to <see cref="Container.ActiveChild"/>
 /// </remarks>
 protected override void TouchGestureMessage(object sender, TouchType type, float force, ref bool handled)
 {
     //TODO: check if this code shouldn't go to Container
     if (ActiveChild != null)
     {
         handled = true;
         ActiveChild.SendTouchGesture(sender, type, force);
     }
 }