<?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: WPF and MVVM: GeoViewTapped Event in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/wpf-and-mvvm-geoviewtapped-event/m-p/186360#M2161</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am able to bind tapped event with &lt;SPAN style="background-color: #ffffff;"&gt;MVVM Light.&amp;nbsp;&lt;/SPAN&gt;See below code, might be helpful.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;MapVM:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;public ICommand gvtapped { get; set; }&lt;BR /&gt; public MapControlViewModel(): ViewModelBase&lt;BR /&gt; {&lt;BR /&gt; gvtapped = new RelayCommand&amp;lt;Esri.ArcGISRuntime.UI.Controls.GeoViewInputEventArgs&amp;gt;(Ongvtapped);&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;private void Ongvtapped(GeoViewInputEventArgs obj)&lt;BR /&gt; {&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Map.xaml:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"&lt;BR /&gt; xmlns:cmd="http://www.galasoft.ch/mvvmlight"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;esri:MapView &amp;gt; &lt;BR /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;lt;i:Interaction.Triggers&amp;gt;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;i:EventTrigger EventName="GeoViewTapped"&amp;gt;&lt;BR /&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;lt;cmd:EventToCommand Command="{Binding gvtapped}" PassEventArgsToCommand="True" /&amp;gt;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/i:EventTrigger&amp;gt;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/i:Interaction.Triggers&amp;gt;&lt;BR /&gt; &amp;lt;/esri:MapView&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Prashant&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 02 Sep 2019 03:19:52 GMT</pubDate>
    <dc:creator>PrashantKirpan</dc:creator>
    <dc:date>2019-09-02T03:19:52Z</dc:date>
    <item>
      <title>WPF and MVVM: GeoViewTapped Event</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/wpf-and-mvvm-geoviewtapped-event/m-p/186355#M2156</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to create binding for the GeoViewTappedAsync event so that I can place the code in my MapViewModel to follow an MVVM pattern for my WPF application, however I'm not sure how to wire this up.&amp;nbsp;Is there some sample code available that demonstrates this pattern? After looking through GeoNet, I have found some suggestions but they are a few years old.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;esri:MapView x:Name="MainMap" Map="{Binding Map}"&amp;nbsp; GeoViewTapped="Binding &lt;STRONG&gt;{to what does this bind?}&lt;/STRONG&gt;"&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;Jen&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Mar 2019 16:30:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/wpf-and-mvvm-geoviewtapped-event/m-p/186355#M2156</guid>
      <dc:creator>MonikaLucas</dc:creator>
      <dc:date>2019-03-04T16:30:05Z</dc:date>
    </item>
    <item>
      <title>Re: WPF and MVVM: GeoViewTapped Event</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/wpf-and-mvvm-geoviewtapped-event/m-p/186356#M2157</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You don't bind directly from view events to VM code in WPF. The way you would handle this is very similar to how you for instance would handle a click event from a button.&lt;/P&gt;&lt;P&gt;It's all a little different based on which MVVM framework you use, but typically it's called "EventToCommand" or similar approach, and there's quite a lot of examples online if you search for that.&lt;/P&gt;&lt;P&gt;Also whichever suggestions you found should still be relevant (albeit code might have to be tweaked), since reacting to view events in MVVM hasn't really changed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another MUCH simpler way, is to simply create a GeoViewTapped event handler in code-behind, and all that handler is doing is forwarding the event directly to the viewmodel (and possible filtering anything view-specific away). This is &lt;EM&gt;_still_&lt;/EM&gt; pure MVVM, as your code-behind is only&amp;nbsp;view-specific code, and thus still gets the separation MVVM likes to promote. And really it's not much different than a pure-xaml version of it is, as the XAML&amp;nbsp;is really just generating code in the same view class. I personally prefer this more pragmatic approach as it's much simpler to follow the flow from view events to the view model. TBH I find the EventToCommand approach a little less MVVM as it forwards view-specific event arguments directly to your viewmodel. But it's all religion at this point which approach you choose to take.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Mar 2019 17:33:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/wpf-and-mvvm-geoviewtapped-event/m-p/186356#M2157</guid>
      <dc:creator>dotMorten_esri</dc:creator>
      <dc:date>2019-03-04T17:33:32Z</dc:date>
    </item>
    <item>
      <title>Re: WPF and MVVM: GeoViewTapped Event</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/wpf-and-mvvm-geoviewtapped-event/m-p/186357#M2158</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Like &lt;A href="https://community.esri.com/migrated-users/3050" target="_blank"&gt;Morten Nielsen&lt;/A&gt;‌ says, just wire up the events to an&amp;nbsp;EventAggregator in the code behind of the view that contains MapView.&amp;nbsp; This does assume you are using a framework that provides event aggregation.&amp;nbsp; I use Prism, but MVVM Light would work as well&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;private&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;WireUpMapViewEventHandlers&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;IEventAggregator eventAggregator&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
	MapView&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;GeoViewTapped &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;s&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; e&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt; eventAggregator&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;GetEvent&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;GeoViewTappedEvent&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Publish&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;e&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
	MapView&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;GeoViewDoubleTapped &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;s&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; e&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt; eventAggregator&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;GetEvent&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;GeoViewDoubleTappedEvent&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Publish&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;e&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
	MapView&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;GeoViewHolding &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;s&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; e&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt; eventAggregator&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;GetEvent&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;GeoViewHoldingEvent&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Publish&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;e&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
	MapView&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ViewpointChanged &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;s&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; e&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt; eventAggregator&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;GetEvent&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;ViewpointChangedEvent&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Publish&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;MapView&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;VisibleArea&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Extent&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
	MapView&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;NavigationCompleted &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;s&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; e&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt; eventAggregator&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;GetEvent&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;NavigationCompletedEvent&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Publish&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;MapView&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;VisibleArea&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Extent&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now just need to add an event handler anywhere in the application you want to respond to the event.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem (to me) with using an EventToCommand type approach is that this only allows response to these events in the MapViewModel.&amp;nbsp; This is fine in a simple application but if you want the application to grow beyond the single ViewModel it really won't support it (imo).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As pointed out by Morten, the code in the code behind is only associated to the MapView.&amp;nbsp; So, I would not consider it breaking any MVVM principle.&amp;nbsp; No other part of the application&amp;nbsp; knows anything about the MapView other than that it fires these events&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:26:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/wpf-and-mvvm-geoviewtapped-event/m-p/186357#M2158</guid>
      <dc:creator>JoeHershman</dc:creator>
      <dc:date>2021-12-11T09:26:35Z</dc:date>
    </item>
    <item>
      <title>Re: WPF and MVVM: GeoViewTapped Event</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/wpf-and-mvvm-geoviewtapped-event/m-p/186358#M2159</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Morton,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your feedback on this.&amp;nbsp;Currently, I'm looking into the MVVM Light framework to use with my application. It seems Pluralsight has a good intro provided by Laurent Bugnion. I managed to bind the button click without the use of any framework but I think using an existing one will be important as I move forward with this application.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do like your suggestion of&amp;nbsp;putting view specific code in the code-behind, and then forwarding the event on to the viewmodel for simplification purposes. Although I want to adhere to the MVVM pattern, I&amp;nbsp;am not opposed to this approach if it makes things easier to follow.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Mar 2019 20:08:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/wpf-and-mvvm-geoviewtapped-event/m-p/186358#M2159</guid>
      <dc:creator>MonikaLucas</dc:creator>
      <dc:date>2019-03-05T20:08:02Z</dc:date>
    </item>
    <item>
      <title>Re: WPF and MVVM: GeoViewTapped Event</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/wpf-and-mvvm-geoviewtapped-event/m-p/186359#M2160</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Joe,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your insight and code snippet! I am looking at MVVM Light as it seems like&amp;nbsp;it may be simpler to me to follow as someone new to these frameworks. I've started an intro course on Pluralsight so I'll see how it goes. Thanks again for your help.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Mar 2019 20:11:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/wpf-and-mvvm-geoviewtapped-event/m-p/186359#M2160</guid>
      <dc:creator>MonikaLucas</dc:creator>
      <dc:date>2019-03-05T20:11:49Z</dc:date>
    </item>
    <item>
      <title>Re: WPF and MVVM: GeoViewTapped Event</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/wpf-and-mvvm-geoviewtapped-event/m-p/186360#M2161</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am able to bind tapped event with &lt;SPAN style="background-color: #ffffff;"&gt;MVVM Light.&amp;nbsp;&lt;/SPAN&gt;See below code, might be helpful.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;MapVM:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;public ICommand gvtapped { get; set; }&lt;BR /&gt; public MapControlViewModel(): ViewModelBase&lt;BR /&gt; {&lt;BR /&gt; gvtapped = new RelayCommand&amp;lt;Esri.ArcGISRuntime.UI.Controls.GeoViewInputEventArgs&amp;gt;(Ongvtapped);&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;private void Ongvtapped(GeoViewInputEventArgs obj)&lt;BR /&gt; {&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Map.xaml:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"&lt;BR /&gt; xmlns:cmd="http://www.galasoft.ch/mvvmlight"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;esri:MapView &amp;gt; &lt;BR /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;lt;i:Interaction.Triggers&amp;gt;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;i:EventTrigger EventName="GeoViewTapped"&amp;gt;&lt;BR /&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;lt;cmd:EventToCommand Command="{Binding gvtapped}" PassEventArgsToCommand="True" /&amp;gt;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/i:EventTrigger&amp;gt;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/i:Interaction.Triggers&amp;gt;&lt;BR /&gt; &amp;lt;/esri:MapView&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Prashant&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Sep 2019 03:19:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/wpf-and-mvvm-geoviewtapped-event/m-p/186360#M2161</guid>
      <dc:creator>PrashantKirpan</dc:creator>
      <dc:date>2019-09-02T03:19:52Z</dc:date>
    </item>
    <item>
      <title>Re: WPF and MVVM: GeoViewTapped Event</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/wpf-and-mvvm-geoviewtapped-event/m-p/186361#M2162</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is nothing wrong with this approach, but as I mentioned in my previous post it does not scale to a large application that may need access to a MapView event from an object that is not bound directly MapViews view.&amp;nbsp; Using an event approach one can respond to a MapView event from anywhere, even a separate .dll.&amp;nbsp; Again not a bad approach, but does not scale to a really large application.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Sep 2019 13:41:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/wpf-and-mvvm-geoviewtapped-event/m-p/186361#M2162</guid>
      <dc:creator>JoeHershman</dc:creator>
      <dc:date>2019-09-03T13:41:57Z</dc:date>
    </item>
    <item>
      <title>Re: WPF and MVVM: GeoViewTapped Event</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/wpf-and-mvvm-geoviewtapped-event/m-p/186362#M2163</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've been doing research on this learning with WPF and it seems so odd that functionality like Identifying/Querying Map Layers is only available on the MapView and that it is really difficult to call methods on it using MVVM.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I understand more or less how to relay the events from the View to the View Model (using mvvm light), but what about simply calling a method on the MapView?&amp;nbsp; Does that still require creating Controllers?&amp;nbsp; I've been working with the samples available online for Navigating from the View Model, and Identification Controllers, and am so worried because I just don't understand how to make them work for me.&amp;nbsp; I think the Navigating from the View Model sample provides the technique for calling methods on the View, but I am having issues with implementing it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I am doing is attempting to Identify the layers at a point.&amp;nbsp; I have the point from the Location MapPoint because I can pass that property with the Command as a CommandParameter to my ViewModel, but to perform the query on the layers I need to call a method on the MapView.&amp;nbsp; That is where I need help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Am I just way off the path here?&amp;nbsp; My background is in Python and javascript/typescript so I am learning the .net sdk and WPF with a plan to transition to UWP after I get a better grasp of how to structure these runtime apps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rich&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Sep 2019 03:00:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/wpf-and-mvvm-geoviewtapped-event/m-p/186362#M2163</guid>
      <dc:creator>RichardHughes2</dc:creator>
      <dc:date>2019-09-13T03:00:02Z</dc:date>
    </item>
    <item>
      <title>Re: WPF and MVVM: GeoViewTapped Event</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/wpf-and-mvvm-geoviewtapped-event/m-p/186363#M2164</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this, I haven't tested but this should work&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;esri:MapView x:Name="&lt;STRONG&gt;&lt;EM&gt;MyMapView&lt;/EM&gt;&lt;/STRONG&gt;" /&amp;gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;In Code behind of map control access map view and assign to viewmodel prperty&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;public MainWindow()&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; InitializeComponent();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ((MapViewModel)this.DataContext).MyMapView = this.&lt;EM&gt;&lt;STRONG&gt;MyMapView&lt;/STRONG&gt;&lt;/EM&gt;;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; padding: 0px; margin: 0px;"&gt;&lt;STRONG&gt;&lt;SPAN style="text-align: left; color: #3d3d3d; text-transform: none; text-indent: 0px; letter-spacing: normal; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; text-decoration: none; word-spacing: 0px; display: inline; white-space: normal; orphans: 2; float: none; -webkit-text-stroke-width: 0px; overflow-wrap: break-word; background-color: #f6f6f6;"&gt;MapViewModel&lt;/SPAN&gt;:&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; padding: 0px; margin: 0px;"&gt;&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; padding: 0px; margin: 0px;"&gt;&amp;nbsp;public MapView MyMapView { get; set; }&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P style="color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; padding: 0px; margin: 0px;"&gt;&amp;nbsp;public MapView MyMapView { get; set; }&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All members of&amp;nbsp;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;MapView&amp;nbsp;&lt;/SPAN&gt; will be available in view model&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Prashant&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Sep 2019 04:02:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/wpf-and-mvvm-geoviewtapped-event/m-p/186363#M2164</guid>
      <dc:creator>PrashantKirpan</dc:creator>
      <dc:date>2019-09-13T04:02:23Z</dc:date>
    </item>
    <item>
      <title>Re: WPF and MVVM: GeoViewTapped Event</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/wpf-and-mvvm-geoviewtapped-event/m-p/186364#M2165</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Update from me on using a Controller for the MapView.&amp;nbsp; &amp;nbsp;I like how I can now both listen to events and call methods on the view model.&amp;nbsp; Thanks to the samples from esri folks I was able to get this together for another productive day tomorrow.&amp;nbsp; I'll be studying this code more... Thanks for you help.&amp;nbsp; What I did was combine a 10.2.x sample on navigating with the view model&amp;nbsp;&lt;A class="link-titled" href="https://developers.arcgis.com/net/10-2/sample-code/NavigateFromViewModel/" title="https://developers.arcgis.com/net/10-2/sample-code/NavigateFromViewModel/"&gt;Navigate from ViewModel | ArcGIS for Developers&lt;/A&gt;, and a more recent sample of listening to the GeoView Tap Events via a Controller&lt;A href="https://community.esri.com/thread/212322"&gt;Accessing MapView methods like IdentifyGraphicsOverlaysAsync from viewmodel.&lt;/A&gt;&amp;nbsp; I don't see a button for code formatting otherwise I would post what I have.&amp;nbsp; It is basically relies on the classes and stuff in C# that I don't know yet, so I will be busy with that.&amp;nbsp; Meanwhile getting over this hurdle will make everything soo much brighter!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Sep 2019 06:20:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/wpf-and-mvvm-geoviewtapped-event/m-p/186364#M2165</guid>
      <dc:creator>RichardHughes2</dc:creator>
      <dc:date>2019-09-13T06:20:22Z</dc:date>
    </item>
    <item>
      <title>Re: WPF and MVVM: GeoViewTapped Event</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/wpf-and-mvvm-geoviewtapped-event/m-p/186365#M2166</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I won't get into a philosophical discussion, but I don't consider the Controller approach as MVVM, it is simply a clean way to expose MapView outside the view that contains it.&amp;nbsp; There is an old discussion about this&amp;nbsp;&lt;A href="https://community.esri.com/thread/212322"&gt;Accessing MapView methods like IdentifyGraphicsOverlaysAsync from viewmodel.&lt;/A&gt;&amp;nbsp; In there is a way that I have used a TriggerAction to attach Identify behavior to the MapView.&amp;nbsp; It then uses eventing to send results to the rest of the application.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have written a very large scale enterprise application consisting of over a dozen separate modules and been almost completely able to avoid having to share the MapView.&amp;nbsp; The one issue is with a module that uses the TOC toolbox control which requires the MapView and in there the controller approach was used to pass the MapView.&amp;nbsp; Everything else can be done using event publish/subscribe from the code behind of the view containing the MapView.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I agree with your&amp;nbsp;initial statement, to me the MapView provides too much functionality and really hampers building a nice MVVM structure.&amp;nbsp; It (literally) took me years to work through all the various places I required MapView methods and organize them in what I consider a clean MVVM manner where&amp;nbsp;the remainder of the application has no knowledge of the MapView (excluding the TOC issue)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Sep 2019 12:51:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/wpf-and-mvvm-geoviewtapped-event/m-p/186365#M2166</guid>
      <dc:creator>JoeHershman</dc:creator>
      <dc:date>2019-09-13T12:51:04Z</dc:date>
    </item>
    <item>
      <title>Re: WPF and MVVM: GeoViewTapped Event</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/wpf-and-mvvm-geoviewtapped-event/m-p/186366#M2167</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt;&amp;nbsp;it seems so odd that functionality like Identifying/Querying Map Layers is only available on the MapView&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is fair criticism, but something to keep in mind is that&amp;nbsp;Identify is a very UI-centric thing. It (typically) deals with the user actually clicking on the view, it's inputs are actual screen coordinates (not map unit coordinates), and the hit test is done based on the rendering of the features (so a&amp;nbsp;large point symbol will still get found even if you don't click exactly at the center of the point).&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;You could instead&amp;nbsp;do a spatial query of features based on map geometry directly against the layers without the view, but that's not really "identify" in the usual respect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There really is only two operations directly on the view: The various Identify and SetViewpoint* operations, which all are very specific to working with the view. Pretty much everything else is tucked into objects you can put in your view model, like the Map, GraphicsOverlay, the location datasource, editor etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A good equivalent is the ScrollViewer/ListViews: They have view-specific operations for scrolling to a certain item/offset, and very much akin to the SetViewpoint method, and clicking an item is very much identical to&amp;nbsp;the identify operation. None of these you can't really do without some view specific stuff.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also one thing to consider: IMHO the purist MVVM approach where absolutely no code-behind can ever exist isn't really true to what MVVM is saying. You can have code-behind, &lt;EM&gt;as long as that code-behind is view-specific&lt;/EM&gt;. For example a click handler that performs the identify, and then forwards the result to the view model is still completely ok and within MVVM. Sure you can do all sorts of tricks and jumps to mask that code into various attached properties etc, but you're just adding an enormous amount of complexity only to pretend you moved your view code out of your code behind, when really all you did is move your view code into some other view code, and in the process made your code much harder to follow and understand. It might make sense to do these tricks if you have&amp;nbsp;any different views and want to reuse that same logic over and over again, but always I'd say to weigh the added complexity with the cost.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Sep 2019 17:26:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/wpf-and-mvvm-geoviewtapped-event/m-p/186366#M2167</guid>
      <dc:creator>dotMorten_esri</dc:creator>
      <dc:date>2019-09-13T17:26:00Z</dc:date>
    </item>
    <item>
      <title>Re: WPF and MVVM: GeoViewTapped Event</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/wpf-and-mvvm-geoviewtapped-event/m-p/186367#M2168</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Today I did successfully Query the map's Operational Layers using the location passed from the MapView to the View through a binding.&amp;nbsp; That is all I really needed to do since the Map and all its Operational Layers are available in the View Model.&amp;nbsp; But as I figuring out how to work with the MapView programatically my brain short-circuited.&amp;nbsp; The screen vs map points is a great point to make regarding the differences between the Map and the MapView and all the screen sizing that takes place on the client.&amp;nbsp; I do really like this new design with the MapView and appreciate all that is going into it.&amp;nbsp; I do use code behind to enable the location service on the MapView.&amp;nbsp; Eventually that will have to get put somewhere else if I integrate with an external GPS receiver, or maybe not?&amp;nbsp; That will be interesting.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Sep 2019 17:50:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/wpf-and-mvvm-geoviewtapped-event/m-p/186367#M2168</guid>
      <dc:creator>RichardHughes2</dc:creator>
      <dc:date>2019-09-13T17:50:06Z</dc:date>
    </item>
    <item>
      <title>Re: WPF and MVVM: GeoViewTapped Event</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/wpf-and-mvvm-geoviewtapped-event/m-p/186368#M2169</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Also one thing to consider: IMHO the purist MVVM approach where absolutely no code-behind can ever exist isn't really true to what MVVM is saying. You can have code-behind,&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;EM style="background-color: #ffffff; border: 0px;"&gt;as long as that code-behind is view-specific&lt;/EM&gt;&lt;SPAN style="background-color: #ffffff;"&gt;.&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;YES!.&amp;nbsp; And in a large application I think this is absolutely required (certainly with Runtime it is).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is how we do something like changing viewpoint.&amp;nbsp; This code is in the MapViews Code behind.&amp;nbsp; Zoom is done from anywhere in the application by firing a SetViewpointEvent&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;private&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;async&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;OnSetViewpoint&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;SetViewpointEventArgs args&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
	&lt;SPAN class="comment token"&gt;//First see if a viewpoint was sent, otherwise use a geometry&lt;/SPAN&gt;
	&lt;SPAN class="keyword token"&gt;try&lt;/SPAN&gt;
	&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
		&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt; args&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Viewpoint &lt;SPAN class="operator token"&gt;!=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;null&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
		&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
			&lt;SPAN class="keyword token"&gt;await&lt;/SPAN&gt; MapView&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;SetViewpointAsync&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;args&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Viewpoint&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; TimeSpan&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;FromMilliseconds&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;750&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
			&lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
		&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;

		&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; geometry &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; args&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Geometry&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

		&lt;SPAN class="keyword token"&gt;switch&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;geometry&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
		&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
			&lt;SPAN class="keyword token"&gt;case&lt;/SPAN&gt; MapPoint mapPoint&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
				&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;MapView&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MapScale &lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt; args&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Scale&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
				&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
					&lt;SPAN class="keyword token"&gt;await&lt;/SPAN&gt; MapView&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;SetViewpointCenterAsync&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;mapPoint&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
				&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
				&lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt;
				&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
					&lt;SPAN class="keyword token"&gt;await&lt;/SPAN&gt; MapView&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;SetViewpointCenterAsync&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;mapPoint&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; args&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Scale&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
				&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;

				&lt;SPAN class="keyword token"&gt;break&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
			&lt;SPAN class="keyword token"&gt;case&lt;/SPAN&gt; Polyline polyline&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
			&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
				&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; envelope &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; polyline&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Extent&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
				&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; buffer &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; GeometryEngine&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Buffer&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;envelope&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1000&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
				&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; viewpoint &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;Viewpoint&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;buffer&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

				&lt;SPAN class="keyword token"&gt;await&lt;/SPAN&gt; MapView&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;SetViewpointAsync&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;viewpoint&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; TimeSpan&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;FromMilliseconds&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;750&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

				&lt;SPAN class="keyword token"&gt;break&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
			&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
			&lt;SPAN class="keyword token"&gt;case&lt;/SPAN&gt; Polygon polygon&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
				&lt;SPAN class="keyword token"&gt;await&lt;/SPAN&gt; MapView&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;SetViewpointGeometryAsync&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;polygon&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Extent&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; args&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Padding&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
				&lt;SPAN class="keyword token"&gt;break&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
			&lt;SPAN class="keyword token"&gt;case&lt;/SPAN&gt; Envelope envelope&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
				&lt;SPAN class="keyword token"&gt;await&lt;/SPAN&gt; MapView&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;SetViewpointGeometryAsync&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;envelope&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
				&lt;SPAN class="keyword token"&gt;break&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
		&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
	&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
	&lt;SPAN class="keyword token"&gt;catch&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token class-name"&gt;Exception&lt;/SPAN&gt; e&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
	&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
		_log&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Error&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;e&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Message&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; e&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
	&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We do similar stuff with displaying popups, saving screen images, and functions that are exposed by the MapView object&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:26:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/wpf-and-mvvm-geoviewtapped-event/m-p/186368#M2169</guid>
      <dc:creator>JoeHershman</dc:creator>
      <dc:date>2021-12-11T09:26:38Z</dc:date>
    </item>
  </channel>
</rss>

