Exemplo n.º 1
0
        /// <summary>
        /// Default constructor
        /// </summary>
        public OldOrderPageViewModel()
        {
            Task.Run(async() => await UpdateList()).Wait();

            CurrentOrderPizzaList = new List <BackendHandler.Pizza>();
            CurrentOrderExtraList = new List <BackendHandler.Extra>();

            Delete = new RelayAsyncCommand(DeleteCommand);

            Navigate = new RelayParameterlessCommand(MainWindowViewModel.VM.NavigatorCommand);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Default Constructor
        /// </summary>
        public PizzaPageViewModel()
        {
            Task.Run(async() => UpdateList()).Wait();

            Add    = new RelayAsyncCommand(AddCommand);
            Update = new RelayAsyncCommand(UpdateCommand);
            Delete = new RelayAsyncCommand(DeleteCommand);

            Clear = new RelayParameterlessCommand(ClearCommand);

            Navigate = new RelayParameterlessCommand(MainWindowViewModel.VM.NavigatorCommand);
        }
Exemplo n.º 3
0
        public EmployeePageViewModel()
        {
            Task.Run(async() => await UpdateList()).Wait();

            Employee = new EmployeeViewModel();

            AddEmployee    = new RelayParameterizedCommand(async(parameter) => await AddEmployeeCommand(parameter));
            UpdateEmployee = new RelayParameterizedCommand(async(parameter) => await UpdateEmployeeCommand(parameter));
            Delete         = new RelayAsyncCommand(DeleteCommand);
            Clear          = new RelayParameterlessCommand(ClearCommand);

            Navigate = new RelayParameterlessCommand(MainWindowViewModel.VM.NavigatorCommand);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Default constructor that takes in a pizza with values set in the main window
        /// </summary>
        public IngredientWindowViewModel(PizzaViewModel pizza)
        {
            // Sets the Pizza property to the sent in pizza
            BasePizza = new PizzaViewModel();
            BasePizza = pizza;

            // And creates a new instance of its ingredientlist...
            BasePizza.PizzaIngredients = new List <BackendHandler.Condiment>();

            // ...then loads the already existing condiments (if there is any) into that list
            LoadIngredientsToExistingPizza();

            // Creating a new instance of the temporary list to hold condiments
            CondimentsOnPizza = new ObservableCollection <BackendHandler.Condiment>();

            // Calling commands
            AddIngredient    = new RelayAsyncCommand(AddIngredientCommand);
            RemoveIngredient = new RelayAsyncCommand(RemoveIngredientCommand);
            Confirm          = new RelayAsyncCommand(ConfirmCommand);

            // Fills upp the lists
            UpdateIngredientLists();
        }