예제 #1
0
 public async void ChangeContent(bool state, int type)
 {
     if (type == 1)
     {
         contentframe.NavigationService.Navigate(content);
         content.Window_Loaded();
         LeftImages.Visibility  = Visibility.Visible;
         sliderframe.Visibility = Visibility.Visible;
         sliderframe.Height     = 400;
         _ScrollViewer.ScrollToTop();
         _MenuScroll.ScrollToTop();
         LeftImages.Height  = 1400;
         Filters.Visibility = Visibility.Collapsed;
     }
     else if (type == 2)
     {
         contentframe.NavigationService.Navigate(login);
         content.Window_Loaded();
         LeftImages.Visibility  = Visibility.Hidden;
         sliderframe.Visibility = Visibility.Hidden;
         sliderframe.Height     = 0;
         _ScrollViewer.ScrollToTop();
         _MenuScroll.ScrollToTop();
         LeftImages.Height  = 0;
         Filters.Visibility = Visibility.Collapsed;
     }
     else if (type == 3)
     {
         contentframe.NavigationService.Navigate(productCase);
         content.Window_Loaded();
         LeftImages.Visibility  = Visibility.Hidden;
         sliderframe.Visibility = Visibility.Hidden;
         sliderframe.Height     = 0;
         _ScrollViewer.ScrollToTop();
         _MenuScroll.ScrollToTop();
         LeftImages.Height  = 0;
         Filters.Visibility = Visibility.Collapsed;
     }
 }
예제 #2
0
        private async void MainWindow_OnLoaded(object sender, RoutedEventArgs e)
        {
            navbar = new Navbar(this);
            View.SliderPanel slider = new View.SliderPanel();
            content     = new ContentPanel(this);
            login       = new Login();
            productCase = new ProductInCase(navbar);
            content.Window_Loaded();
            categories = await service.GetJsonList("Categories");

            currency = await service2.GetJsonList("Currencies");

            currency.Remove(currency.FirstOrDefault());
            Currencies.ItemsSource = currency;
            foreach (var item in categories)
            {
                Menu.Children.Add(new UserControlMenuItem(item, this));
            }
            navbarframe.NavigationService.Navigate(navbar);
            sliderframe.NavigationService.Navigate(slider);
            contentframe.NavigationService.Navigate(content);
            Filters.Visibility = Visibility.Collapsed;
        }