Пример #1
0
        public CustomersViewModel()
        {
            Save   = new RelayCommand(ExecuteSave, CanExecuteSave);
            AddNew = new RelayCommand(ExecuteAddNew, CanExecuteAddNew);
            Cancel = new RelayCommand(ExecuteCancel, CanExecute);

            IsEnabled = false;
            GetCountries();
            GetSalesRegions();
            TV = new TV.CustomerTreeViewViewModel();
            GetCustomers();

            Customer = new CustomerModel();

            ClearCustomer();
            ResetCustomer();
            Customer.PropertyChanged += Customer_PropertyChanged;
        }
Пример #2
0
        public CustomersViewModel2()
        {
            ExCloseWindow       = ExecuteClosing;
            Save                = new RelayCommand(ExecuteSave, CanExecuteSave);
            Cancel              = new RelayCommand(ExecuteCancel, CanExecute);
            AddNew              = new RelayCommand(ExecuteAddNew, CanExecuteAddNew);
            CustomerListEnabled = true;
            GetCountries();

            GetCustomers();
            IsEnabled = false;
            TV        = new TV.CustomerTreeViewViewModel();

            UpdateCustomerTree();
            ClearCustomer();
            if (Customers != null)
            {
                SelectedCustomer = Customers[0];
            }
        }