示例#1
0
        /// <summary>
        /// Occurs when the control handles a <see cref="Touch.LostNewTouchCaptureEvent"/> routed event.
        /// </summary>
        private static void HandleLostNewTouchCapture(DependencyObject dobj, RoutedEventData data)
        {
            var comboBox = (ComboBox)dobj;

            if (comboBox.Ultraviolet.GetInput().IsMouseCursorAvailable)
            {
                return;
            }

            if (comboBox != data.OriginalSource)
            {
                if (comboBox.ContainsDescendant(data.OriginalSource as DependencyObject))
                {
                    if (Touch.GetCapturedNew(comboBox.View) == null)
                    {
                        Touch.CaptureNew(comboBox.View, comboBox, CaptureMode.SubTree);
                        data.Handled = true;
                    }
                }
                else
                {
                    comboBox.IsDropDownOpen = false;
                }
            }
        }
示例#2
0
        /// <summary>
        /// Occurs when the control handles a <see cref="Touch.TouchDownEvent"/> routed event.
        /// </summary>
        private static void HandleTouchDown(DependencyObject dobj, TouchDevice device, Int64 touchID, Double x, Double y, Single pressure, RoutedEventData data)
        {
            var comboBox = (ComboBox)dobj;

            if (comboBox.Ultraviolet.GetInput().IsMouseCursorAvailable)
            {
                return;
            }

            if (comboBox == Touch.GetCapturedNew(comboBox.View) && comboBox == data.OriginalSource)
            {
                comboBox.IsDropDownOpen = false;
            }
        }