public async void Disconnect() { if (currentConnection != null) { await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { appSettings.CurrentConnectionState = (int)ConnectionState.Disconnecting; }); service.Disconnect(currentConnection); currentConnection = null; await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { appSettings.CurrentConnectionState = (int)ConnectionState.NotConnected; }); telemetry.TrackEvent("VirtualShieldDisconnect"); } }