Esempio n. 1
0
        async void OnTranlsateButtonClicked(object sender, EventArgs e)
        {
            try
            {
                if (!string.IsNullOrWhiteSpace(txtInput.Text))
                {
                    IsProcessing   = true;
                    txtOutput.Text = await textTranslationService.TranslateTextAsync(txtInput.Text);

                    IsProcessing = false;
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Ons the translate.
        /// </summary>
        async void OnTranslate()
        {
            try
            {
                if (!string.IsNullOrWhiteSpace(TextToValidate))
                {
                    IsBusy = true;

                    TextToValidate = await _textTranslationService.TranslateTextAsync(TextToValidate);

                    IsBusy = false;
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message);
            }
        }
        async void OnTranslateButtonClicked(object sender, EventArgs e)
        {
            try
            {
                if (!string.IsNullOrWhiteSpace(TodoItem.Name))
                {
                    IsProcessing = true;

                    TodoItem.Name = await textTranslationService.TranslateTextAsync(TodoItem.Name);

                    OnPropertyChanged("TodoItem");

                    IsProcessing = false;
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message);
            }
        }
Esempio n. 4
0
        async void OnTranslateButtonClicked(object sender, EventArgs e)
        {
            try
            {
                if (!string.IsNullOrWhiteSpace(Context.Item.Description))
                {
                    activityIndicator.IsVisible = true;

                    Context.Item.Description = await textTranslationService.TranslateTextAsync(Context.Item.Description);

                    OnPropertyChanged("TodoItem");

                    activityIndicator.IsVisible = false;
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message);
            }
        }