//heartButtonImageBrush.ImageSource = (BitmapImage)Application.Current.Resources["unfillHeartIcon"]; private void FavouriteButton_Click(object sender, RoutedEventArgs e) { //Selected FavouriteButtonImageBrush.ImageSource = favouriteButtonDarkImage; //Unselected personaleButtonImageBrush.ImageSource = personalButtonImage; recentButtonImageBrush.ImageSource = recentRecipeButtonImage; //Switch content CookbookFavouritePage cookbookfavouritepage = new CookbookFavouritePage(GlobalData.Instance.faveList); cookMain.Content = cookbookfavouritepage; }
//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 } }