/// <summary> /// Event handler that is called when you press a key in the input box. It is used /// for adding an item when you press enter. /// </summary> protected async void TextboxKeyDownHandler(object sender, KeyEventArgs e) { if (e.Key == Key.Return || e.Key == Key.Enter) { await _viewModel.AddItemAsync(textboxControl.Text.Trim()).ConfigureAwait(false); ClearTextBox(); } }
protected async void AddItemClickHandler(object sender, RoutedEventArgs e) { await _viewModel.AddItemAsync(textboxControl.Text.Trim()).ConfigureAwait(false); await RunOnUiThreadAsync(() => textboxControl.Text = String.Empty).ConfigureAwait(false); }
private async void AddItemToList() { await _viewModel.AddItemAsync(textboxControl.Text.Trim()); await RunOnUiThreadAsync(() => textboxControl.Text = String.Empty); }