Example #1
0
        internal ObservableCollection <ListViewGalleryInfo> GetGalleryInfo()
        {
            var      galleryInfo = new ObservableCollection <ListViewGalleryInfo>();
            var      random      = new Random();
            Assembly assembly    = typeof(GridLayout).GetTypeInfo().Assembly;

            for (int i = 1; i <= 30; i++)
            {
                var gallery = new ListViewGalleryInfo()
                {
#if COMMONSB
                    Image = ImageSource.FromResource("SampleBrowser.Icons.GridLayout.Image" + i + ".jpg", assembly),
#else
                    Image = ImageSource.FromResource("SampleBrowser.SfListView.Icons.GridLayout.Image" + i + ".jpg", assembly),
#endif
                    ImageTitle         = random.Next(1242, 5383) + ".jpg",
                    CreatedDate        = GetCreatedDate(i),
                    IsFavoriteSelected = i % 2 == 0 || i % 3 == 0 ? true : false
                };
#if COMMONSB
                gallery.FavoritesImage = gallery.IsFavoriteSelected ? ImageSource.FromResource("SampleBrowser.Icons.GridLayout.Favorite1.png", assembly) : ImageSource.FromResource("SampleBrowser.Icons.GridLayout.Favorite2.png", assembly);
#else
                gallery.FavoritesImage = gallery.IsFavoriteSelected ? ImageSource.FromResource("SampleBrowser.SfListView.Icons.GridLayout.Favorite1.png", assembly) : ImageSource.FromResource("SampleBrowser.SfListView.Icons.GridLayout.Favorite2.png", assembly);
#endif
                galleryInfo.Add(gallery);
            }
            return(galleryInfo);
        }
        internal ObservableCollection <ListViewGalleryInfo> GetGalleryInfo()
        {
            var galleryInfo = new ObservableCollection <ListViewGalleryInfo>();
            var random      = new Random();

            for (int i = 1; i <= 30; i++)
            {
                var gallery = new ListViewGalleryInfo()
                {
                    Image       = Images[i - 1] + ".jpg",
                    ImageTitle  = random.Next(1242, 5383) + ".jpg",
                    CreatedDate = GetCreatedDate(i),
                    IsFavorite  = i % 2 == 0 || i % 3 == 0 ? true : false
                };
                galleryInfo.Add(gallery);
            }
            return(galleryInfo);
        }