示例#1
0
        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;
        }
示例#2
0
 private void initialisationDonnees()
 {
     CocktailsRepository mesCocktails = new CocktailsRepository();
     this.listeDeCocktails.ItemsSource = mesCocktails.List();
 }