Example #1
0
    protected void rptFAQGroup_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        if (e == null)
        {
            throw new ArgumentNullException(nameof(e));
        }

        Accordion acc = (Accordion)e.Item.FindControl("accFAQGroup");
        FAQGroup  fg  = (FAQGroup)e.Item.DataItem;

        acc.DataSource = fg.Items;
        acc.DataBind();

        // Auto-expand if it contains the selected FAQ item
        int i = 0;

        foreach (FAQItem fi in fg.Items)
        {
            if (fi.idFAQ == SelectedFAQItem)
            {
                acc.SelectedIndex = i;
            }
            i++;
        }
    }
        public CursosVista()
        {
            InitializeComponent();
            Contenido = new ScrollView
            {
                HorizontalOptions = LayoutOptions.FillAndExpand,
                VerticalOptions   = LayoutOptions.FillAndExpand,
                Padding           = new Thickness(40, 0)
            };

            CursosListado = new List <CursosAgrupacionModeloVista>();
            try
            {
                foreach (var curso in App.Database.GetCursos().ToList())
                {
                    CursosListado.Add(new CursosAgrupacionModeloVista()
                    {
                        Nombre  = curso.nombre,
                        Codigo  = curso.idCurso,
                        Seccion = curso.seccion
                    });
                }
                CursosAccordion = new Accordion()
                {
                    FirstExpaned = true,
                    DataSource   = Cursos()
                };
                CursosAccordion.DataBind();
                Contenido.Content = CursosAccordion;
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine((ex.StackTrace));
            }

            Label contactar = new Label
            {
                Text              = "¿Tienes dudas? contáctanos.",
                TextColor         = Color.FromHex("3E1152"),
                FontFamily        = Device.OnPlatform("Montserrat-Regular", "Montserrat-Regular", null),
                FontSize          = 14,
                Margin            = new Thickness(0, 0, 0, 20),
                VerticalOptions   = LayoutOptions.End,
                HorizontalOptions = LayoutOptions.Center
            };
            var tap2 = new TapGestureRecognizer();

            tap2.Tapped += (s, e) =>
            {
                Device.OpenUri(new Uri("https://goo.gl/F2LzXD"));
            };
            contactar.GestureRecognizers.Add(tap2);

            Label verMas = new Label
            {
                FontFamily = Device.OnPlatform("OpenSans", "OpenSans-Regular", null),
                TextColor  = Color.FromHex("B2B2B2"),
                HorizontalTextAlignment = TextAlignment.Center,
                HorizontalOptions       = LayoutOptions.Center,
                FontSize = 10,
            };

            BoxView separador = new BoxView
            {
                BackgroundColor   = Color.FromHex("B2B2B2"),
                VerticalOptions   = LayoutOptions.End,
                HorizontalOptions = LayoutOptions.Center,
                WidthRequest      = 70,
                HeightRequest     = 1,
                IsVisible         = false
            };

            if (Settings.session_role.Equals("C"))
            {
                verMas.Text         = "(Presiona el contenido para ver más)";
                separador.IsVisible = true;
            }
            Content = new StackLayout
            {
                Children =
                {
                    new Grid
                    {
                        HeightRequest = 165,
                        Children      =
                        {
                            new Image
                            {
                                Source            = "header.png",
                                HorizontalOptions = LayoutOptions.FillAndExpand,
                                VerticalOptions   = LayoutOptions.Start,
                                Margin            = new Thickness(-25, 0),
                                Aspect            = Aspect.AspectFill
                            },
                            new Image
                            {
                                Source          = "misCursos.png",
                                WidthRequest    = 220,
                                VerticalOptions = LayoutOptions.End,
                                Margin          = new Thickness(0, 0, 0, 10)
                            }
                        }
                    },
                    Contenido,
                    separador,
                    verMas,
                    new BoxView
                    {
                        BackgroundColor   = Color.Transparent,
                        VerticalOptions   = LayoutOptions.End,
                        HorizontalOptions = LayoutOptions.FillAndExpand,
                        WidthRequest      = 70,
                        HeightRequest     = 5
                    },
                    contactar,

                    new BoxView
                    {
                        BackgroundColor   = Color.FromHex("3E1152"),
                        VerticalOptions   = LayoutOptions.End,
                        HorizontalOptions = LayoutOptions.FillAndExpand,
                        HeightRequest     = 2
                    }
                }
            };
        }
Example #3
0
 public FAQVista()
 {
     InitializeComponent();
     Contenido = new ScrollView
     {
         HorizontalOptions = LayoutOptions.FillAndExpand,
         VerticalOptions   = LayoutOptions.FillAndExpand,
         Padding           = new Thickness(40, 0)
     };
     FAQsListado = new List <FAQsAgrupacionModeloVista>();
     try
     {
         foreach (var faq in App.Database.GetFAQs().ToList())
         {
             FAQsListado.Add(new FAQsAgrupacionModeloVista()
             {
                 Pregunta  = faq.pregunta,
                 Respuesta = faq.respuesta
             });
         }
         FAQsAccordion = new Accordion()
         {
             FirstExpaned = true,
             DataSource   = Cursos()
         };
         FAQsAccordion.DataBind();
         Contenido.Content = FAQsAccordion;
     }
     catch (Exception ex)
     {
         System.Diagnostics.Debug.WriteLine((ex.StackTrace));
     }
     Content = new StackLayout
     {
         Children =
         {
             new Grid
             {
                 HeightRequest = 165,
                 Children      =
                 {
                     new Image
                     {
                         Source            = "header.png",
                         HorizontalOptions = LayoutOptions.FillAndExpand,
                         VerticalOptions   = LayoutOptions.Start,
                         Margin            = new Thickness(-25, 0),
                         Aspect            = Aspect.AspectFill
                     },
                     new Image
                     {
                         Source          = "preguntasFrecuentes.png",
                         WidthRequest    = 220,
                         VerticalOptions = LayoutOptions.End,
                         Margin          = new Thickness(0, 0, 0, 10)
                     }
                 }
             },
             Contenido,
             new BoxView
             {
                 BackgroundColor   = Color.FromHex("3E1152"),
                 VerticalOptions   = LayoutOptions.End,
                 HorizontalOptions = LayoutOptions.FillAndExpand,
                 HeightRequest     = 2
             }
         }
     };
 }