Пример #1
0
        public static UserControl GetCtrlAddOrder()
        {
            var ctrlOrder     = new CtrlAddOrder();
            var addOrderModel = new Models.AddOrderModel();
            var addOrderVM    = new Models.AddOrderViewModel(addOrderModel)
            {
                Header = "Добавление заказа ToFly"
            };

            //addOrderVM.CloseAction = new Action(() => { MainClass.HideUC(ctrlOrder); });
            ctrlOrder.DataContext = addOrderVM;
            //ctrlOrder.Tag = "Добавление заказа ToFly";
            return(ctrlOrder);
        }
Пример #2
0
        public static UserControl GetCtrlAddOrder(OrderFlight curentOrder)
        {
            var ctrlOrder = new CtrlAddOrder();
            //var flightOrder  = new  Order
            var addOrderModel = new Models.AddOrderModel(curentOrder);
            var addOrderVM    = new Models.AddOrderViewModel(addOrderModel)
            {
                Header = $"Изменение заказа {curentOrder.Id}"
            };

            ctrlOrder.DataContext = addOrderVM;
            //  addOrderVM.CloseAction = new Action(() => { MainClass.HideUC(ctrlOrder); });
            ctrlOrder.Tag = $"Изменение заказа {curentOrder.Id}";
            return(ctrlOrder);
        }
Пример #3
0
 private void UserControl_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
 {
     model          = e.NewValue as Models.AddOrderViewModel;
     model.SetFocus = new Action <string>((_) => { SetFocus(_); });
 }