<?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 Docs about the data passed to event listeners in the ArcGIS Pro SDK in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/docs-about-the-data-passed-to-event-listeners-in/m-p/1007557#M5832</link>
    <description>&lt;P&gt;I come from a background of web development and am having difficulty making sense of the ArcGIS Pro SDK API reference. I&lt;SPAN&gt;&amp;nbsp;see that there’s a class for a&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;LayersAdded&amp;nbsp;event (&lt;A href="https://pro.arcgis.com/en/pro-app/sdk/api-reference/#topic12661.html" target="_blank" rel="noopener"&gt;docs here&lt;/A&gt;)&amp;nbsp;&lt;SPAN&gt;but how do I see what data will be in the event? T&lt;/SPAN&gt;&lt;SPAN&gt;his exists in my code, and it works:&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV class="c-virtual_list__item"&gt;&lt;DIV class="c-message_kit__background p-message_pane_message__message c-message_kit__message"&gt;&lt;DIV class="c-message_kit__hover"&gt;&lt;DIV class="c-message_kit__actions c-message_kit__actions--above"&gt;&lt;DIV class="c-message_kit__gutter"&gt;&lt;DIV class="c-message_kit__gutter__right"&gt;&lt;DIV class="c-message_kit__blocks c-message_kit__blocks--rich_text"&gt;&lt;DIV class="c-message__message_blocks c-message__message_blocks--rich_text"&gt;&lt;DIV class="p-block_kit_renderer"&gt;&lt;DIV class="p-block_kit_renderer__block_wrapper p-block_kit_renderer__block_wrapper--first"&gt;&lt;DIV class="p-rich_text_block"&gt;&lt;PRE&gt;LayersAddedEvent.Subscribe((evt) =&amp;gt; ...do something with event);&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="c-virtual_list__item"&gt;&lt;DIV class="c-message_kit__background p-message_pane_message__message c-message_kit__message"&gt;&lt;DIV class="c-message_kit__hover"&gt;&lt;DIV class="c-message_kit__actions c-message_kit__actions--above"&gt;&lt;DIV class="c-message_kit__gutter"&gt;&lt;DIV class="c-message_kit__gutter__right"&gt;&lt;DIV class="c-message_kit__blocks c-message_kit__blocks--rich_text"&gt;&lt;DIV class="c-message__message_blocks c-message__message_blocks--rich_text"&gt;&lt;DIV class="p-block_kit_renderer"&gt;&lt;DIV class="p-block_kit_renderer__block_wrapper p-block_kit_renderer__block_wrapper--first"&gt;&lt;DIV class="p-rich_text_block"&gt;&lt;DIV class="p-rich_text_section"&gt;but in order to see what properties the event has, I have been triggering an event and logging it. This does not seem like the right way of doing things, but I am a lowly web developer who doesn’t really understand fully how C# or the Pro SDK API reference works. I'm trying to handle many different events. How can I tell what is getting returned?&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Mon, 07 Dec 2020 22:27:22 GMT</pubDate>
    <dc:creator>MikeDavlantes</dc:creator>
    <dc:date>2020-12-07T22:27:22Z</dc:date>
    <item>
      <title>Docs about the data passed to event listeners in the ArcGIS Pro SDK</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/docs-about-the-data-passed-to-event-listeners-in/m-p/1007557#M5832</link>
      <description>&lt;P&gt;I come from a background of web development and am having difficulty making sense of the ArcGIS Pro SDK API reference. I&lt;SPAN&gt;&amp;nbsp;see that there’s a class for a&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;LayersAdded&amp;nbsp;event (&lt;A href="https://pro.arcgis.com/en/pro-app/sdk/api-reference/#topic12661.html" target="_blank" rel="noopener"&gt;docs here&lt;/A&gt;)&amp;nbsp;&lt;SPAN&gt;but how do I see what data will be in the event? T&lt;/SPAN&gt;&lt;SPAN&gt;his exists in my code, and it works:&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV class="c-virtual_list__item"&gt;&lt;DIV class="c-message_kit__background p-message_pane_message__message c-message_kit__message"&gt;&lt;DIV class="c-message_kit__hover"&gt;&lt;DIV class="c-message_kit__actions c-message_kit__actions--above"&gt;&lt;DIV class="c-message_kit__gutter"&gt;&lt;DIV class="c-message_kit__gutter__right"&gt;&lt;DIV class="c-message_kit__blocks c-message_kit__blocks--rich_text"&gt;&lt;DIV class="c-message__message_blocks c-message__message_blocks--rich_text"&gt;&lt;DIV class="p-block_kit_renderer"&gt;&lt;DIV class="p-block_kit_renderer__block_wrapper p-block_kit_renderer__block_wrapper--first"&gt;&lt;DIV class="p-rich_text_block"&gt;&lt;PRE&gt;LayersAddedEvent.Subscribe((evt) =&amp;gt; ...do something with event);&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="c-virtual_list__item"&gt;&lt;DIV class="c-message_kit__background p-message_pane_message__message c-message_kit__message"&gt;&lt;DIV class="c-message_kit__hover"&gt;&lt;DIV class="c-message_kit__actions c-message_kit__actions--above"&gt;&lt;DIV class="c-message_kit__gutter"&gt;&lt;DIV class="c-message_kit__gutter__right"&gt;&lt;DIV class="c-message_kit__blocks c-message_kit__blocks--rich_text"&gt;&lt;DIV class="c-message__message_blocks c-message__message_blocks--rich_text"&gt;&lt;DIV class="p-block_kit_renderer"&gt;&lt;DIV class="p-block_kit_renderer__block_wrapper p-block_kit_renderer__block_wrapper--first"&gt;&lt;DIV class="p-rich_text_block"&gt;&lt;DIV class="p-rich_text_section"&gt;but in order to see what properties the event has, I have been triggering an event and logging it. This does not seem like the right way of doing things, but I am a lowly web developer who doesn’t really understand fully how C# or the Pro SDK API reference works. I'm trying to handle many different events. How can I tell what is getting returned?&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 07 Dec 2020 22:27:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/docs-about-the-data-passed-to-event-listeners-in/m-p/1007557#M5832</guid>
      <dc:creator>MikeDavlantes</dc:creator>
      <dc:date>2020-12-07T22:27:22Z</dc:date>
    </item>
    <item>
      <title>Re: Docs about the data passed to event listeners in the ArcGIS Pro SDK</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/docs-about-the-data-passed-to-event-listeners-in/m-p/1007771#M5836</link>
      <description>&lt;P&gt;Hi Mike,&lt;/P&gt;&lt;P&gt;&amp;nbsp;The ArcGIS Pro SDK wiki explains how to 'subscribe' to Pro Events using the Pro SDK in general:&amp;nbsp;&lt;A href="https://github.com/Esri/arcgis-pro-sdk/wiki/ProConcepts-Framework#events" target="_self"&gt;ProConcepts Framework Events&lt;/A&gt;&amp;nbsp;Specifically when you subscribe to an LayerAddedEvent you have to look at the parameter required for the Subscribe method (&lt;A href="https://pro.arcgis.com/en/pro-app/sdk/api-reference/#topic12667.html" target="_self"&gt;API Reference&lt;/A&gt;) :&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;public static SubscriptionToken Subscribe( 
   Action&amp;lt;LayerEventsArgs&amp;gt; action,
   bool keepSubscriberAlive
)&lt;/LI-CODE&gt;&lt;P&gt;The parameter&amp;nbsp;Action&amp;lt;LayerEventsArgs&amp;gt; indicates that you have to specify a 'delegate' (action method) here.&amp;nbsp; The delegate action method has one parameter&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/sdk/api-reference/#topic12655.html" target="_self"&gt;LayerEventsArgs&lt;/A&gt;&amp;nbsp;and looking at the members of LayerEventsArgs you will notice that it contains a Layers property which contains the layers (as an enumeration)&amp;nbsp; that are added.&amp;nbsp; To test this i created an add-in module with a single button.&amp;nbsp; The OnClick method for the button contains this test code:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;protected override void OnClick()
{
	LayersAddedEvent.Subscribe((evtArgs) =&amp;gt; 
	{
		System.Diagnostics.Debug.WriteLine("LayersAddedEvent");
		foreach (var lyr in evtArgs.Layers)
		{
			System.Diagnostics.Debug.WriteLine($@"Added this layer: {lyr.Name}");
		}
	});
}&lt;/LI-CODE&gt;&lt;P&gt;To test this i click my button and then add a new layer to my map view and I get the following output in my Visual Studio output window:&lt;/P&gt;&lt;P&gt;LayersAddedEvent&lt;BR /&gt;Added this layer: TestMultiPoints&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Dec 2020 17:35:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/docs-about-the-data-passed-to-event-listeners-in/m-p/1007771#M5836</guid>
      <dc:creator>Wolf</dc:creator>
      <dc:date>2020-12-08T17:35:49Z</dc:date>
    </item>
    <item>
      <title>Re: Docs about the data passed to event listeners in the ArcGIS Pro SDK</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/docs-about-the-data-passed-to-event-listeners-in/m-p/1007813#M5839</link>
      <description>&lt;P&gt;Thanks Wolf-- this was very helpful! Looking at it now I think most of my difficulty was just in navigating the docs. Getting from the `&lt;SPAN&gt;LayersAdded` page to `LayerEventsArgs` isn't particularly straightforward.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Dec 2020 19:10:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/docs-about-the-data-passed-to-event-listeners-in/m-p/1007813#M5839</guid>
      <dc:creator>MikeDavlantes</dc:creator>
      <dc:date>2020-12-08T19:10:12Z</dc:date>
    </item>
    <item>
      <title>Re: Docs about the data passed to event listeners in the ArcGIS Pro SDK</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/docs-about-the-data-passed-to-event-listeners-in/m-p/1007825#M5840</link>
      <description>&lt;P&gt;You are correct that "&lt;SPAN&gt;Getting from the `&lt;/SPAN&gt;&lt;SPAN&gt;LayersAdded` page to `LayerEventsArgs` isn't straightforward".&amp;nbsp; We had this issue in our cross hairs for a while, it's a limitation in the third party software we are using for the API reference website generation.&amp;nbsp; We are hoping to fix this 'linkage' problem in one of the upcoming releases.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Dec 2020 19:51:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/docs-about-the-data-passed-to-event-listeners-in/m-p/1007825#M5840</guid>
      <dc:creator>Wolf</dc:creator>
      <dc:date>2020-12-08T19:51:54Z</dc:date>
    </item>
  </channel>
</rss>

