public SearchableTagViewModel(FilterOptionModel filterOption, bool hidden = false)
     : base(
         filterOption.DisplayText,
         filterOption.FilterValue,
         filterOption.TagStatus
         )
 {
     Hidden = hidden;
 }
Пример #2
0
        public async Task<List<Field>> GetFields(FilterOptionModel filter)
        {
			try{
            string url = String.Format(CultureInfo.InvariantCulture
               , "{0}/api/canchas", _urlPrefix);

            return await base.PostAsync<FilterOptionModel,List<Field>>(url,filter);
			}
			catch(Exception ex) {
				return new List<Field> ();
			}
        }
Пример #3
0
        /// <summary>
        /// Load Data From web api
        /// </summary>
        /// <returns></returns>
        public async Task GetFieldsFromApiAsync()
        {
            if (IsBusy)
            {
                return;
            }
            IsBusy = true;
            //var location = await DependencyService.Get<ILocationServiceSingleton>()
            //    .CalculatePositionAsync();

            var filter = new FilterOptionModel()
            {
                date = DateTime.Now
            };

            var collection = await CoreClient.FieldsService.GetFields(filter);

            if (collection != null && collection.Any())
            {
                FieldsCollection = new ObservableCollection <Field>(collection);
            }
            IsBusy = false;
        }