public AddressesViewModel(IAddressDataAccess addressDataAccess) { ProvincesViewModel = new ProvincesViewModel(addressDataAccess); DistrictsViewModel = new DistrictsViewModel(addressDataAccess); WardsViewModel = new WardsViewModel(addressDataAccess); BindProperties(); }
private void BindProperties() { ProvincesViewModel.BindProperty(nameof(ProvincesViewModel.SelectedItem), DistrictsViewModel, nameof(DistrictsViewModel.SelectedProvince), BindMode.OneWay); DistrictsViewModel.BindProperty(nameof(DistrictsViewModel.SelectedItem), WardsViewModel, nameof(WardsViewModel.SelectedDistrict), BindMode.OneWay); this.BindProperty(nameof(SelectedProvince), ProvincesViewModel, nameof(ProvincesViewModel.SelectedItem)); this.BindProperty(nameof(SelectedDistrict), DistrictsViewModel, nameof(DistrictsViewModel.SelectedItem)); this.BindProperty(nameof(SelectedWard), WardsViewModel, nameof(WardsViewModel.SelectedItem)); }
public void Load() { ProvincesViewModel.Load(); DistrictsViewModel.Load(); WardsViewModel.Load(); }