Exemplo n.º 1
0
 public void RemoveAddress(AddressUI addressUI)
 {
     addressUI.PropertyChanged += AddressUI_PropertyChanged;
     this.AddressesUI.Remove(addressUI);
     this.SetDirty();
     this.OnPropertyChanged(nameof(this.DisplayRemoveAddressButton));
 }
Exemplo n.º 2
0
        public AddressUI AddAddress()
        {
            var addressUI = new AddressUI(new Address());

            this.AddressesUI.Add(addressUI);
            addressUI.PropertyChanged += AddressUI_PropertyChanged;
            this.SetDirty();
            this.OnPropertyChanged(nameof(this.DisplayRemoveAddressButton));

            return(addressUI);
        }
Exemplo n.º 3
0
        public PersonUI(Person person)
        {
            this.Id          = person.Id;
            this.FirstName   = person.FirstName;
            this.LastName    = person.LastName;
            this.Age         = person.Age;
            this.AddressesUI = new ObservableCollection <Address>();
            foreach (var address in person.Addresses)
            {
                var addressUI = new AddressUI(address);
                addressUI.PropertyChanged += AddressUI_PropertyChanged;
                this.AddressesUI.Add(addressUI);
            }

            this.IsDirty = false;
            this.OnPropertyChanged(nameof(this.IsDirty));
        }