ArcGISTiledMapServiceLayer URL Data Binding

933
5
11-17-2010 01:49 PM
AmrinderGanda
New Contributor II
Hi,

Not sure if I am doing it wrong or it is not possible. I am trying to bind the url property of a tiled map service layer and I get this exception in InitializeComponent()

Set property 'ESRI.ArcGIS.Client.ArcGISTiledMapServiceLayer.Url' threw an exception.

Thanks,
AG
0 Kudos
5 Replies
JenniferNery
Esri Regular Contributor
That exception is expected because the layer's URL is not a bindable property.  It is neither DependencyProperty nor a property that will raise PropertyChanged.  It therefore expects a string not a binding statement.
0 Kudos
AmrinderGanda
New Contributor II
Thanks for the information Jennifer.

AG
0 Kudos
ThomasBoring
New Contributor II
Is this still true?  Is the URL property of the ArcGISTiledMapServiceLayer not bindable?  The URL property of the ArcGISDynamicMapServiceLayer IS bindable...and these two controls are VERY similar, so it seems odd that the URL property of one would be bindable but the URL property of the other isn't.
0 Kudos
ThomasBoring
New Contributor II
Is this still true?  Is the URL property of the ArcGISTiledMapServiceLayer not bindable?  The URL property of the ArcGISDynamicMapServiceLayer IS bindable...and these two controls are VERY similar, so it seems odd that the URL property of one would be bindable but the URL property of the other isn't.


Bueler?  Bueler?  Anyone?  Bueler?
0 Kudos
DominiqueBroux
Esri Frequent Contributor
You are right there is an incoherence somewhere.

The workaround is to create an attached property and to set the Url in this attached property.

Note however that a layer is not a FrameworkElement and thus doesn't support DataContext. So you will be limited in the binding possibilities (but Binding to a static ressource should work).
0 Kudos