Пример #1
0
        private void DeleteNote()
        {
            var dialog = new AlertDialog.Builder(Activity);

            dialog.SetTitle(GetString(Resource.String.pub_note));
            dialog.SetMessage(GetString(Resource.String.edic_delete));
            dialog.SetNegativeButton("Annulla", delegate
            {
                return;
            });

            dialog.SetPositiveButton("Elimina", delegate(object sender, DialogClickEventArgs e)
            {
                this.Dismiss();
                _noteManager.DeleteNota(_nota.ID);
                _nota.Testo   = "";
                _txtNota.Text = "";
            });

            dialog.Create();
            dialog.Show().SetDivider();
        }
Пример #2
0
        public void DeleteAction(int position)
        {
            var dialog = new AlertDialog.Builder(Activity);

            dialog.SetTitle(GetString(Resource.String.pub_note));
            dialog.SetMessage(GetString(Resource.String.edic_delete));

            dialog.SetNegativeButton(GetString(Resource.String.gen_cancel), delegate
            {
                return;
            });

            dialog.SetPositiveButton(GetString(Resource.String.gen_delete), delegate(object sender, DialogClickEventArgs e)
            {
                var nota = _note[position];

                _noteManager.DeleteNota(nota.ID);

                PopulateTable();
            });

            dialog.Create();
            dialog.Show().SetDivider();
        }