示例#1
0
 public DeliverViewModel(StartUpViewModel mainWindow)
 {
     this.mainWindow = mainWindow;
     Task.Factory.StartNew(Prepare);
 }
示例#2
0
 public SelectToppingsViewModel(StartUpViewModel mainWindow)
 {
     this.mainWindow = mainWindow;
     Initialize();
     LoadOrderData();
 }
示例#3
0
 public PizzaSummaryViewModel(StartUpViewModel mainWindow)
 {
     this.mainWindow = mainWindow;
     Order           = Order.getInstance();
 }
示例#4
0
 public ChooseMeatViewModel(StartUpViewModel mainWindow)
 {
     this.mainWindow = mainWindow;
     Initialize();
     LoadOrderData();
 }
示例#5
0
 public StartViewModel(StartUpViewModel mainWindow)
 {
     this.mainWindow = mainWindow;
 }
示例#6
0
        /// <summary>
        /// Gives back the specific view by index. We need the mainWindow because we use its loadnext and loadprev method to change the view
        /// </summary>
        /// <param name="mainWindow"></param>
        /// <param name="index"></param>
        /// <returns></returns>
        public Screen CreateScene(StartUpViewModel mainWindow, int index)
        {
            if (mainWindow == null)
            {
                throw new NullReferenceException();
            }
            else if (index < 0)
            {
                throw new InvalidIndexExceptionForScene();
            }
            Screen scene = null;

            switch (index)
            {
            case 0: {
                scene = new StartViewModel(mainWindow);
                break;
            }

            case 1: {
                scene = new CustomerDataViewModel(mainWindow);
                break;
            }

            case 2: {
                scene = new ChooseDoughViewModel(mainWindow);
                break;
            }

            case 3: {
                scene = new ChooseYourSauceViewModel(mainWindow);
                break;
            }

            case 4:
            {
                scene = new ChooseMeatViewModel(mainWindow);
                break;
            }

            case 5:
            {
                scene = new SelectToppingsViewModel(mainWindow);
                break;
            }

            case 6:
            {
                scene = new ChooseCheeseViewModel(mainWindow);
                break;
            }

            case 7:
            {
                scene = new PizzaSummaryViewModel(mainWindow);
                break;
            }

            case 8:
            {
                scene = new DeliverViewModel(mainWindow);
                break;
            }

            default:
                break;
            }
            return(scene);
        }
示例#7
0
 public CustomerDataViewModel(StartUpViewModel mainWindow)
 {
     this.mainWindow = mainWindow;
     LoadDataIfExits();
 }