PrepAway - Latest Free Exam Questions & Answers

Which three events should you handle?

You are building a Universal Windows Platform (UWP) app that will be used to view images.
When a user clicks an image by using a mouse, the image will increase in size by 20 percent, and then return
to its original size when the user releases the mouse.
You create event handlers to handle the PointerPressed and PointerReleased events for the image.
The user reports that occasionally, the image fails to return to its original size.
You need to ensure that the image returns to its original size.
Which three events should you handle? Each correct answer presents part of the solution.

PrepAway - Latest Free Exam Questions & Answers

A.
PointerExited

B.
PointerCaptureLost

C.
LostFocus

D.
PointerCanceled

E.
PointerMoved

F.
LostMouseCappture

Explanation:
B:PointerCaptureLost might fire instead of PointerReleased. Don’t rely on PointerPressed and PointerReleased
events always occurring in pairs. To function properly, your app must listen for and handle all events that
represent likely conclusions to the Press action, and that includes PointerCaptureLost.
BD:Other events instead of PointerReleased may fire at the end of the action—for example, PointerCanceled or
PointerCaptureLost.
E:Mouse input is associated with a single pointer assigned when mouse input is first detected. Clicking a
mouse button (left, wheel, or right) creates a secondary association between the pointer and that button through
the PointerPressed event. The PointerReleased event is fired only when that same mouse button is released
(no other button can be associated with the pointer until this event is complete). Because of this exclusive
association, other mouse button clicks are routed through the PointerMoved event.

https://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.uielement.pointerreleased.aspx


Leave a Reply