private void OnCommandAddAccount() { var newCustomerAccountWrapper = new CustomerBankAccountWrapper(new BankAccount()); newCustomerAccountWrapper.PropertyChanged += CustomerAccountWrapper_PropertyChanged; ListCustomerBankAccountWrapper.Add(newCustomerAccountWrapper); Customer.Entity.BankAccounts.Add(newCustomerAccountWrapper.Entity); //Trigger Validation newCustomerAccountWrapper.AccountNo = ""; }
private void InitializeListCustomerAccountWrapper(Customer customer) { foreach (var customerAccountWrapper in ListCustomerBankAccountWrapper) { customerAccountWrapper.PropertyChanged -= CustomerAccountWrapper_PropertyChanged; } ListCustomerBankAccountWrapper.Clear(); foreach (var customerBankAccount in customer.BankAccounts) { var customerAccountWrapper = new CustomerBankAccountWrapper(customerBankAccount); ListCustomerBankAccountWrapper.Add(customerAccountWrapper); customerAccountWrapper.PropertyChanged += CustomerAccountWrapper_PropertyChanged; } }