private async void Add_OrgaList(object sender, RoutedEventArgs e) { Organisateur orga = new Organisateur(); MyCustomContentDialogOrga dial = new MyCustomContentDialogOrga(); Grid myGrid = ((Grid)dial.FindName("Grid_Orga")); myGrid.DataContext = orga; await dial.ShowAsync(); if (dial.Result == MyResult.Ok) { using (var db = new PartyContext()) { db.organisateurs.Add(orga); db.SaveChanges(); } HashSet <String> currentOrga = new HashSet <String>(this.party.OrgaIDs); currentOrga.Add(orga.OrganisateurId.ToString()); this.party.OrgaIDs = currentOrga.ToList(); listOrga.ItemsSource = null; listOrga.ItemsSource = DatabaseHelper.GetOrgasByID(currentOrga.ToList()); } }
private async void Item_Orga_Click(object sender, ItemClickEventArgs e) { Organisateur item = (Organisateur)e.ClickedItem; MyCustomContentDialogOrga dial = new MyCustomContentDialogOrga(); Grid myGrid = ((Grid)dial.FindName("Grid_Orga")); myGrid.DataContext = item; await dial.ShowAsync(); listOrga.ItemsSource = null; listOrga.ItemsSource = DatabaseHelper.GetOrgasByID(this.party.OrgaIDs); }