private void EditCategoryDialog_OnCategoryEdit(object sender, OnCompleteCategoryDetailEventArgs e) { Category EditedCategory = new Category() { Name = e.Name, Description = e.Description, }; var progressDialog = ProgressDialog.Show(this, "Please wait...", "Editing Category...", true); new Thread(new ThreadStart(delegate { var isAdded = mCategoryDataService.Edit(mCategories[mSelectedCategory].Id, EditedCategory); RunOnUiThread(() => progressDialog.Hide()); if (isAdded) { RunOnUiThread(() => Toast.MakeText(this, "Category Editted", ToastLength.Long).Show()); } else { RunOnUiThread(() => Toast.MakeText(this, "Failed to Edit, please check again form's field", ToastLength.Long).Show()); } })).Start(); }