void UpdateLastClickWasTouch()
 {
     if (_target != null)
     {
         AttachedProperties.SetLastClickWasTouch(AssociatedObject, AttachedProperties.GetLastClickWasTouch(_target));
     }
 }
Exemplo n.º 2
0
        protected override void OnAttached()
        {
            base.OnAttached();

            DependencyPropertyDescriptor.FromProperty(FrameworkElement.ContextMenuProperty, typeof(FrameworkElement)).AddValueChanged(AssociatedObject, UpdateContextMenu);

            UpdateEventHandlers();
            if (AssociatedObject.ContextMenu != null)
            {
                AttachedProperties.SetLastClickWasTouch(AssociatedObject, AttachedProperties.GetLastClickWasTouch(AssociatedObject.ContextMenu));
            }
        }
Exemplo n.º 3
0
        private void AssociatedObject_PreviewMouseDown(object sender, MouseButtonEventArgs e)
        {
            if (e.OriginalSource is UIElement srcUiel)
            {
                AttachedProperties.SetLastClickWasTouch(AssociatedObject, srcUiel.AreAnyTouchesOver);

                Debug.WriteLine("AssociatedObject_PreviewMouseDown, " + AttachedProperties.GetLastClickWasTouch(AssociatedObject).ToString());
            }
            else
            {
                Debug.WriteLine("AssociatedObject_PreviewMouseDown, null");
            }
        }