private async void StarConversion_Click(object sender, RoutedEventArgs e) { try { if (string.IsNullOrWhiteSpace(viewModel.Text2NgramPath) || string.IsNullOrWhiteSpace(viewModel.DictionaryTextPath) || string.IsNullOrWhiteSpace(viewModel.DatabasePath)) { throw new InvalidOperationException("Not all file paths were informed!"); } Cursor = Cursors.Wait; ((UIElement)Content).IsEnabled = false; ProgressIndicator.IsIndeterminate = true; bool result = await viewModel.CreateSQLiteDatabase(); ProgressIndicator.IsIndeterminate = false; if (result) { ProgressIndicator.Value = 100; textBlock_Copy3.FontWeight = FontWeights.Bold; } } catch (Exception ex) { error.TratarExcecao(ex); } finally { ((UIElement)Content).IsEnabled = true; Cursor = null; } }