Esempio n. 1
0
 private void InitAdapterHandlers()
 {
     _taskListAdapter.CheckboxClickHandler += (s, e) =>
     {
         if (e < 0)
         {
             return;
         }
         var item = _taskListAdapter.TaskList[e];
         _presenter.ChangeTaskCompleted(item);
     };
     _taskListAdapter.EditHandler += (s, e) =>
     {
         if (e < 0)
         {
             return;
         }
         var item = _taskListAdapter.TaskList[e];
         _presenter.EditTaskRequest(item);
     };
     _taskListAdapter.DeleteHandler += (s, e) =>
     {
         if (e < 0)
         {
             return;
         }
         var item     = _taskListAdapter.TaskList[e];
         var snack    = Snackbar.Make(CurrentFocus, Resource.String.taskHasBeenDeleted, Snackbar.LengthLong);
         var callback = new SnackbarUndoCallback(item, _presenter);
         snack.AddCallback(callback);
         snack.SetAction(Resource.String.undo, view =>
         {
             snack.RemoveCallback(callback);
             _taskListAdapter.NotifyDataSetChanged();
         });
         snack.Show();
     };
 }