public EyeemMemoryCard(string frontImage, EyeemPhoto photo)
		{
			// Für das Initialisieren der Variablen erforderlich
			InitializeComponent();
            canBeChanged = true;
            this.FrontImage.ManipulationCompleted += new EventHandler<ManipulationCompletedEventArgs>(FrontImage_ManipulationCompleted);
            //this.BackImage.ManipulationCompleted += new EventHandler<ManipulationCompletedEventArgs>(FrontImage_ManipulationCompleted);
            this.BackImage.Visibility = Visibility.Collapsed;
            this.myPhoto = photo;
            BitmapImage image = new BitmapImage();
            
            if (frontImage.Equals("black"))
            {
                image.UriSource = new Uri("Images/card_black.png", UriKind.Relative);
                this.FrontImage.Source = image;
            }
            else
            {
                image.UriSource = new Uri("Images/card_grey.png", UriKind.Relative);
                this.FrontImage.Source = image;
            }

            this.BackImage.Source = photo.rawImage;
            this.BackImage.Visibility = Visibility.Visible;

		}
 public PhotoPopup(EyeemPhoto photoObj)
 {
     InitializeComponent();
     myPhoto = photoObj;
     photo.Source = new BitmapImage(new Uri(myPhoto.photoUrl));
     
 }
Example #3
0
        public static List<EyeemAlbum> parseOutput(string json)
        {
            bool flagPhoto = false;
            bool flagAlbum = false;

            List<EyeemAlbum> albums = new List<EyeemAlbum>();
            EyeemAlbum album = null;
            EyeemPhoto photo = null;

            string[] parts = json.Split('{');

            foreach (string elements in parts)
            {
                string[] attributes = elements.Split('"');
                if (containsString(attributes,"name"))
                {
                    //Photo Element
                    album = new EyeemAlbum();
                    flagAlbum = true;
                    flagPhoto = false;
                }
                else if (containsString(attributes, "width"))
                {
                    //Photo Element
                    photo = new EyeemPhoto();
                    flagPhoto = true;
                    flagAlbum = false;
                }

                for (int i = 0; i < attributes.Length; i++)
                {
                    if (flagAlbum)
                    {
                        //Parse Album
                    }
                    else if (flagPhoto)
                    {
                        //Parse Photo
                    }
                    else
                    {
                        //Nothing
                    }

                }
    
            }
            return albums;
        }