Beispiel #1
0
        private async void Edit_Task(object sender, EventArgs e)
        {
            Element_Task task = ((Button)sender).BindingContext as Element_Task;

            string oldName = task.Name;
            await Navigation.PushModalAsync(new Adaugare_Task(oldName));
        }
Beispiel #2
0
        protected override void OnAppearing()
        {
            base.OnAppearing();
            if (NewItemName != null)
            {
                if (OldItemName == null) //add
                {
                    lista.Add(new Element_Task {
                        Name = NewItemName
                    });
                    NewItemName = null;
                }
                else // edit
                {
                    Element_Task oldItem = lista.FirstOrDefault(x => OldItemName == x.Name);
                    if (oldItem != null)
                    {
                        oldItem.Name = NewItemName;
                    }

                    OldItemName = null;
                    NewItemName = null;
                }
            }
        }
Beispiel #3
0
        private void Delete_Task(object sender, EventArgs e)
        {
            Element_Task task = ((Button)sender).BindingContext as Element_Task;

            if (task == null)
            {
                return;
            }
            else
            {
                lista.Remove(task);
                sender = null;
            }
        }