Exemplo n.º 1
0
        private static void OnUriSourceChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            var image = d as SmartImage;

            if (Current == null)
            {
                return;
            }
            if (image == null)
            {
                throw new ArgumentNullException("image");
            }
            var url = e.NewValue as string;
            ImageSourceProxy proxy = null;

            if (Current.proxyList.ContainsKey(url))
            {
                proxy = Current.proxyList[url];
            }
            else
            {
                proxy                  = new ImageSourceProxy();
                proxy.SourceUrl        = url;
                Current.proxyList[url] = proxy;
            }
            proxy.AddSmartImage(image);
        }
Exemplo n.º 2
0
 private static void OnUriSourceChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
 {
     var image = d as SmartImage;
     if (Current == null) return;
     if (image == null) throw new ArgumentNullException("image");
     var url = e.NewValue as string;
     ImageSourceProxy proxy = null;
     if (Current.proxyList.ContainsKey(url))
         proxy = Current.proxyList[url];
     else
     {
         proxy = new ImageSourceProxy();
         proxy.SourceUrl = url;
         Current.proxyList[url] = proxy;
     }
     proxy.AddSmartImage(image);
 }