/// <summary> /// 网络状态变更时触发的事件 /// </summary> private void OnNetworkStatusChanged(NetworkChangedEventArgs e) { if (NetworkStatusChanged != null) { NetworkStatusChanged(this, e); } }
void NetworkInformation_NetworkStatusChanged(object sender) { if (NetworkStatusChanged != null) { NetworkChangedEventArgs e = new NetworkChangedEventArgs() { }; e.Status = GetStatusString(); e.NetWorkStatus = GetStatus(); NetworkStatusChanged(this, e); } }
/// <summary> /// 网络状态变更时触发的事件 /// </summary> private void OnNetworkStatusChanged(NetworkChangedEventArgs e) { if (NetworkStatusChanged != null) NetworkStatusChanged(this, e); }
protected virtual void NetworkChange(NetworkChangedEventArgs details) { EventHandler <NetworkChangedEventArgs> handler = NetworkChangeEvent; handler?.Invoke(this, details); }
void _networkManager_NetworkChanged(object sender, NetworkChangedEventArgs e) { _dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => IsOffline = !e.Connected); }