Ejemplo n.º 1
0
        public void BeverageSelected(IBeverageModel bvModel)
        {
            var orderViewModel = ContainerHelper.Container.Resolve <OrderViewModel>(new ResolverOverride[]
            {
                new ParameterOverride("model", bvModel)
            });

            Order order = ContainerHelper.Container.Resolve <Order>(new ResolverOverride[]
            {
                new ParameterOverride("viewModel", orderViewModel)
            });

            order.Show();

            RequestClose(this, EventArgs.Empty);
        }
Ejemplo n.º 2
0
        public OrderViewModel(IBeverageModel model)
        {
            CanCancelOrder = true;
            CanBack        = false;
            ButtonStyle    = (Style)Application.Current.FindResource("CnlButton");
            BeverageModel  = model;
            BeverageModel.ResetMaterials();

            worker = new BackgroundWorker();
            worker.WorkerSupportsCancellation = true;
            worker.DoWork             += worker_DoWork;
            worker.RunWorkerCompleted += worker_RunWorkerCompleted;
            worker.RunWorkerAsync();

            CancelButtonCommand = new RelayCommand <IOrderView>(CancelClick);
            BackButtonCommand   = new RelayCommand(BackClick);
        }