private void OnRenameClick(object item, int position) { var category = _categorySource.Get(position); if (category == null) { return; } var fragment = new EditCategoryBottomSheet(EditCategoryBottomSheet.Mode.Edit, position, category.Name); fragment.Submit += OnRenameDialogSubmit; fragment.Show(SupportFragmentManager, fragment.Tag); }
private void OnAddClick(object sender, EventArgs e) { var transaction = SupportFragmentManager.BeginTransaction(); var old = SupportFragmentManager.FindFragmentByTag("add_dialog"); if (old != null) { transaction.Remove(old); } transaction.AddToBackStack(null); _addDialog = new EditCategoryBottomSheet(EditCategoryBottomSheet.Mode.New, null); _addDialog.Submit += OnAddDialogSubmit; _addDialog.Show(transaction, "add_dialog"); }
private void OnRenameClickedClick(object item, int position) { var category = _categoryView.ElementAt(position); var bundle = new Bundle(); bundle.PutInt("mode", (int)EditCategoryBottomSheet.Mode.Edit); bundle.PutInt("position", position); bundle.PutString("initialValue", category.Name); var fragment = new EditCategoryBottomSheet { Arguments = bundle }; fragment.Submitted += OnRenameDialogSubmit; fragment.Show(SupportFragmentManager, fragment.Tag); }
private void OnAddClick(object sender, EventArgs e) { var transaction = SupportFragmentManager.BeginTransaction(); var old = SupportFragmentManager.FindFragmentByTag("add_dialog"); if (old != null) { transaction.Remove(old); } transaction.AddToBackStack(null); var bundle = new Bundle(); bundle.PutInt("mode", (int)EditCategoryBottomSheet.Mode.New); var dialog = new EditCategoryBottomSheet { Arguments = bundle }; dialog.Submit += OnAddDialogSubmit; dialog.Show(transaction, "add_dialog"); }