PrepAway - Latest Free Exam Questions & Answers

Which two actions should you perform?

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. process. https://docs.microsoft.com/en-us/uwp/api/

PrepAway - Latest Free Exam Questions & Answers

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.

Explanation:
The PointerRoutedAway event occurs on the process receiving input when the pointer input is routed to another

https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.controls.scrollviewer
windows.ui.core.corewindow#Windows_UI_Core_CoreWindow_PointerWheelChanged

One Comment on “Which two actions should you perform?

  1. Dymlx says:

    Correct answer is AE.
    public sealed partial class MainPage : Page
    {
    public MainPage()
    {
    this.InitializeComponent();
    Window.Current.CoreWindow.PointerWheelChanged += CoreWindow_PointerWheelChanged; //E
    }
    private double _verticalOffset = 0;
    private void CoreWindow_PointerWheelChanged(CoreWindow sender, PointerEventArgs args)
    {
    //A
    _verticalOffset += args.CurrentPoint.Properties.MouseWheelDelta;
    ScrollView.ChangeView(null, _verticalOffset * (-1), null);
    }
    }




    20



    0

Leave a Reply