Beispiel #1
0
        /// <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();
            }
        }
Beispiel #2
0
        protected async void AddItemClickHandler(object sender, RoutedEventArgs e)
        {
            await _viewModel.AddItemAsync(textboxControl.Text.Trim()).ConfigureAwait(false);

            await RunOnUiThreadAsync(() => textboxControl.Text = String.Empty).ConfigureAwait(false);
        }
Beispiel #3
0
        private async void AddItemToList()
        {
            await _viewModel.AddItemAsync(textboxControl.Text.Trim());

            await RunOnUiThreadAsync(() => textboxControl.Text = String.Empty);
        }