Пример #1
0
        public void CallCompleted(ApiResponse result)
        {
            int dia = 0;
            DateTime comienzoEvento;
            Accordion accActual = new Accordion();
            RowAccordion fila;
            List<GetScheduleResponse> response = result.GetTypedResponse<List<GetScheduleResponse>>();

            comienzoEvento = SettingsManager.EventSingleton.start;

            foreach (GetScheduleResponse item in response)
            {
                if (item.day != dia)
                {
                    accActual = new Accordion();

                    accActual.Titulo = comienzoEvento.AddDays(dia).ToString("dd MMMM yyyy", new CultureInfo("es-ES"));
                    accActual.Descripcion = item.place;

                    stackBody.Children.Add(accActual);

                    fila = accActual.AddRow();
                    fila.Hora = item.start;
                    fila.Titulo = item.title;
                    fila.Descripcion = item.place;
                }
                else
                {

                    fila = accActual.AddRow();
                    fila.Hora = item.start;
                    fila.Titulo = item.title;
                    fila.Descripcion = item.place;
                }
                dia = item.day;
            }

            //if (!string.IsNullOrEmpty(response.name))
            //{
            // TODO: Save the information in the localstorage.

            //SettingsManager.LoggedUserSingleton = response;
            //SettingsManager.SaveSetting(SettingsManager.SettingsConstants.LOGGED_USER.ToString(), JsonConvert.SerializeObject(response));

            //Frame.Navigate(typeof(Home));

            //}
            //else
            //{
            //    // TODO: Display an error.
            //}
        }