public PeopleViewModel(Person person) { InitializeDependencies(); List<Person> peopleList = GetPeopleFromDB(); SetPeopleList(peopleList); currentPerson = new PersonViewModel(person); }
public void Add() { var person = new PersonViewModel(); person.PropertyChanged += Person_OnNotifyPropertyChanged; People.Add(person); organization.Add(person); SelectedIndex = People.IndexOf(person); }
/// <summary> /// Initializes a new instance of the <see cref="PersonWindow"/> class. /// </summary> public PersonWindow(PersonViewModel viewModel) : base(viewModel, DataWindowMode.OkCancel, null, DataWindowDefaultButton.OK, true, InfoBarMessageControlGenerationMode.Inline) { AddCustomButton(new DataWindowButton("Generate data", viewModel.GenerateData)); AddCustomButton(new DataWindowButton("Toggle error", viewModel.ToggleCustomError)); InitializeComponent(); }
public OrganizationViewModel(String name) { organization = new Organization(name); _SelectedIndex = -1; // Load the database foreach (var person in organization.People) { var np = new PersonViewModel(person); np.PropertyChanged += Person_OnNotifyPropertyChanged; _People.Add(np); } }
/// <summary> /// Initializes a new instance of the <see cref="PersonWindow"/> class. /// </summary> public PersonWindow(PersonViewModel viewModel) : base(viewModel) { InitializeComponent(); }