Share via


PhoneLine.LineChanged Event

Definition

Occurs when and properties for the associated PhoneLine instance change. This can occur when meta data changes like the voice mail count, the network state, or the cellular details.

// Register
event_token LineChanged(TypedEventHandler<PhoneLine, IInspectable const&> const& handler) const;

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

// Revoke with event_revoker
PhoneLine::LineChanged_revoker LineChanged(auto_revoke_t, TypedEventHandler<PhoneLine, IInspectable const&> const& handler) const;
public event TypedEventHandler<PhoneLine,object> LineChanged;
function onLineChanged(eventArgs) { /* Your code */ }
phoneLine.addEventListener("linechanged", onLineChanged);
phoneLine.removeEventListener("linechanged", onLineChanged);
- or -
phoneLine.onlinechanged = onLineChanged;
Public Custom Event LineChanged As TypedEventHandler(Of PhoneLine, Object) 

Event Type

Windows requirements

App capabilities
phoneCallHistory phoneCallHistorySystem

Remarks

The following example demonstrates how to monitor for and update the network state.

private async void MonitorLineChanges(Guid lineId)
{
    // Get the PhoneLine instance
    PhoneLine line = await PhoneLine.FromIdAsync(lineId);

    PhoneNetworkState updatedNetworkState;
    string updatedNetworkName;

    line.LineChanged += (o, args) =>
    {
        updatedNetworkState = line.NetworkState;
        updatedNetworkName = line.NetworkName;
    };
}

Applies to