public OrdersFulfillmentViewModel(IOrdersDataViewModel ordersDataViewModel, IStartOrderCommand startOrderCommand)
        {
            Orders = ordersDataViewModel;
            object lockStartOrderCommand = new object();
            this.OrderFulfillmentMessage = "Please Start an Order";
            this.StartOrder = startOrderCommand;
            
            this.StartOrder.CanExecuteChanged += (a, b) =>
            {
                lock (lockStartOrderCommand)
                {
                    if (!this.StartOrder.CanExecute(null))
                    {
                        OrderFulfillmentMessage = "Order Fulfillent in Process";
                    }
                    this.Raise(() => StartOrderEnabled);
                }
            };

        }
Beispiel #2
0
        public OrdersFulfillmentViewModel(IOrdersDataViewModel ordersDataViewModel, IStartOrderCommand startOrderCommand)
        {
            Orders = ordersDataViewModel;
            object lockStartOrderCommand = new object();

            this.OrderFulfillmentMessage = "Please Start an Order";
            this.StartOrder = startOrderCommand;

            this.StartOrder.CanExecuteChanged += (a, b) =>
            {
                lock (lockStartOrderCommand)
                {
                    if (!this.StartOrder.CanExecute(null))
                    {
                        OrderFulfillmentMessage = "Order Fulfillent in Process";
                    }
                    this.Raise(() => StartOrderEnabled);
                }
            };
        }