예제 #1
0
        private async void SubmitButton_Click(object sender, RoutedEventArgs e)
        {
            if (string.IsNullOrEmpty(SourceInput.Text))
            {
                return;
            }
            if (string.IsNullOrEmpty(TranslateInput.Text))
            {
                return;
            }

            var item = new Item(SourceInput.Text.Trim().ToLowerInvariant(), TranslateInput.Text.Trim().ToLowerInvariant());
            await _loader.AddAsync(new List <Item> {
                item
            });

            SourceInput.Text    = string.Empty;
            TranslateInput.Text = string.Empty;
            Count.Text          = $"{_loader.Count} item(s)";

            SourceInput.Focus();
        }
예제 #2
0
 private void SourceInput_GotFocus(object sender, RoutedEventArgs e)
 {
     SourceInput.Focus();
     SourceInput.SelectAll();
     e.Handled = true;
 }