Пример #1
0
        protected override void TouchDownMessage(object sender, point point, ref bool handled)
        {
            // Check Controls
            if (Children != null)
            {
                lock (Children)
                {
                    int i;
                    for (i = Children.Length - 1; i >= 0; i--)
                    {
                        if (Children[i].Visible && Children[i].HitTest(point))
                        {
                            ActiveChild = Children[i];
                            Children[i].SendTouchDown(this, point);
                            handled = true;
                            return;
                        }
                    }
                }
            }

            if (ActiveChild != null)
            {
                ActiveChild.Blur();
                Render(ActiveChild.ScreenBounds, true);
                ActiveChild = null;
            }

            _touch = true;
        }
Пример #2
0
        /// <summary>
        /// Override this message to handle touch events internally.
        /// </summary>
        /// <param name="sender">Object sending the event</param>
        /// <param name="point">Point on screen touch event is occurring</param>
        /// <param name="handled">true if the event is handled. Set to true if handled.</param>
        /// <remarks>
        /// Forwards the message to the top most child under the point.
        /// The hit child is made the active child.
        /// </remarks>
        protected override void TouchDownMessage(object sender, point point, ref bool handled)
        {
            //TODO: check if this code shouldn't go to Container
            // Check Controls
            if (Children != null)
            {
                lock (Children)
                {
                    for (var i = Children.Length - 1; i >= 0; i--)
                    {
                        if (Children[i].Visible && Children[i].HitTest(point))
                        {
                            ActiveChild = Children[i];
                            Children[i].SendTouchDown(this, point);
                            handled = true;
                            return;
                        }
                    }
                }
            }

            if (ActiveChild != null)
            {
                ActiveChild.Blur();
                Render(ActiveChild.ScreenBounds, true);
                ActiveChild = null;
            }

            //TODO: check if _touch shouldn't be set to true here
        }