<?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 Re: esri:Map and databinding + MVVM in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/esri-map-and-databinding-mvvm/m-p/708878#M18204</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;How to you create tour pointdatasource? You can add attributes to your graphics and these attributes shold then be able to be displayed on the symbol.&lt;BR /&gt;&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;esri:GraphicsLayer.GraphicsSource&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;esri:PointDataSource ItemsSource="{Binding DataSource.ServiceOrderLocations, Source={StaticResource DataContextProxy}}" XCoordinateBinding="{Binding ServiceOrderLocation.Longitude}" YCoordinateBinding="{Binding ServiceOrderLocation.Latitude}"&amp;gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/esri:PointDataSource&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/esri:GraphicsLayer.GraphicsSource&amp;gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;How to add attributes on PointDataSource, do you have a sample of that?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;BR /&gt;Probably that the correct position is the top left position of your symbol. If that's the case, it's a 'center' issue.&lt;BR /&gt;You can either apply a negative margin to your element (half it's size), or surround it with your own container that would center it's content&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The elements all just came to sea near Africa. I think, thats the 0,0,0,0 position.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 27 Aug 2012 10:01:34 GMT</pubDate>
    <dc:creator>PetteriLehtonen</dc:creator>
    <dc:date>2012-08-27T10:01:34Z</dc:date>
    <item>
      <title>esri:Map and databinding + MVVM</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/esri-map-and-databinding-mvvm/m-p/708876#M18202</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;BR /&gt;&lt;SPAN&gt;I'm really struggling with the Silverlight map control and data binding with MVVM.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there actually a good way to do this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So far I have tried:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;PointDatasource with a custom MarkerSymbol, could not get properties to custom symbol (i want to forexample show a customername textblock on the symbol, checkboxes with TwoWay binding etc.)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ElemenLayer where i create elements manually (on code-behind), but this way i cant get the items to be on correct position. (My next plan was to set the binding manually on code-behind)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;(Somethin like this):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Button pinni = new Button();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Envelope el = new Envelope(Latitude, Longitude, Latitude, Longitude);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;pinni.SetValue(ElementLayer.EnvelopeProperty, el);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;elementlayer.Children.Add(pinni);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Tried looking at all the samples i could find, but so far haven't found nothing like this. That really supprises me since this should be the "defacto" way to do these things....&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Petteri&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Aug 2012 09:44:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/esri-map-and-databinding-mvvm/m-p/708876#M18202</guid>
      <dc:creator>PetteriLehtonen</dc:creator>
      <dc:date>2012-08-24T09:44:58Z</dc:date>
    </item>
    <item>
      <title>Re: esri:Map and databinding + MVVM</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/esri-map-and-databinding-mvvm/m-p/708877#M18203</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;PointDatasource with a custom MarkerSymbol, could not get properties to custom symbol (i want to forexample show a customername textblock on the symbol, checkboxes with TwoWay binding etc.)&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;How to you create tour pointdatasource? You can add attributes to your graphics and these attributes shold then be able to be displayed on the symbol.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;ElemenLayer where i create elements manually (on code-behind), but this way i cant get the items to be on correct position. (My next plan was to set the binding manually on code-behind)&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Probably that the correct position is the top left position of your symbol. If that's the case, it's a 'center' issue.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;You can either apply a negative margin to your element (half it's size), or surround it with your own container that would center it's content.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Aug 2012 07:46:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/esri-map-and-databinding-mvvm/m-p/708877#M18203</guid>
      <dc:creator>DominiqueBroux</dc:creator>
      <dc:date>2012-08-27T07:46:06Z</dc:date>
    </item>
    <item>
      <title>Re: esri:Map and databinding + MVVM</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/esri-map-and-databinding-mvvm/m-p/708878#M18204</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;How to you create tour pointdatasource? You can add attributes to your graphics and these attributes shold then be able to be displayed on the symbol.&lt;BR /&gt;&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;esri:GraphicsLayer.GraphicsSource&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;esri:PointDataSource ItemsSource="{Binding DataSource.ServiceOrderLocations, Source={StaticResource DataContextProxy}}" XCoordinateBinding="{Binding ServiceOrderLocation.Longitude}" YCoordinateBinding="{Binding ServiceOrderLocation.Latitude}"&amp;gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/esri:PointDataSource&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/esri:GraphicsLayer.GraphicsSource&amp;gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;How to add attributes on PointDataSource, do you have a sample of that?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;BR /&gt;Probably that the correct position is the top left position of your symbol. If that's the case, it's a 'center' issue.&lt;BR /&gt;You can either apply a negative margin to your element (half it's size), or surround it with your own container that would center it's content&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The elements all just came to sea near Africa. I think, thats the 0,0,0,0 position.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Aug 2012 10:01:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/esri-map-and-databinding-mvvm/m-p/708878#M18204</guid>
      <dc:creator>PetteriLehtonen</dc:creator>
      <dc:date>2012-08-27T10:01:34Z</dc:date>
    </item>
    <item>
      <title>Re: esri:Map and databinding + MVVM</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/esri-map-and-databinding-mvvm/m-p/708879#M18205</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;The elements all just came to sea near Africa. I think, thats the 0,0,0,0 position.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Might be a spatial reference issue,e.g&amp;nbsp; the map in Web Mercator coordinates and data in geographical coordinates.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Like this:&lt;BR /&gt;&amp;lt;esri:GraphicsLayer.GraphicsSource&amp;gt; &lt;BR /&gt;&amp;lt;esri:PointDataSource ItemsSource="{Binding DataSource.ServiceOrderLocations, Source={StaticResource DataContextProxy}}" XCoordinateBinding="{Binding ServiceOrderLocation.Longitude}" YCoordinateBinding="{Binding ServiceOrderLocation.Latitude}"&amp;gt; &lt;BR /&gt;&amp;lt;/esri:PointDataSource&amp;gt;&lt;BR /&gt;&amp;lt;/esri:GraphicsLayer.GraphicsSource&amp;gt; &lt;BR /&gt;&lt;BR /&gt;How to add attributes on PointDataSource, do you have a sample of that?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;AS you are using a PoitDataSource there is a sample here : &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/silverlight-api/samples/start.htm#UsingPointDataSource" rel="nofollow noopener noreferrer" target="_blank"&gt;http://resources.arcgis.com/en/help/silverlight-api/samples/start.htm#UsingPointDataSource&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Note that the maptip displays an attribute coming from the view model.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;esri:GraphicsLayer.MapTip&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Border Padding="4,2" Background="#99333333" CornerRadius="8" 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DataContext="{Binding [DataContext]}"&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;TextBlock Text="{Binding Name}" Foreground="White" /&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Border&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/esri:GraphicsLayer.MapTip&amp;gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;The view model is stored in the attribute "DataContext" and from it you can access the 'Name' property.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For a symbol the datacontext is one level up (you need to give the Attributes dictionary in the path), so a symbol displaying the Name property would contain:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;lt;TextBlock Text="{Binding Attributes[DataContext].Name}" Foreground="White" /&amp;gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 05:46:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/esri-map-and-databinding-mvvm/m-p/708879#M18205</guid>
      <dc:creator>DominiqueBroux</dc:creator>
      <dc:date>2021-12-12T05:46:36Z</dc:date>
    </item>
  </channel>
</rss>

