﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using System.Windows.Media.Imaging;

namespace Meme.Pages
{
    public class Model
    {
        public string path { get; set; }
    }

    public partial class Gallary : PhoneApplicationPage
    {
        List<Model> memeModel = new List<Model>();

        public Gallary()
        {
            InitializeComponent();

            memeModel.Add(new Model() { path = "/Images/Memes/1.jpg" });

            for (int i = 2; i < 35; i++)
            {
                string temp = "/Images/Memes/" + i + ".png";
                memeModel.Add(new Model() { path = temp });
            }

            MemeList.ItemsSource = memeModel;

        }

        private void customMeme_Tap(object sender, System.Windows.Input.GestureEventArgs e)
        {
            // Customized meme
            Image temp = (Image)sender;

            BitmapImage bitMap = new BitmapImage();
            bitMap.UriSource = new Uri(temp.Tag.ToString(), UriKind.RelativeOrAbsolute);
            App.imageSource = bitMap;

            //Set TRUE
            App.isSelected = true;

            // Call Show Method
            NavigationService.Navigate(new Uri("/Pages/Create.xaml",UriKind.RelativeOrAbsolute));
        }


    }
}