<?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: Mouse events triggering in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/mouse-events-triggering/m-p/1167237#M10917</link>
    <description>&lt;P&gt;I think you can use GeoView.ViewpointChanged event for this purpose. You can try the following code.&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;MySceneView.ViewpointChanged += (a, b) =&amp;gt;
  {
      System.Diagnostics.Debug.WriteLine(MySceneView.GetCurrentViewpoint(ViewpointType.CenterAndScale)?.TargetScale);
  };
MySceneView.Scene = new Scene(new Basemap(new OpenStreetMapLayer()));&lt;/LI-CODE&gt;</description>
    <pubDate>Fri, 22 Apr 2022 21:03:50 GMT</pubDate>
    <dc:creator>JenniferNeryEsri</dc:creator>
    <dc:date>2022-04-22T21:03:50Z</dc:date>
    <item>
      <title>Mouse events triggering</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/mouse-events-triggering/m-p/1161359#M10883</link>
      <description>&lt;P&gt;I want to show current scene scale while scrolling the scene by mouse.&lt;/P&gt;&lt;P&gt;My mouse event handlers in MainWindow.xaml.cs:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;private void MySceneView_MouseScroll(object sender, MouseWheelEventArgs e)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;{&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; Viewpoint current = MySceneView.GetCurrentViewpoint(ViewpointType.CenterAndScale);&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; ((SceneViewModel)DataContext).Scale = System.Math.Round(current.TargetScale, 2);//I try to write the current scale on the interface TextBlock&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;}&lt;/EM&gt;&lt;BR /&gt;But it seems that event doesnt work while scrolling scene by mouse(map scaling) so i dont get the current Scene scale value.&lt;/P&gt;&lt;P&gt;I also tried another event MouseWheel and it doesn't triggers also when i try to scroll the scene:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;private void MySceneView_MouseWheel(object sender, MouseWheelEventArgs e)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;{&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&amp;nbsp; Viewpoint current = MySceneView.GetCurrentViewpoint(ViewpointType.CenterAndScale);&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&amp;nbsp; ((SceneViewModel)DataContext).Scale = System.Math.Round(current.TargetScale, 2);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;}&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;My SceneView definition in the MainWindow.xaml:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;lt;esri:SceneView Grid.Column ="0" x:Name ="MySceneView" Scene="{Binding Scene}" MouseWheel="MySceneView_MouseWheel" MouseMove="MySceneView_MouseMove" Margin="0,0,0,-0.4" HorizontalAlignment="Left" Width="774"/&amp;gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;How can i solve it?&lt;/P&gt;</description>
      <pubDate>Tue, 05 Apr 2022 20:24:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/mouse-events-triggering/m-p/1161359#M10883</guid>
      <dc:creator>VanyaIvanov</dc:creator>
      <dc:date>2022-04-05T20:24:42Z</dc:date>
    </item>
    <item>
      <title>Re: Mouse events triggering</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/mouse-events-triggering/m-p/1167237#M10917</link>
      <description>&lt;P&gt;I think you can use GeoView.ViewpointChanged event for this purpose. You can try the following code.&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;MySceneView.ViewpointChanged += (a, b) =&amp;gt;
  {
      System.Diagnostics.Debug.WriteLine(MySceneView.GetCurrentViewpoint(ViewpointType.CenterAndScale)?.TargetScale);
  };
MySceneView.Scene = new Scene(new Basemap(new OpenStreetMapLayer()));&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 22 Apr 2022 21:03:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/mouse-events-triggering/m-p/1167237#M10917</guid>
      <dc:creator>JenniferNeryEsri</dc:creator>
      <dc:date>2022-04-22T21:03:50Z</dc:date>
    </item>
  </channel>
</rss>

