Exemplo n.º 1
0
 public CustomerDetailsViewModel(string customerID)
 {
     _customer = ApplicationServices.Instance
                 .NorthwindManager.GetCustomerByID(customerID);
     Name = Strings.CustomerDetailsDisplayName;
     ((INotifyPropertyChanged)_customer).PropertyChanged
           += CustomerDetailsViewModel_PropertyChanged;
     Orders =
         ApplicationServices.Instance
         .NorthwindManager.GetOrders(
             Customer.CustomerID);
     UpdateCommandViewModel = new CommandViewModel(
         Strings.UpdateCommandName,
         new RelayCommand(UpdateCommand_Execute,
                          UpdateCommand_CanExecute));
 }
Exemplo n.º 2
0
 protected override void AddComponents()
 {
     _customerSearchBoxViewModel
         = new CustomerSearchBoxViewModel();
     _customerSearchBoxViewModel.PropertyChanged
         += CustomerSearchBoxViewModelPropertyChanged;
     _customerSearchBoxViewModel.ShowCustomerDetails
         += CustomerDetailsSearchBoxViewModelShowCustomerDetails;
     Components.Add(_customerSearchBoxViewModel);
     _showDetailsCommandViewModel = new CommandViewModel(
         Strings.CustomerShowDetails,
         new RelayCommand(
             OnShowCustomerDetails,
             IsCustomerSelected));
     Components.Add(_showDetailsCommandViewModel);
 }