private void callCategory() { MessagingCenter.Subscribe <CategoryAddViewModel, string>(this, "selectedValue", (sender, arg) => { selectedDropDownValue = arg; if (!string.IsNullOrEmpty(selectedDropDownValue)) { resturant = new ResturantCategory(); resturant.Category = selectedDropDownValue; int x = 0; try { x = conn.Insert(resturant); } catch (Exception ex) { throw ex; } if (x == 1) { // success message } else { //Error message } } else { } Callrefresh(); }); }
public ListDetailCategoryPage(ResturantCategory resturant) { InitializeComponent(); ListDetailCategoryPageModel listDetail = new ListDetailCategoryPageModel(resturant); BindingContext = listDetail; }
public ListDetailCategoryPageModel(ResturantCategory resturant) { selectedItem = resturant.Category; _saveProducts = new ObservableCollection <SaveProduct>(); _selectedCategory = new ObservableCollection <SelectedCategoryProducted>(); conn = DependencyService.Get <Isqlite>().GetConnection(); listOfProductCall(); }