private static bool imageCompare(System.Windows.Controls.Image image, System.Windows.Controls.Image currentImage) { if (System.Windows.Controls.Canvas.GetTop(currentImage) == System.Windows.Controls.Canvas.GetTop(image)) return false; if (System.Windows.Controls.Canvas.GetLeft(currentImage) == System.Windows.Controls.Canvas.GetLeft(image)) return false; if (image.Source.ToString() != currentImage.Source.ToString()) return false; if (image.tag().id != currentImage.tag().id) return false; return true; }
public void AddImage(System.Windows.Controls.Image image) { try { if (!imageExistsOnCanvas(image)) { Panel.SetZIndex(image, image.tag().isBackground ? 1 : 2); Children.Add(image); } } catch (Exception e) { Trace.TraceError(string.Format("I could not add this image because {0}", e)); } }
public void AddImage(System.Windows.Controls.Image image) { try { if (image.tag().isBackground) Background = new VisualBrush(image); else if (!imageExistsOnCanvas(image)) { image.Margin = new Thickness(PADDING, PADDING, PADDING, PADDING); Children.Add(image); } } catch (Exception e) { MessageBox.Show("Sorry, your image could not be imported"); } }