GetAnimateInDesignMode() public static method

public static GetAnimateInDesignMode ( DependencyObject obj ) : bool
obj DependencyObject
return bool
示例#1
0
        private static bool CheckDesignMode(Image image, Uri sourceUri, Stream sourceStream)
        {
            if (!AnimationBehavior.IsInDesignMode((DependencyObject)image) || AnimationBehavior.GetAnimateInDesignMode((DependencyObject)image))
            {
                return(true);
            }
            BitmapImage bitmapImage = new BitmapImage();

            if (sourceStream != null)
            {
                ((BitmapSource)bitmapImage).SetSource(sourceStream);
            }
            else if (sourceUri != null)
            {
                bitmapImage.UriSource = sourceUri;
            }
            image.Source = ((ImageSource)bitmapImage);
            return(false);
        }