Developing Mobile Apps — Question 14
You are developing a Universal Windows Platform (UWP) app.
You need to provide a solution that moves the scroll bars of the ScrollViewer when a user rotates the mouse wheel.
Which two actions should you perform? Each correct answer presents part of the solution.
Answer options
- A. Evaluate the CurrentPoint.Properties.MouseWheelDelta property of the PointerEvenArgs object. Call the ChangeView() method of the ScrollViewer.
- B. Update the XAML of the ScrollViewer to include the PointerWheelChanged event with a new event handler. Evaluate the Pointer.IsInRange property of the PointerRoutedEventArgs object within the event handler. Call the ChangeView() method of the ScrollViewer.
- C. Add an event handler to the PointerRoutedAway event for the current window.
- D. Evaluate the CurrentPoint.Properties.IsHorizontalMouseWheel property of the PointerEventArgs object. Call the ChangeView() method of the ScrollViewer.
- E. Add an event handler to the PointerWheelChanged event for the current window. CD
Correct answer:
Explanation
The correct actions are A and E. Option A evaluates the mouse wheel delta and correctly calls ChangeView() to adjust the ScrollViewer. Option E sets up the necessary event handler to respond to the mouse wheel changes. Options B, C, and D do not provide the required solution for handling mouse wheel events in relation to the ScrollViewer.