Private Sub NavigateButton_Click(sender As Object, e As RoutedEventArgs)
ProgressRing1.IsActive = True
' Provide an indication as to where we are trying to navigate to
rootPage.NotifyUser(String.Format("Navigating to: {0}", Address.Text), NotifyType.StatusMessage)
' Hook the LoadCompleted event for the WebView to know when the URL is fully loaded
AddHandler WebView1.LoadCompleted, AddressOf WebView1_LoadCompleted
' Attempt to navigate to the specified URL. Notice that a malformed URL will raise a FormatException
' which we catch and let the user know that the URL is bad and to enter a new well-formed one.
Try
Dim targetUri As New Uri(Address.Text)
WebView1.Navigate(targetUri)
Catch myE As FormatException
' Bad address
rootPage.NotifyUser(String.Format("Address is invalid, try again. Details --> {0}", myE.Message), NotifyType.ErrorMessage)
End Try
End Sub
Private Sub WebView1_LoadCompleted(sender As Object, e As Windows.UI.Xaml.Navigation.NavigationEventArgs)
WebView1.Visibility = Windows.UI.Xaml.Visibility.Visible
BlockingRect.Visibility = Windows.UI.Xaml.Visibility.Collapsed
ProgressRing1.IsActive = False
' Tell the user that the page has loaded
rootPage.NotifyUser("Page loaded", NotifyType.StatusMessage)
End Sub
Private Sub Address_KeyUp(sender As Object, e As Object)
'If e.Key = Windows.System.VirtualKey.Enter Then
' NavigateButton_Click(Me, New RoutedEventArgs())
'End If
End Sub

Remarks

Button input is mapped to differerent key values for various devices, including gamepad and the Xbox One infrared remote.

A unique identifier for the input device associated with the key event, or an empty string for an unsupported device. The same device can be assigned a different ID each time it is connected.

Additional features and requirements

Device family

Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v3)

Remarks

Some devices, such as Xbox, permit multiple users to sign in for a single interactive session. This DeviceId property is useful for retrieving info for a specific user account associated with the input device.

In Windows 10 and later, Universal Windows Platform (UWP) app do not have access to user information without explicit user consent (unlike Windows 8, where permission is granted by default).

When this capability is declared, users installing the app are prompted to allow access to their information. If the user permits the app to access the information, the app appears listed in the Privacy page of the Windows 10 Settings app (Settings > Privacy > Account info).