private void PersonalButton_Click(object sender, RoutedEventArgs e) { //Selected personaleButtonImageBrush.ImageSource = personalButtonDarkImage; //Unselected FavouriteButtonImageBrush.ImageSource = favouriteButtonImage; recentButtonImageBrush.ImageSource = recentRecipeButtonImage; //Switch content CookbookPersonalPage cookbookpersonalpage = new CookbookPersonalPage(GlobalData.Instance.modRecipeList); cookMain.Content = cookbookpersonalpage; }
//private CookbookFavouritePage cookbookfavouritePage = new CookbookFavouritePage(); //private CookbookRecentPage cookbookRecentPage = new CookbookRecentPage(); //private CookbookPersonalPage cookbookPersonalPage = new CookbookPersonalPage(); //private CookbookFavouritePage cookbookfavouritePage = new CookbookFavouritePage(GlobalData.Instance.recipeList); //private CookbookRecentPage cookbookRecentPage = new CookbookRecentPage(GlobalData.Instance.recentList); //private CookbookPersonalPage cookbookPersonalPage = new CookbookPersonalPage(GlobalData.Instance.modRecipeList); public CookbookPage1() { InitializeComponent(); if (GlobalData.Instance.goBackToPersonal) { //Selected personaleButtonImageBrush.ImageSource = personalButtonDarkImage; //Unselected FavouriteButtonImageBrush.ImageSource = favouriteButtonImage; recentButtonImageBrush.ImageSource = recentRecipeButtonImage; CookbookPersonalPage startup = new CookbookPersonalPage(GlobalData.Instance.modRecipeList); cookMain.Content = startup; // start cookbook at favourite page all the time GlobalData.Instance.goBackToPersonal = false; } else { CookbookFavouritePage startup = new CookbookFavouritePage(GlobalData.Instance.faveList); cookMain.Content = startup; // start cookbook at favourite page all the time } }