/// <summary> /// Puts an ImagePreview in the normal or disabled state. /// </summary> /// <param name="obj">The dependency object.</param> /// <param name="e">The event information.</param> private static void IsFrozen_Changed(DependencyObject obj, DependencyPropertyChangedEventArgs e) { ImagePreview imagePreview = obj as ImagePreview; if (null != imagePreview) { imagePreview.UpdateState(); } }
/// <summary> /// TODO /// </summary> /// <param name="d"></param> /// <param name="dpcea"></param> private static void OnSourcePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs dpcea) { ImagePreview container = (ImagePreview)d; Image contained = (Image)container.Image; ImageSource source = (ImageSource)dpcea.NewValue; if (null != contained) { contained.Source = container._source = source; container.Image_Opened(contained, null); } else { container._source = source; } }