1
votes

I have Implemented a customer signature area in this way. User can draw his signature on this canvas.

contacts = new Dictionary<uint, Windows.UI.Xaml.Input.Pointer>((int)touchCapabilities.Contacts);
// Declare the pointer event handlers.
Target.PointerPressed += new PointerEventHandler(Target_PointerPressed);
//Target.PointerEntered += new PointerEventHandler(Target_PointerEntered);
Target.PointerReleased += new PointerEventHandler(Target_PointerReleased);
Target.PointerExited += new PointerEventHandler(Target_PointerExited);
//Target.PointerCanceled += new PointerEventHandler(Target_PointerCanceled);
Target.PointerCaptureLost += new PointerEventHandler(Target_PointerCaptureLost);
Target.PointerMoved += new PointerEventHandler(Target_PointerMoved);
Target.PointerWheelChanged += new PointerEventHandler(Target_PointerWheelChanged);

renderer = new XamlInkRenderer(CaptureArea);

Now what I want to do is disable the drawings on this canvas (CaptureArea). After disabling it there should not any event generate for user interactions on this canvas. Also I want to re-enable the user interaction if some conditions are satisfied. How can I achieve this? I cannot see any disable function related to canvas object or XamlInkRenderer object. Please help me. Thanks

1
Have you tried IsHitTestVisible property? Set it false to disable and true to enable. It is available with Canvas as well.Gaurang Dave
Thanks! Seems its workingswift droid
I have put the same as answer below. Please mark it as an answer and upvote so other user also can take reference when needed. Cheers ! :)Gaurang Dave
Done! But I cannot up vote since I'm less than 15 reputations :)swift droid
No problem. If you remember in future , upvote it. I think Your reputation is enough to do that. :)Gaurang Dave

1 Answers

1
votes

You can use IsHitTestVisible property for UIElement. Set it false to disable and true to enable based on conditions you have. It is available with Canvas as well.

From MSDN:

Gets or sets a value that declares whether this element can possibly be returned as a hit test result from some portion of its rendered content. This is a dependency property.