Exemple #1
0
        private async Task <Event[]> GetEvents()
        {
            try
            {
                //  TODO: BETTER HANDLE OF ERRORS
                var location       = this._settingsContainer.GetGeolocation();
                var eventDateRange = this._settingsContainer.GetEventDateRange();
                var events         =
                    await
                    this._service.GetEvents(location.Item1, location.Item2,
                                            SettingsContainer.Convert(eventDateRange));

                var eventsArray = events.ToArray();


                //  TODO: BIND BUTTON ENABLING TO COMMANDS
                if (!eventsArray.Any())
                {
                    this.HasEvents = false;
                }
                return(eventsArray);
            }
            catch (Exception ex)
            {
                this.HasEvents = false;
                return(new Event[0]);
            }
        }