Example #1
0
        private void SetupEventsList()
        {
            var quary = from @event in EventSingleton.Catalog
                        group @event by @event.Date.Subtract(@event.Date.TimeOfDay)/*@event.Date.ToString("dd/MM/yyyy")*/
                        into eventByDate
                        orderby eventByDate.Key
                        select eventByDate;

            foreach (var eventGroup in quary)
            {
                Event eventSample = eventGroup.First();
                if (eventSample == null)
                {
                    throw new ArgumentException("Empty Groups");
                }

                ObservableCollection <HourGroup> hourGroupsThisDay = new ObservableCollection <HourGroup>();
                SetupHourGroups(hourGroupsThisDay);
                AddEvents(eventGroup, hourGroupsThisDay);

                _HourGroupsByDate.Add(hourGroupsThisDay);

                EventDays.Add(eventSample.Date.ToString("dd/MM dddd"));
            }

            SelectedDayIndex = 0;
            ListIsLoading    = false;
        }
        public async void GetActivities()
        {
            try {
                IEnumerable <EventDay> days = await activitySource.GetActivitiesByDate();

                foreach (EventDay day in days)
                {
                    EventDays.Add(day);
                }
                OnPropertyChanged();
            } catch (DataSourceException ex) {
                await ErrorDialogFactory.NetworkErrorDialog().ShowAsync();
            }
        }