共用方式為


PhoneLine.LineChanged 事件

定義

發生於相關聯 PhoneLine 實例的 和屬性變更時。 當元數據變更,例如語音信箱計數、網路狀態或行動數據詳細數據時,就會發生這種情況。

// 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) 

事件類型

Windows 需求

應用程式功能
phoneCallHistory phoneCallHistorySystem

備註

下列範例示範如何監視和更新網路狀態。

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;
    };
}

適用於