public FacilityGridView() { InitializeComponent(); _facilityService = new FacilityService(new MVCHContext()); _facilityListViewModel = new FacilityListViewModel(_facilityService); _physicianService = new PhysicianService(new MVCHContext()); _facilityPhysicianService = new FacilityPhysicianService(new MVCHContext()); DataContext = _facilityListViewModel; }
public AddFacilityView(FacilityListViewModel facilityListViewModel, FacilityService facilityService, PhysicianService physicianService, FacilityPhysicianService facilityPhysicianService) { _toAddFacility = new AddFacilityViewModel(facilityListViewModel, facilityService, physicianService, facilityPhysicianService); DataContext = _toAddFacility; InitializeComponent(); }
private async void Load() { await Navigation.PushPopupAsync(new LoadingModal()); System.Collections.Generic.List <Facility> r = await Controller.Instance.GetFacilities(App.LoadTestFacilities); if (r != null) { Model = new FacilityListViewModel(r); BindingContext = this; FacilitiesList.ItemsSource = Model.Facilities; } else { await Navigation.PopAsync(); } await Navigation.PopPopupAsync(); }
public static FacilityListViewModel ToViewModel(this IEnumerable <Organization> orgs) { FacilityListViewModel viewModel = null; if (orgs != null) { viewModel = new FacilityListViewModel() { Total = orgs.Count(), Facilities = orgs.ToList().Select(x => new FacilityItelViewModel() { Id = x.Id.ToString(), Name = x.Name, Address = x.Address.AddressLine1 + x.Address.AddressLine2, City = x.Address.City, ZipCode = x.Address.ZipCode, }), }; } return(viewModel); }