void SaveAndNewControlKit(object sender, EventArgs e) { if (!String.IsNullOrEmpty(controlKitMV.Name) && _myItems.Count > 0) { string output = "{"; for (int i = 0; i < _myItems.Count; ++i) { output += "" + _myItems [i].ID + ":" + _myItems [i].Quantity; if (i < _myItems.Count - 1) { output += ","; } } output += "}"; controlKitMV.Elements = output; controlKitMV.Save(); NewControlKit(); } else { DisplayAlert("Attention", "Vous devez entrer un nom pour le kit de commande et sélectionner au moins un produit !", "Ok"); } }
void SaveAndComeBack(object sender, EventArgs e) { if (!String.IsNullOrEmpty(_controlKitViewModel.Name) && _myItems.Count > 0) { string output = "{"; for (int i = 0; i < _myItems.Count; ++i) { output += "" + _myItems [i].ID + ":" + _myItems [i].Quantity; if (i < _myItems.Count - 1) { output += ","; } } output += "}"; _controlKitViewModel.Elements = output; _controlKitViewModel.Save(); _saved = true; Navigation.PopAsync(); } }