private async void btnLogout_Click(object sender, RoutedEventArgs e) { if (this.Client != null) { CancellationToken ct = new CancellationToken(); spToken.DataContext = this.Client = null; await this.RefreshAsync(ct); } }
private async Task AuthenticateAsync(CancellationToken ct) { this.Client = new DexcomClient(Credentials.CLIENT_ID, Credentials.CLIENT_SECRET, Credentials.CALLBACK_URL, new DexcomAuthProvider(), tsIsDev.IsOn); spToken.DataContext = await this.Client.AuthenticateAsync(ct); }