<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic SourceUri and TemplateUri binding in MVVM in Developers Questions</title>
    <link>https://community.esri.com/t5/developers-questions/sourceuri-and-templateuri-binding-in-mvvm/m-p/469919#M3143</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Working in ArcGIS runtime for .NET version 10.2.7 ....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I use the following code, the layer is updated:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: calibri,verdana,arial,sans-serif;"&gt;var layer = MapView.Map.Layers["weather"] as WebTiledLayer;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: calibri,verdana,arial,sans-serif;"&gt;layer.TemplateUri = "...." + "/" + "{level}/{col}_{row}.png"; // working&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P&gt;However, if I do something like this, it doesn't update:&lt;/P&gt;&lt;P&gt;In xaml ...&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: calibri,verdana,arial,sans-serif;"&gt; &amp;lt;esri:WebTiledLayer ID="AccuWeather" TemplateUri="{Binding WeatherUri, UpdateSourceTrigger=PropertyChanged}" /&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P&gt;In C# view model ...&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: calibri,verdana,arial,sans-serif;"&gt;WeatherUri = "...." + "/" + "{level}/{col}_{row}.png"; // not working&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And I have confirmed that property changed event fires when WeatherUri is updated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 26 May 2016 19:24:12 GMT</pubDate>
    <dc:creator>KeithGemeinhart</dc:creator>
    <dc:date>2016-05-26T19:24:12Z</dc:date>
    <item>
      <title>SourceUri and TemplateUri binding in MVVM</title>
      <link>https://community.esri.com/t5/developers-questions/sourceuri-and-templateuri-binding-in-mvvm/m-p/469919#M3143</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Working in ArcGIS runtime for .NET version 10.2.7 ....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I use the following code, the layer is updated:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: calibri,verdana,arial,sans-serif;"&gt;var layer = MapView.Map.Layers["weather"] as WebTiledLayer;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: calibri,verdana,arial,sans-serif;"&gt;layer.TemplateUri = "...." + "/" + "{level}/{col}_{row}.png"; // working&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P&gt;However, if I do something like this, it doesn't update:&lt;/P&gt;&lt;P&gt;In xaml ...&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: calibri,verdana,arial,sans-serif;"&gt; &amp;lt;esri:WebTiledLayer ID="AccuWeather" TemplateUri="{Binding WeatherUri, UpdateSourceTrigger=PropertyChanged}" /&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P&gt;In C# view model ...&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: calibri,verdana,arial,sans-serif;"&gt;WeatherUri = "...." + "/" + "{level}/{col}_{row}.png"; // not working&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And I have confirmed that property changed event fires when WeatherUri is updated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 May 2016 19:24:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/sourceuri-and-templateuri-binding-in-mvvm/m-p/469919#M3143</guid>
      <dc:creator>KeithGemeinhart</dc:creator>
      <dc:date>2016-05-26T19:24:12Z</dc:date>
    </item>
  </channel>
</rss>

