Dynamically add CarouselPage's ContentPages

JassimRahmaJassimRahma USMember ✭✭✭

Hi,

I have below CarouselPage and I would like to ask how can I dynamically add its ContentPages? because the images are populated from database so it can be 10 or 20 or 100 or any number as per database query.

<?xml version="1.0" encoding="UTF-8"?>
<CarouselPage xmlns="http://xamarin.com/schemas/2014/forms"
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
    x:Class="Nasser.Gallery"
    Title="آلبوم الصور">
    <ContentPage>  
      <Image Source="http://www.nasseralkhalifa.bh/english/images/news/i-img-photogallery-news455-big04.jpg" />
    </ContentPage>  
    <ContentPage>  
      <Image Source="https://i.pinimg.com/236x/70/fd/c4/70fdc41af3ac962b768b48886fe35127.jpg" />
    </ContentPage>  
    <ContentPage>  
      <Image Source="http://www4.pictures.zimbio.com/gi/Sheikh+Nasser+bin+Hamad+al+Khalifa+Dubai+International+v5_eWw6Oevgl.jpg" />
    </ContentPage>  
    <ContentPage>  
      <Image Source="http://nbhtriplecrown.bh/img/HH-Sheikh-Nasser-Bin-Hamad-Al-Khalifa.jpg" />
    </ContentPage>  
    <ContentPage>  
      <Image Source="https://data.whicdn.com/images/40713716/large.jpg" />
    </ContentPage>  
</CarouselPage>

Thanks,
Jassim

Sign In or Register to comment.