<?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 How to use an editor in MVVM in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/how-to-use-an-editor-in-mvvm/m-p/463614#M11929</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I am planning to use editor to select elements in the map and do something to the elements. Since I am using MVVM in the project, I was thinking about binding the map object to a map in view model, creating an editor in view model and set the map property as the map in view model. In this way, I can just wire up a button command to a command in view model to use the editor. Unfortunately, when I set the map in view model as the data context of the map in xaml, the map place was blank when program was running. Instead, when I just wire up the map's 'Layers' property to LayerCollection objcet in view model, it works well.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The problem is that when i just binding the 'Layers' property, I can not set the 'map' property of the editor in view model as the map in view, they are not in one place.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I wonder whether there is a way to create an editor in xaml and set its 'map' property as the map in xaml and binding this editor to the editor object in view model.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Look forward to your reply.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 25 Nov 2013 02:08:08 GMT</pubDate>
    <dc:creator>dingkaichen</dc:creator>
    <dc:date>2013-11-25T02:08:08Z</dc:date>
    <item>
      <title>How to use an editor in MVVM</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/how-to-use-an-editor-in-mvvm/m-p/463614#M11929</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I am planning to use editor to select elements in the map and do something to the elements. Since I am using MVVM in the project, I was thinking about binding the map object to a map in view model, creating an editor in view model and set the map property as the map in view model. In this way, I can just wire up a button command to a command in view model to use the editor. Unfortunately, when I set the map in view model as the data context of the map in xaml, the map place was blank when program was running. Instead, when I just wire up the map's 'Layers' property to LayerCollection objcet in view model, it works well.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The problem is that when i just binding the 'Layers' property, I can not set the 'map' property of the editor in view model as the map in view, they are not in one place.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I wonder whether there is a way to create an editor in xaml and set its 'map' property as the map in xaml and binding this editor to the editor object in view model.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Look forward to your reply.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Nov 2013 02:08:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/how-to-use-an-editor-in-mvvm/m-p/463614#M11929</guid>
      <dc:creator>dingkaichen</dc:creator>
      <dc:date>2013-11-25T02:08:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to use an editor in MVVM</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/how-to-use-an-editor-in-mvvm/m-p/463615#M11930</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I was thinking about binding the map object to a map in view model&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Unfortunately, when I set the map in view model as the data context of the map in xaml&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;There should be only one instance of the Map class.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If you have a Map property in your VM that holds a Map instance, you can write something like that in XAML:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;&amp;lt;ContentControl Content="{Binding Map}" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" /&amp;gt;&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;In this way, I can just wire up a button command to a command in view model to use the editor.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;You can use ElementName binding to bind a button to an Editor`s command without a VM.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Nov 2013 10:41:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/how-to-use-an-editor-in-mvvm/m-p/463615#M11930</guid>
      <dc:creator>DenisT</dc:creator>
      <dc:date>2013-11-25T10:41:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to use an editor in MVVM</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/how-to-use-an-editor-in-mvvm/m-p/463616#M11931</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;There should be only one instance of the Map class.&lt;BR /&gt;If you have a Map property in your VM that holds a Map instance, you can write something like that in XAML:&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;lt;ContentControl Content="{Binding Map}"
HorizontalContentAlignment="Stretch"
VerticalContentAlignment="Stretch" /&amp;gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;You can use ElementName binding to bind a button to an Editor`s command without a VM.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you Denis! You really solved my problem.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 20:35:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/how-to-use-an-editor-in-mvvm/m-p/463616#M11931</guid>
      <dc:creator>dingkaichen</dc:creator>
      <dc:date>2021-12-11T20:35:21Z</dc:date>
    </item>
  </channel>
</rss>

