Пример #1
0
 public PersonEditWindowViewModel(PeopleTabViewModel ownerTabViewModel, PersonEditWindow ownerEditWindow,
     Person person)
     : base(ownerTabViewModel, ownerEditWindow, person)
 {
     if (Update)
     {
         Person = new Person
         {
             OwnerID = person.OwnerID,
             Name = person.Name,
             Surname = person.Surname,
             PESEL = person.PESEL,
             City = person.City,
             Street = person.Street,
             HouseNumber = person.HouseNumber,
             LocalNumber = person.LocalNumber,
             Telephone = person.Telephone
         };
     }
     else
     {
         Person = new Person();
     }
 }
Пример #2
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="ownersTabViewModel">Owners tab view model</param>
 /// <param name="person">Person</param>
 public PersonEditWindow(PeopleTabViewModel ownersTabViewModel, Person person)
 {
     InitializeComponent();
     DataContext = new PersonEditWindowViewModel(ownersTabViewModel, this, person);
 }