void ChangeWorkingMode(WorkingStates workingState)
 {
     List <FrameworkElement> allFrameWorkElements = new List <FrameworkElement>
     {
         grdSodaMachine, grdChoiseSoda, grdNewSodaInput, btnCancel, btnCancelOrder, btnCheers, btnInput, btnManagement
     };
     // geef de namen van de grids en controls tussen de accolades
 }
예제 #2
0
        void ChangeWorkingMode(WorkingStates workingState)
        {
            //Lijst van elementen die verdwijnen voor elke mogelijke workingstate
            List <FrameworkElement> StateZero = new List <FrameworkElement>
            {
                InworpLst, AnBestellingBtn, CheersBtn, wisselgeldLbl, SaldoLbl, BeheerGrd
            };
            List <FrameworkElement> StateOne = new List <FrameworkElement>
            {
            };
            List <FrameworkElement> StateTwo = new List <FrameworkElement>
            {
                StatistiekLbl
            };
            List <FrameworkElement> StateThree = new List <FrameworkElement>
            {
                InworpLst, AnBestellingBtn, wisselgeldLbl, SaldoLbl
            };
            List <FrameworkElement> StateFour = new List <FrameworkElement>
            {
                InworpLst, AnBestellingBtn, CheersBtn, wisselgeldLbl, SaldoLbl
            };
            List <FrameworkElement> Allelements = new List <FrameworkElement>
            {
                KeuzeLst, InworpLst, AnBestellingBtn, CheersBtn, StatistiekLbl, BeheerGrd, BeheerBtn, StatistiekLbl
            };

            // Lijst om alle elementen te enabelen

            foreach (FrameworkElement e in Allelements)
            {
                e.IsEnabled = true;
                //StatistiekLbl.Visibility = Visibility.Hidden;
            }

            if (workingState == WorkingStates.readyToOrder)
            {
                foreach (FrameworkElement e in StateZero)
                {
                    e.IsEnabled = false;
                }
            }
            else if (workingState == WorkingStates.editProduct)
            {
                foreach (FrameworkElement e in StateOne)
                {
                    e.IsEnabled = false;
                }
            }
            else if (workingState == WorkingStates.productDelivered)
            {
                foreach (FrameworkElement e in StateTwo)
                {
                    //e.Visibility = Visibility.Visible;
                }
            }
            else if (workingState == WorkingStates.productSelected)
            {
                foreach (FrameworkElement e in StateThree)
                {
                    e.IsEnabled = true;
                }
            }
            else if (workingState == WorkingStates.canAddProduct)
            {
                foreach (FrameworkElement e in StateFour)
                {
                    e.IsEnabled = false;
                }
            }
        }