Select to view content in your preferred language

SourceUri and TemplateUri binding in MVVM

05-26-2016 12:24 PM
Occasional Contributor

Working in ArcGIS runtime for .NET version 10.2.7 ....

I've noticed that WebTiledLayer's TemplateUri property and KmlLayer's SourceUri property don't respond to updates when using data binding with via MVVM pattern. Is this a known bug, or has it been designed this way, or am I possibly doing something wrong?

If I use the following code, the layer is updated:

var layer = MapView.Map.Layers["weather"] as WebTiledLayer;

layer.TemplateUri = "...." + "/" + "{level}/{col}_{row}.png"; // working

However, if I do something like this, it doesn't update:

In xaml ...

<esri:WebTiledLayer ID="AccuWeather" TemplateUri="{Binding WeatherUri, UpdateSourceTrigger=PropertyChanged}" />

In C# view model ...

WeatherUri = "...." + "/" + "{level}/{col}_{row}.png"; // not working

And I have confirmed that property changed event fires when WeatherUri is updated.

There is similar behavior with KmlLayer's SourceUri property. It doesn't work with data binding either. Instead I have to delete and add the layer again which is causing flickering on my map.

0 Kudos
0 Replies