Trigger Touch Events for Palette

Hi Team,

I could not able to trigger the touch events TouchDown,TouchUp,TouchMove and TouchLeave from the PaletteControl.
I am just triggeringr the event in code behind file itself. But i am not getting it. But i could get the PreviewMouseLeftButtonDown event for the same when i tried to touch the palette area.

Please find below XAML code, And In code behind file, i have event handlers for all the touch events.
<go:Palette DragSelectingTool="{x:Null}"
Model="{Binding Path=Model, Mode=OneWay}"
NodeTemplateDictionary ="{Binding Path=PalletNodeTemplateDictionary, Mode=OneWay}"
GroupTemplate="{Binding Path=GroupTemplate, Mode=TwoWay}"
TouchDown=“palette_TouchDown” TouchMove=“palette_TouchMove” TouchUp=“palette_TouchUp”
PreviewTouchDown=“palette_PreviewTouchDown” PreviewTouchMove=“palette_PreviewTouchMove” PreviewTouchUp=“palette_PreviewTouchUp”>

When I try running the Flow Chart sample on a Surface 4, I am able to drag nodes from the Palette onto the target Diagram with my finger.

Are you trying to implement something other than drag-and-drop?

Actually i need a Source object(Palette object) which has triggered that event. So with that source object i could set some properties.

As per the Touch Events trigger order, first Touch event will be triggered and then the Mouse Event will get triggered.

But when i tried to implement that in Palette, and once i touched the palette only the mouse event is triggering.

Try implementing Touch.FrameReported. That’s how I have implemented pinch zooming and other gestures.

I have tried this,
Touch.FrameReported += Touch_FrameReported;
private void Touch_FrameReported(object sender, TouchFrameEventArgs e)
{

    }

and that is also not triggering Touch event.

    bool SecondaryTouchOccurred { get; set; }

    private void Touch_FrameReported(object sender, TouchFrameEventArgs e) {
      var touchpoints = e.GetTouchPoints(myDiagram.Panel);
      if (touchpoints.Count > 1 && !this.SecondaryTouchOccurred) {
        this.SecondaryTouchOccurred = true;
        // ignoring mouse events
        myDiagram.Panel.IgnoresMouseEvents = true;
        myDiagram.CurrentTool.DoCancel();
      }
      var prim = e.GetPrimaryTouchPoint(myDiagram.Panel);
      if (prim != null) {
        if (prim.Action == TouchAction.Down) {
          . . .
        } else if (prim.Action == TouchAction.Move) {
          . . .
        } else if (prim.Action == TouchAction.Up) {
          . . .
        }
      }
    }

EDIT: Sorry, never mind: DiagramPanel.IgnoresMouseEvents is not public.

Hi Walter,

The touch events were not raised because of the environment issue.
It is because of the latest windows security update.
Please refer below link,

As per the link, WPF application crashes.
But what i was trying to do is that accessing my development PC via remote in that Touch supported PC.
So i was not getting Touch events because of that update.

Now everything works fine and i am closing this.

Thanks for the updated info.