示例#1
0
        private static void OnUriSourceChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            DeepZoomImageTileSource deepZoomImageTileSource = (DeepZoomImageTileSource)d;
            Uri oldUriSource = (Uri)e.OldValue;
            Uri uriSource    = deepZoomImageTileSource.UriSource;

            deepZoomImageTileSource.OnUriSourceChanged(oldUriSource, uriSource);
        }
示例#2
0
        public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
        {
            if (destinationType == null)
            {
                throw new ArgumentNullException("destinationType");
            }
            DeepZoomImageTileSource deepZoomImageTileSource = value as DeepZoomImageTileSource;

            if (deepZoomImageTileSource != null && CanConvertTo(context, destinationType))
            {
                Uri uriSource = deepZoomImageTileSource.UriSource;
                if (!uriSource.IsAbsoluteUri)
                {
                    return(uriSource.OriginalString);
                }
                return(uriSource.AbsoluteUri);
            }
            return(base.ConvertTo(context, culture, value, destinationType));
        }