private void Complete(object obj) { var result = obj as Item; //res.Listo = true; CompralistContext.Item_Complete(result, Username); //CompralistContext = App.CompralistContext; }
private async void Delete(object obj) { var item = obj as Item; //App.CompralistContext.ListItems.Remove(item); //App.CompralistContext.Item_Delete(item); CompralistContext.Item_Delete(item); //await App.Current.MainPage.DisplayToastAsync("DeleteCommand activado", 500); //CompralistContext.ListItems = App.CompralistContext.ListItems; }
private async void Add(object obj) { string result = await App.Current.MainPage.DisplayPromptAsync("Agregando...", "¿Que quieres agregar?", "Agregar", "Cancelar", "", 45); if (!string.IsNullOrWhiteSpace(result)) { CompralistContext.Item_Add(result, Username); } //CompralistContext.List_OrderBy(); }
//string hostURL = "https://compralist-web.conveyor.cloud/compraListHub"; //"https://compralist.itesrc.net/compraListHub"; public MainPage_VM() { CompralistContext = App.CompralistContext; CompralistContext.List_OrderBy(); UserAvatar = App.UserAvatar; AvatarString = Enum.GetName(typeof(Avatar), UserAvatar); Username = App.Username; UserCommand = new Command(User); DeleteCommand = new Command(Delete); AddCommand = new Command(Add); CompleteCommand = new Command(Complete); }