private void Edit()
 {
     logger.Info("Displaying edit category dialog");
     EditCategoryViewModel vm = new EditCategoryViewModel(this);
     EditCategoryDialog dialog = new EditCategoryDialog(vm);
     dialog.Show();
 }
        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 EditCategoryDialog(Resource.String.add, AddDialogPositive, AddDialogNegative);
            _addDialog.Show(transaction, "add_dialog");
        }
        private void OnRenameClick(object item, int position)
        {
            var transaction = SupportFragmentManager.BeginTransaction();
            var old         = SupportFragmentManager.FindFragmentByTag("rename_dialog");

            if (old != null)
            {
                transaction.Remove(old);
            }

            transaction.AddToBackStack(null);

            var name = _categorySource.Categories[position].Name;

            _renameDialog =
                new EditCategoryDialog(Resource.String.rename, RenameDialogPositive, RenameDialogNegative, name);
            _renameDialog.Show(transaction, "rename_dialog");
            _renamePosition = position;
        }