private static void OnCustomParametersPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
 {
     if (d is ArcGISDynamicMapServiceLayer)
     {
         var newValue = e.NewValue as IEnumerable <KeyValuePair <string, string> >;
         var creator  = (d as ArcGISDynamicMapServiceLayer).GetValue(WebRequestCreatorProperty) as MyHttpRequestCreator;
         if (creator == null)
         {
             creator = new MyHttpRequestCreator(newValue);
             // Register prefix for a url with a custom http request creator
             WebRequest.RegisterPrefix((d as ArcGISDynamicMapServiceLayer).Url, creator);
             (d as ArcGISDynamicMapServiceLayer).SetValue(WebRequestCreatorProperty, creator);
         }
         else
         {
             creator.SetCallback(newValue);
         }
     }
 }
 private static void OnCustomParametersPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
 {
     if (d is ArcGISDynamicMapServiceLayer)
     {
         var newValue = e.NewValue as IEnumerable<KeyValuePair<string, string>>;
         var creator = (d as ArcGISDynamicMapServiceLayer).GetValue(WebRequestCreatorProperty) as MyHttpRequestCreator;
         if (creator == null)
         {
             creator = new MyHttpRequestCreator(newValue);
             // Register prefix for a url with a custom http request creator
             WebRequest.RegisterPrefix((d as ArcGISDynamicMapServiceLayer).Url, creator);
             (d as ArcGISDynamicMapServiceLayer).SetValue(WebRequestCreatorProperty, creator);
         }
         else
             creator.SetCallback(newValue);
     }
 }