public BookingViewModel(FieldDto fieldDto, string storeName) { _reservationServices = DependencyService.Get <IReservationServices>(); _fieldServices = DependencyService.Get <IFieldServices>(); BookCommand = new Command(async() => await ExecuteBookCommand(fieldDto)); Task.Run(async() => await ExecuteLoadItemsCommand(fieldDto, StoreName)); }
public SearchItemViewModel() { _enumServices = DependencyService.Get <IEnumServices>(); _fieldServices = DependencyService.Get <IFieldServices>(); Items = new ObservableCollection <FieldDto>(); SelectedProvinceIndexChangedCommand = new Command(() => _selectedProvince.Validate()); SelectedDistrictIndexChangedCommand = new Command(() => _selectedDistrict.Validate()); LoadDistrictCommand = new Command(async() => await LoadDistrictEnum(SelectedProvince.Value.Id.Value)); SearchItemCommand = new Command(async() => await OnSearchItemCommand()); Task.Run(async() => await ExecuteLoadItemsCommand()); InitValidation(); }
public ResultSearchItemViewModel(double startPrice, double toPrice, int?districtId, int?provinceId) { _fieldServices = DependencyService.Get <IFieldServices>(); Items = new ObservableCollection <YourFieldModel>(); ItemTapped = new Command <YourFieldModel>(OnItemSelected); int?pro = provinceId == 0 || provinceId == null ? 0 : provinceId; if (pro == 0) { pro = null; } int?dis = districtId == 0 || districtId == null ? 0 : districtId; if (dis == 0) { dis = null; } LoadItemsCommand = new Command(async() => await ExecuteLoadItemsCommand(startPrice, toPrice, dis, pro)); }
public FieldGroupController(IFieldServices fieldService) { this.fieldService = fieldService; }