예제 #1
0
        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;
            }
        }
예제 #2
0
        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);
            }
        }
예제 #3
0
        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;
                }
            }
        }