private void Page_Loaded(object sender, RoutedEventArgs e) { ActiveButton = ButtonMarket; ActiveButton.Style = (Style)FindResource("styleButtonActive"); GlobalButtonMarket = ButtonMarket; GlobalButtonCreate = ButtonCreate; Unactive = (Style)FindResource("styleButtonHome"); Active = (Style)FindResource("styleButtonActive"); FragmentMarket fragmentMarket = new FragmentMarket(); FrameContent.Content = fragmentMarket; ButtonMarket.Visibility = Visibility.Visible; ButtonAccount.Visibility = Visibility.Visible; ButtonLogout.Visibility = Visibility.Visible; if (AuthUser.Role == "Admin") { ButtonDemo.Visibility = Visibility.Visible; ButtonDashboard.Visibility = Visibility.Visible; ButtonRestock.Visibility = Visibility.Visible; ButtonRecipes.Visibility = Visibility.Visible; ButtonRecipeCreators.Visibility = Visibility.Visible; } if (AuthUser.RecipeCreator != null) { ButtonCreate.Visibility = Visibility.Visible; } }
private void ButtonMarket_Click(object sender, RoutedEventArgs e) { SetButtonActive(sender); FragmentMarket fragmentMarket = new FragmentMarket(); FrameContent.Content = fragmentMarket; }