/// <summary> /// Create FlippingPhotoCards from image path string. /// </summary> /// <param name="photoPath"></param> public void CreateImageContainer(string photoPath) { BitmapImage bitmapImageForFrontAndBack = new BitmapImage(new Uri(photoPath)); double w = bitmapImageForFrontAndBack.Width; double h = bitmapImageForFrontAndBack.Height; //photocard FlippingPhotoCard imageCard = new FlippingPhotoCard(); imageCard.imgFront.Source = bitmapImageForFrontAndBack; //imageCard.imgFront.Stretch = Stretch.Uniform; //imageCard.imgBack.Source = bitmapImageForFrontAndBack; imageCard.Name = "play"; imageCard.CanScale = false; imageCard.ContainerManipulationStarted += new ContainerManipulationStartedEventHandler(svi_ContainerManipulationStarted); imageCard.Center = new Point(FLIPPINGPHOTOCARDWIDTHandHEIGHT * this.Items.Count + 1, this.Height / 2); imageCard.Orientation = 90; this.Items.Add(imageCard); }
//method public FlippingPhotoCard DeepClone() { FlippingPhotoCard copy = new FlippingPhotoCard(); copy.imgFront.Source = this.imgFront.Source; copy.imgFront.Stretch = Stretch.Uniform; copy.imgBack.Source = this.imgBack.Source; //copy.ImageDescription.Content = this.ImageDescription.Content; //copy._score = this._score; //Thumbnail t = new Thumbnail(); //t.ThumbImage.Source = this.imgFront.Source; //copy._thumbnail = t; //copy._thumbnail.MyPhotoCard = this; return copy; }
/// <summary> /// Takes an SVI, copies everything about it and /// returns the copy as a "Copy." Won't be animated as if in river /// </summary> /// <param name="original"></param> /// <returns></returns> public FlippingPhotoCard TransferCopyToNewScatterView(FlippingPhotoCard original) { FlippingPhotoCard copyCard = (FlippingPhotoCard)original.DeepClone(); original.Name = "Copy"; original.ContainerManipulationStarted -= new ContainerManipulationStartedEventHandler(svi_ContainerManipulationStarted); //original.ContainerManipulationCompleted += new ContainerManipulationCompletedEventHandler(CopiedSVI_ContainerManipulationCompleted); copyCard.Name = "play"; copyCard.BorderThickness = new Thickness(0); copyCard.CanScale = false; copyCard.Center = original.Center; copyCard.Orientation = original.Orientation; copyCard.ContainerManipulationStarted += new ContainerManipulationStartedEventHandler(svi_ContainerManipulationStarted); return copyCard; }