Ejemplo n.º 1
0
        async Task ExecuteLoadEventsCommand()
        {
            if (IsBusy)
            {
                return;
            }

            IsBusy = true;

            try
            {
                Events.Clear();
                var events = await EventStore.GetAllEventAsync();

                Debug.WriteLine("events count :::::: " + events.Count());
                foreach (var _event in events)
                {
                    if (string.IsNullOrEmpty(this.UserCity) || _event.City.Equals(this.UserCity))
                    {
                        _event.PhotoUri = ImageStore.GetEventUrl(_event.PhotoUri);
                        Events.Add(_event);
                    }
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
            }
            finally
            {
                IsBusy = false;
            }
        }