public void CreateList(string startDate, string endDate, List <ServerSession> sessions) { scheduleDays.Clear(); DaysList.Children.Clear(); eventSessions = sessions; DateTime start = DateTime.ParseExact(startDate, "MM-dd-yyyy", CultureInfo.CurrentCulture.DateTimeFormat); DateTime end = DateTime.ParseExact(endDate, "MM-dd-yyyy", CultureInfo.CurrentCulture.DateTimeFormat); int totalDays = 1; if (start != end) { totalDays = (int)end.Subtract(start).TotalDays + 1; } for (int i = 0; i < totalDays; i++) { DayButtonTemplate day = new DayButtonTemplate(); DateTime today = start.AddDays(i); day.SetButtonText(today.ToString("MMM") + " " + today.Day.ToString(), i, CreateCurrentList); scheduleDays.Add(day); DaysList.Children.Add(day); } scheduleDays[currentDay].SetButton(); CurrentList(); date.IsVisible = true; }
public async void CreateMapScreen(List <ServerFloorMap> _mapList) { currentMapIndex = 0; mapButtons.Clear(); floorList.Children.Clear(); maps = _mapList; mapHeading.Text = ""; mapImage.Source = ""; for (int i = 0; i < maps.Count; i++) { DayButtonTemplate d = new DayButtonTemplate(); d.SetButtonText("Map " + (i + 1).ToString(), i, SetCurrentMap); if (i == 0) { d.SetButton(); } floorList.Children.Add(d); mapButtons.Add(d); } if (maps.Count > 0) { emptyList.IsVisible = false; floorMaps.IsVisible = true; mapButtons[0].SetButton(); mapHeading.Text = maps[0].eventFloorMapName; mapImage.Source = new UriImageSource { Uri = new Uri(maps[0].eventFloorMapURL), CachingEnabled = false }; } else { floorMaps.IsVisible = false; emptyList.IsVisible = true; } await((HomeLayout)App.Current.MainPage).SetLoading(false, "Loading event sessions..."); }