AllowedDeviceAccess Property
Collapse the table of content
Expand the table of content

CaptureDeviceConfiguration.AllowedDeviceAccess Property

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Gets a value that reports whether a user has previously granted device access based on their stored response to the device access UI prompt.

Namespace:  System.Windows.Media
Assembly:  System.Windows (in System.Windows.dll)

'Declaration
Public Shared ReadOnly Property AllowedDeviceAccess As Boolean

Property Value

Type: System.Boolean
true if the user has previously granted device access based on their response to the access request dialog box prompt, or if the request is automatically granted in some circumstances. false if the user does not grant access or if the request is denied by other factors. See Remarks.

To specifically request access when you do not already know the value of AllowedDeviceAccess, call RequestDeviceAccess first.

You must have previously requested access if you call capture-related APIs that carry or generate specific capture information (for example, CaptureSource.Start). Lack of user permission for capture device access causes the called API to error or throw an exception (InvalidOperationException or possibly others).

The following additional considerations affect the behavior of RequestDeviceAccess andwhether the request access dialog box displays to a client user at run time:

  • If the client is the Windows Phone developer runtime, the request access dialog box never displays; access is considered granted for all sites and AllowedDeviceAccess returns true.

  • Registry key settings that lock down Windows Phone configuration for corporate settings can set a key to deny all requests for webcam access. The request access does not display for users of these clients; access is considered denied and AllowedDeviceAccess returns false.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1

Windows Phone

Show:
© 2017 Microsoft