Radio Radio Radio Radio Class
Definition
Represents a radio device on the system.
public : sealed class Radio : IRadiopublic sealed class Radio : IRadioPublic NotInheritable Class Radio Implements IRadio// You can use this class in JavaScript.
- Attributes
| Device family |
Windows 10 (introduced v10.0.10240.0 - for Xbox, see UWP features that aren't yet supported on Xbox)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v1)
|
Remarks
Your code uses static members of this class like GetRadiosAsync, GetDeviceSelector, and FromIdAsync to query for radios and to retrieve instantiated Radio objects representing particular radios on the device.
Note that your code should call RequestAccessAsync at least once, from the UI thread, before trying to call SetStateAsync. This is because in some regions, with some user settings choices, attempting to change radio state requires user permission. In this situation, calling RequestAccessAsync shows the user a prompt asking if they want to allow your app to have permission to control the radio. If your app is running on a device that requires user permission and your code hasn't requested and received permission, then SetStateAsync will fail for lack of user permission.
Properties
Kind Kind Kind Kind
Gets an enumeration value that describes what kind of radio this object represents.
public : RadioKind Kind { get; }public RadioKind Kind { get; }Public ReadOnly Property Kind As RadioKind// You can use this property in JavaScript.
Name Name Name Name
Gets the name of the radio represented by this object.
public : PlatForm::String Name { get; }public string Name { get; }Public ReadOnly Property Name As string// You can use this property in JavaScript.
- Value
- PlatForm::String string string string
The radio name.
Methods
FromIdAsync(String) FromIdAsync(String) FromIdAsync(String) FromIdAsync(String)
A static method that retrieves a Radio object corresponding to a device Id obtained through Windows.Devices.Enumeration.DeviceInformation.FindAllAsync and related APIs.
public : static IAsyncOperation<Radio> FromIdAsync(PlatForm::String deviceId)public static IAsyncOperation<Radio> FromIdAsync(String deviceId)Public Static Function FromIdAsync(deviceId As String) As IAsyncOperation( Of Radio )// You can use this method in JavaScript.
- deviceId
- PlatForm::String String String String
A string that identifies a particular radio device.
An asynchronous retrieval operation. On successful completion, it contains a Radio object that represents the specified radio device.
GetDeviceSelector() GetDeviceSelector() GetDeviceSelector() GetDeviceSelector()
A static method that returns an Advanced Query Syntax (AQS) string to be used to enumerate or monitor Radio devices with Windows.Devices.Enumeration.DeviceInformation.FindAllAsync and related methods.
public : static PlatForm::String GetDeviceSelector()public static string GetDeviceSelector()Public Static Function GetDeviceSelector() As string// You can use this method in JavaScript.
An identifier to be used to enumerate radio devices.
GetRadiosAsync() GetRadiosAsync() GetRadiosAsync() GetRadiosAsync()
A static, asynchronous method that retrieves a collection of Windows.Devices.Radios.Radio objects representing radio devices existing on the system.
public : static IAsyncOperation<IVectorView<Radio>> GetRadiosAsync()public static IAsyncOperation<IReadOnlyList<Radio>> GetRadiosAsync()Public Static Function GetRadiosAsync() As IAsyncOperation( Of IReadOnlyListRadio )// You can use this method in JavaScript.
An asynchronous retrieval operation. When the operation is complete, contains a list of Windows.Devices.Radios.Radio objects describing available radios.
RequestAccessAsync() RequestAccessAsync() RequestAccessAsync() RequestAccessAsync()
An asynchronous method that retrieves a value indicating what access the current user has to the radio represented by this object. In circumstances where user permission is required to access the radio, this method prompts the user for permission. Consequently, always call this method on the UI thread.
public : static IAsyncOperation<RadioAccessStatus> RequestAccessAsync()public static IAsyncOperation<RadioAccessStatus> RequestAccessAsync()Public Static Function RequestAccessAsync() As IAsyncOperation( Of RadioAccessStatus )// You can use this method in JavaScript.
An asynchronous status retrieval operation. On successful completion, contains an enumeration value describing the current user's access to this radio.
SetStateAsync(RadioState) SetStateAsync(RadioState) SetStateAsync(RadioState) SetStateAsync(RadioState)
An asynchronous operation that attempts to set the state of the radio represented by this object.
public : IAsyncOperation<RadioAccessStatus> SetStateAsync(RadioState value)public IAsyncOperation<RadioAccessStatus> SetStateAsync(RadioState value)Public Function SetStateAsync(value As RadioState) As IAsyncOperation( Of RadioAccessStatus )// You can use this method in JavaScript.
The desired radio state.
Note
Only RadioStateOn and RadioStateOff may be set using SetStateAsync.
An asynchronous state setting operation. On successful completion, contains an enumeration value describing status of the state change request.
| Device family |
Windows 10 (introduced v10.0.10240.0 - for Xbox, see UWP features that aren't yet supported on Xbox)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v1)
|
| Capabilities |
radios
|
Events
StateChanged StateChanged StateChanged StateChanged
Event raised by a state change in the radio represented by this object.
public : event TypedEventHandler StateChanged<Radio, object>public event TypedEventHandler StateChanged<Radio, object>Public Event StateChanged<Radio, object>// You can use this event in JavaScript.