private void OnInvokeEditInvestorCommitment(InvokeEditInvestorCommitment parameter) { if (InvestorCommitment != null) { InvestorCommitment.PropertyChanged -= InvestorCommitment_PropertyChanged; } InvestorCommitment = parameter.investorCommitment; InvestorCommitment.PropertyChanged += InvestorCommitment_PropertyChanged; // create a copy // will be used when user cancels input copyOfInvestorCommitment = new InvestorCommitment(InvestorCommitment); AvailableFunds = new ObservableCollection <PeFund>(); AvailableFunds = parameter.availableFunds; BankAccounts = parameter.bankAccounts; InvestorCommitmentDetails = new ObservableCollection <InvestorCommitmentDetail>(InvestorCommitment.InvestorCommitmentDetails); // Select first record if available if (InvestorCommitmentDetails.Count == 0) { InvestorCommitmentDetails.Add(new InvestorCommitmentDetail() { CommitmentDate = DateTime.Now }); } SelectedInvestorCommitmentDetail = InvestorCommitmentDetails[0]; SelectedInvestorCommitmentDetail.PropertyChanged += SelectedInvestorCommitmentDetail_PropertyChanged; AddDisplayNameToBankAccounts(); RaisePropertyChanged("AvailableFunds"); RaisePropertyChanged("InvestorCommitment"); RaisePropertyChanged("BankAccounts"); }
private void OnEditCommitment() { InvokeEditInvestorCommitment parameter = new InvokeEditInvestorCommitment(); parameter.investorCommitment = SelectedCommitment; ObservableCollection <PeFund> fund = new ObservableCollection <PeFund>(); fund.Add(SelectedCommitment.PeFund); parameter.availableFunds = fund; parameter.bankAccounts = new ObservableCollection <BankAccount>(Investor.BankAccounts); eventAggregator.GetEvent <InvokeEditInvestorCommitmentEvent>().Publish(parameter); EditCommitmentWindowState = WindowState.Open; }
private void OnNewCommitment() { if (SelectedCommitment == null) { SelectedCommitment = new InvestorCommitment() { InvestorId = Investor.Id }; } InvokeEditInvestorCommitment parameter = new InvokeEditInvestorCommitment(); parameter.investorCommitment = new InvestorCommitment() { InvestorId = SelectedCommitment.InvestorId }; parameter.availableFunds = availableFunds; parameter.bankAccounts = new ObservableCollection <BankAccount>(Investor.BankAccounts); eventAggregator.GetEvent <InvokeEditInvestorCommitmentEvent>().Publish(parameter); EditCommitmentWindowState = WindowState.Open; }