示例#1
0
        private void BtnSubMenu_Click(object sender, RoutedEventArgs e)
        {
            ClearSubMenuButtons();

            Button clickedButton = (Button)sender;

            clickedButton.Background = GradientButtonsSubMenu();
            clickedButton.Foreground = Brushes.White;

            if (clickedButton == btn_Breakfast)
            {
                ContentPanel.Children.Clear();
                UserControlHome UscHome = new UserControlHome(_data);

                UscHome.lb_Category.Content = "Śniadania";

                UscHome.ItemsList.ItemsSource = _data.BreakfastList;
                btn_CategoryClose.Visibility  = Visibility.Collapsed;
                btn_Category.Visibility       = Visibility.Visible;
                ContentPanel.Children.Add(UscHome);
            }
            else if (clickedButton == btn_Dinner)
            {
                ContentPanel.Children.Clear();
                UserControlHome UscHome = new UserControlHome(_data);

                UscHome.lb_Category.Content = "Obiady";

                UscHome.ItemsList.ItemsSource = _data.DinnerList;
                btn_CategoryClose.Visibility  = Visibility.Collapsed;
                btn_Category.Visibility       = Visibility.Visible;
                ContentPanel.Children.Add(UscHome);
            }
            else if (clickedButton == btn_Snack)
            {
                ContentPanel.Children.Clear();
                UserControlHome UscHome = new UserControlHome(_data);

                UscHome.lb_Category.Content = "Przekąski";

                UscHome.ItemsList.ItemsSource = _data.SnackList;
                btn_CategoryClose.Visibility  = Visibility.Collapsed;
                btn_Category.Visibility       = Visibility.Visible;
                ContentPanel.Children.Add(UscHome);
            }
            else if (clickedButton == btn_Dessert)
            {
                ContentPanel.Children.Clear();
                UserControlHome UscHome = new UserControlHome(_data);

                UscHome.lb_Category.Content = "Desery";

                UscHome.ItemsList.ItemsSource = _data.DessertList;
                btn_CategoryClose.Visibility  = Visibility.Collapsed;
                btn_Category.Visibility       = Visibility.Visible;
                ContentPanel.Children.Add(UscHome);
            }
        }
示例#2
0
        public MainWindow()
        {
            InitializeComponent();

            _data.GetData();
            _data.GetIngredient();

            MaxHeight = SystemParameters.MaximizedPrimaryScreenHeight;
            UserControlHome UscHome = new UserControlHome(_data);

            ContentPanel.Children.Add(UscHome);
        }
示例#3
0
        private void BtnBack_Click(object sender, RoutedEventArgs e)
        {
            UserControlHome uscH = new UserControlHome(Data);

            this.Content = uscH;
        }
示例#4
0
        private void BtnMenu_Click(object sender, RoutedEventArgs e)
        {
            btn_Home.Background = Brushes.Transparent;
            btn_Home.Foreground = new SolidColorBrush(Color.FromRgb(151, 152, 155));

            btn_Category.Background = Brushes.Transparent;
            btn_Category.Foreground = new SolidColorBrush(Color.FromRgb(151, 152, 155));

            btn_CategoryClose.Background = Brushes.Transparent;
            btn_CategoryClose.Foreground = new SolidColorBrush(Color.FromRgb(151, 152, 155));

            btn_News.Background = Brushes.Transparent;
            btn_News.Foreground = new SolidColorBrush(Color.FromRgb(151, 152, 155));

            btn_Info.Background = Brushes.Transparent;
            btn_Info.Foreground = new SolidColorBrush(Color.FromRgb(151, 152, 155));

            Button clickedButton = (Button)sender;

            clickedButton.Background = GradientButtonsMenu();
            clickedButton.Foreground = Brushes.White;

            if (clickedButton == btn_Home)
            {
                UserControlHome UscHome = new UserControlHome(_data);
                ContentPanel.Children.Add(UscHome);
            }


            if (clickedButton == btn_Category)
            {
                btn_CategoryClose.Visibility = Visibility.Visible;

                SubMenu.Visibility           = Visibility.Visible;
                btn_Category.Visibility      = Visibility.Collapsed;
                btn_CategoryClose.Background = GradientButtonsMenu();
                btn_CategoryClose.Foreground = Brushes.White;
            }
            else if (clickedButton == btn_CategoryClose)
            {
                btn_CategoryClose.Visibility = Visibility.Collapsed;
                btn_Category.Visibility      = Visibility.Visible;
                btn_Category.Background      = GradientButtonsMenu();
                btn_Category.Foreground      = Brushes.White;
            }
            else
            {
                SubMenu.Visibility           = Visibility.Collapsed;
                btn_CategoryClose.Visibility = Visibility.Collapsed;
                btn_Category.Visibility      = Visibility.Visible;
                ClearSubMenuButtons();
            }

            if (clickedButton == btn_News)
            {
                var usc = new UserControlNews();
                ContentPanel.Children.Add(usc);
            }

            if (clickedButton == btn_Info)
            {
                var usc = new UserControlAbout();
                ContentPanel.Children.Add(usc);
            }
        }