private void AddDebtorButtonPressedCommandHandler() { Debtor debtorUnderCreation = new Debtor(); AddDebtorWindow addDebtorWindow = new AddDebtorWindow(); AddDebtorWindowViewModel addDebtorWindowViewModel = new AddDebtorWindowViewModel(ref debtorUnderCreation, ref addDebtorWindow); addDebtorWindow.DataContext = addDebtorWindowViewModel; addDebtorWindow.Owner = Application.Current.MainWindow; if (addDebtorWindow.ShowDialog() == true) { debtors.Add(debtorUnderCreation); } }
public AddDebtorWindowViewModel(ref Debtor debtorToCreate, ref AddDebtorWindow window) { DebtorToCreate = debtorToCreate; _window = window; }