protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e) { base.OnNavigatedTo(e); string parameter = this.NavigationContext.QueryString["parameter"]; int cocktailId = -1; if (int.TryParse(parameter, out cocktailId)) { CocktailsRepository cocktailRepository = new CocktailsRepository(); cocktail = cocktailRepository.Find(cocktailId); } this.DataContext = cocktail; }
private void initialisationDonnees() { CocktailsRepository mesCocktails = new CocktailsRepository(); this.listeDeCocktails.ItemsSource = mesCocktails.List(); }