<?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: How to Update MapView with Graphics via ViewModel? in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/how-to-update-mapview-with-graphics-via-viewmodel/m-p/654453#M8192</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use&amp;nbsp;GraphicsOverlayCollection instead of&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;ObservableCollection&amp;lt;GraphicsOverlay&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 01 Nov 2018 19:56:54 GMT</pubDate>
    <dc:creator>JoeHershman</dc:creator>
    <dc:date>2018-11-01T19:56:54Z</dc:date>
    <item>
      <title>How to Update MapView with Graphics via ViewModel?</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/how-to-update-mapview-with-graphics-via-viewmodel/m-p/654452#M8191</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am developing an application with ArcGIS Runtime SDK for .Net and following the MVVM Pattern, in my ViewModel I have an ObservableCollection of GraphicsOverlay that I have binded to the MapView in my View, now when I add a new GraphicsOverlay to the ObservableCollection and add Graphics in it, graphics are not reflection in the View,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have implemented INotifyPropertyChanged and all other things are working fine with the ViewModel&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;public class MapViewModel : BaseViewModel&lt;BR /&gt; {&lt;BR /&gt; private Map map;&lt;/P&gt;&lt;P&gt;public Map Map&lt;BR /&gt; {&lt;BR /&gt; get { return this.map; }&lt;BR /&gt; set { this.map = value; }&lt;BR /&gt; }&lt;BR /&gt; public ObservableCollection&amp;lt;GraphicsOverlay&amp;gt; GraphicsOverlays { get; set; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;public MapViewModel()&lt;BR /&gt; {&lt;BR /&gt; GraphicsOverlays = new ObservableCollection&amp;lt;GraphicsOverlay&amp;gt;();&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And in my Method that is called by any event&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;public void UpdateMarker(MapPoint point)&lt;BR /&gt; {&lt;BR /&gt; GraphicsOverlays[0].Graphics.Clear();&lt;/P&gt;&lt;P&gt;// Create a symbol to symbolize the point&lt;BR /&gt; SimpleMarkerSymbol symbol = new SimpleMarkerSymbol(SimpleMarkerSymbolStyle.X, System.Drawing.Color.Yellow, 20);&lt;/P&gt;&lt;P&gt;// Create the graphic&lt;BR /&gt; Graphic symbolGraphic = new Graphic(point, symbol);&lt;/P&gt;&lt;P&gt;// Add the graphic to the graphics overlay&lt;BR /&gt; var newGraphicsOverlay=new GraphicsOverlay(); &lt;BR /&gt; GraphicsOverlays[0].Graphics.Add(symbolGraphic);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And in my View I have&lt;/P&gt;&lt;P&gt;&amp;lt;esri:MapView x:Name="MyMapView" Grid.Column="0" DataContext="{StaticResource MapVM}" GraphicsOverlays="{Binding GraphicsOverlays}" Map="{Binding Map}" Cursor="{Binding MapViewCursor}"&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am unable to find any sample that does exactly this, so how to do this, I am new to arcGIS, Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Oct 2018 11:13:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/how-to-update-mapview-with-graphics-via-viewmodel/m-p/654452#M8191</guid>
      <dc:creator>KhurramAli</dc:creator>
      <dc:date>2018-10-31T11:13:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to Update MapView with Graphics via ViewModel?</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/how-to-update-mapview-with-graphics-via-viewmodel/m-p/654453#M8192</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use&amp;nbsp;GraphicsOverlayCollection instead of&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;ObservableCollection&amp;lt;GraphicsOverlay&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Nov 2018 19:56:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/how-to-update-mapview-with-graphics-via-viewmodel/m-p/654453#M8192</guid>
      <dc:creator>JoeHershman</dc:creator>
      <dc:date>2018-11-01T19:56:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to Update MapView with Graphics via ViewModel?</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/how-to-update-mapview-with-graphics-via-viewmodel/m-p/654454#M8193</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To give a little more context an ObservableCollection responds to items being added or deleted to the collection.&amp;nbsp; So when bound to a list type control it will reflect those changes to the list.&amp;nbsp; With an ObservableCollection changes to the objects within the collection do not send notification (raise IPropertyChanged).&amp;nbsp; In normal C# if you wanted to have a bound list and also be able to see changes to the objects in that list you would use a BindingList.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With adding Graphics the Graphics property on the GraphicsOverlay changes, so there is no type of notification sent by the ObservableCollection.&amp;nbsp; The&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;GraphicsOverlayCollection&lt;SPAN&gt;&amp;nbsp;was provided to fire the proper notifications&amp;nbsp;to see changes to the graphics (I'm assuming).&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;SPAN&gt;Cheers&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Nov 2018 13:53:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/how-to-update-mapview-with-graphics-via-viewmodel/m-p/654454#M8193</guid>
      <dc:creator>JoeHershman</dc:creator>
      <dc:date>2018-11-02T13:53:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to Update MapView with Graphics via ViewModel?</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/how-to-update-mapview-with-graphics-via-viewmodel/m-p/654455#M8194</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/6566"&gt;Joe Hershman&lt;/A&gt;&amp;nbsp;thanks for the insight.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Nov 2018 14:05:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/how-to-update-mapview-with-graphics-via-viewmodel/m-p/654455#M8194</guid>
      <dc:creator>KhurramAli</dc:creator>
      <dc:date>2018-11-02T14:05:45Z</dc:date>
    </item>
  </channel>
</rss>

