Radio.StateChanged Event

Definition

Occurs when a radio's operational state changes.

// Register
event_token StateChanged(TypedEventHandler<Radio, IInspectable const&> const& handler) const;

// Revoke with event_token
void StateChanged(event_token const* cookie) const;

// Revoke with event_revoker
Radio::StateChanged_revoker StateChanged(auto_revoke_t, TypedEventHandler<Radio, IInspectable const&> const& handler) const;
public event TypedEventHandler<Radio,object> StateChanged;
function onStateChanged(eventArgs) { /* Your code */ }
radio.addEventListener("statechanged", onStateChanged);
radio.removeEventListener("statechanged", onStateChanged);
- or -
radio.onstatechanged = onStateChanged;
Public Custom Event StateChanged As TypedEventHandler(Of Radio, Object) 

Event Type

Remarks

Overview

Raised for transitions between RadioState values. Lets apps adapt to user or system initiated changes (power policy, airplane mode, hardware switch, entitlement).

  1. Read current Radio.State inside the handler (do not rely on cached state).
  2. Apply minimal conditional logic (only act when the new state changes app behavior).
  3. Queue or dispatch heavier work outside the handler if needed.
  4. Unsubscribe (-=) when the radio object is no longer required.

Applies to

See also