private static void DefaultImageSourceChanged(DependencyObject o, DependencyPropertyChangedEventArgs e) { DelayLoadImage instance = o as DelayLoadImage; if (instance != null && instance.defaultImage != null) { instance.defaultImage.Source = (ImageSource)e.NewValue; } }
private static void ActualImageSourceChanged(DependencyObject o, DependencyPropertyChangedEventArgs e) { DelayLoadImage instance = o as DelayLoadImage; if (instance != null) { instance.imageLoaded = false; instance.image.UriSource = new Uri(e.NewValue.ToString(), UriKind.RelativeOrAbsolute); VisualStateManager.GoToState(instance, STATE_DEFAULT_NAME, false); } }
private static void StretchChanged(DependencyObject o, DependencyPropertyChangedEventArgs e) { DelayLoadImage instance = o as DelayLoadImage; if (instance != null) { if (instance.defaultImage != null) { instance.defaultImage.Stretch = (Stretch)e.NewValue; } if (instance.actualImage != null) { instance.actualImage.Stretch = (Stretch)e.NewValue; } } }