private void btnOk_Click(object sender, RoutedEventArgs e) { btnOk.IsEnabled = false; btnSend.IsEnabled = true; CancellationToken = new CancellationTokenSource(); WriteLine($" Chat started (id: {ID})"); try { StreamCall = Client.Chat(cancellationToken: CancellationToken.Token); } catch (Exception ex) { btnOk.IsEnabled = true; btnSend.IsEnabled = false; WriteLine(ex.Message); } }