<?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: Create a custom event in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/create-a-custom-event/m-p/854088#M4392</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I found it (thanks to the IlSpy disassembler!), see files below as an example of an event and eventarg class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Event-class&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;public class GetJsonSelectionFinishedEvent : CompositePresentationEvent&amp;lt;GetJsonSelectionFinishedEventArgs&amp;gt;&lt;BR /&gt; {&lt;BR /&gt;&amp;nbsp; &amp;nbsp;public static SubscriptionToken Subscribe(Action&amp;lt;GetJsonSelectionFinishedEventArgs&amp;gt; action, bool &amp;nbsp; &amp;nbsp;keepSubscriberAlive = false)&lt;BR /&gt;&amp;nbsp; &amp;nbsp;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; return FrameworkApplication.EventAggregator.GetEvent&amp;lt;GetJsonSelectionFinishedEvent&amp;gt;().Register(action, &amp;nbsp; &amp;nbsp; &amp;nbsp; keepSubscriberAlive);&lt;BR /&gt;&amp;nbsp; &amp;nbsp;}&lt;BR /&gt;&amp;nbsp; &amp;nbsp;public static void Unsubscribe(Action&amp;lt;GetJsonSelectionFinishedEventArgs&amp;gt; action)&lt;BR /&gt;&amp;nbsp; &amp;nbsp;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; FrameworkApplication.EventAggregator.GetEvent&amp;lt;GetJsonSelectionFinishedEvent&amp;gt;().Unregister(action);&lt;BR /&gt;&amp;nbsp; &amp;nbsp;}&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;public static void Unsubscribe(SubscriptionToken token)&lt;BR /&gt;&amp;nbsp; &amp;nbsp;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; FrameworkApplication.EventAggregator.GetEvent&amp;lt;GetJsonSelectionFinishedEvent&amp;gt;().Unregister(token);&lt;BR /&gt;&amp;nbsp; &amp;nbsp;}&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;internal static void Publish(GetJsonSelectionFinishedEventArgs activeMapViewEventArgs)&lt;BR /&gt;&amp;nbsp; &amp;nbsp;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; FrameworkApplication.EventAggregator.GetEvent&amp;lt;GetJsonSelectionFinishedEvent&amp;gt;().Broadcast(activeMapViewEventArgs);&lt;BR /&gt;&amp;nbsp; &amp;nbsp;}&lt;BR /&gt; }&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;EventArg-class&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;public class GetJsonSelectionFinishedEventArgs : System.EventArgs&lt;BR /&gt; {&lt;BR /&gt;&amp;nbsp; &amp;nbsp;public BasicFeatureLayer BasicFL&lt;BR /&gt;&amp;nbsp; &amp;nbsp;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; get;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; private set;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;}&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;public GetJsonSelectionFinishedEventArgs(BasicFeatureLayer bfl)&lt;BR /&gt;&amp;nbsp; &amp;nbsp;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; this.BasicFL = bfl;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;}&lt;BR /&gt; }&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And then you can use it just like the other available events.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Collin.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 21 Mar 2017 10:05:39 GMT</pubDate>
    <dc:creator>CollinKleiboer</dc:creator>
    <dc:date>2017-03-21T10:05:39Z</dc:date>
    <item>
      <title>Create a custom event</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/create-a-custom-event/m-p/854087#M4391</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to create a custom event. What's the best way to do that?&lt;/P&gt;&lt;P&gt;Using the Pro SDK classes (like CompositePresentationEvent) or create a 'regular' .NET event?&lt;/P&gt;&lt;P&gt;If it's the best way to use the Pro SDK classes, could you provide me an example?&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;Kind regards,&lt;/P&gt;&lt;P&gt;Collin Kleiboer&lt;/P&gt;&lt;P&gt;GisSense BV&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Mar 2017 09:00:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/create-a-custom-event/m-p/854087#M4391</guid>
      <dc:creator>CollinKleiboer</dc:creator>
      <dc:date>2017-03-21T09:00:56Z</dc:date>
    </item>
    <item>
      <title>Re: Create a custom event</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/create-a-custom-event/m-p/854088#M4392</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I found it (thanks to the IlSpy disassembler!), see files below as an example of an event and eventarg class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Event-class&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;public class GetJsonSelectionFinishedEvent : CompositePresentationEvent&amp;lt;GetJsonSelectionFinishedEventArgs&amp;gt;&lt;BR /&gt; {&lt;BR /&gt;&amp;nbsp; &amp;nbsp;public static SubscriptionToken Subscribe(Action&amp;lt;GetJsonSelectionFinishedEventArgs&amp;gt; action, bool &amp;nbsp; &amp;nbsp;keepSubscriberAlive = false)&lt;BR /&gt;&amp;nbsp; &amp;nbsp;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; return FrameworkApplication.EventAggregator.GetEvent&amp;lt;GetJsonSelectionFinishedEvent&amp;gt;().Register(action, &amp;nbsp; &amp;nbsp; &amp;nbsp; keepSubscriberAlive);&lt;BR /&gt;&amp;nbsp; &amp;nbsp;}&lt;BR /&gt;&amp;nbsp; &amp;nbsp;public static void Unsubscribe(Action&amp;lt;GetJsonSelectionFinishedEventArgs&amp;gt; action)&lt;BR /&gt;&amp;nbsp; &amp;nbsp;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; FrameworkApplication.EventAggregator.GetEvent&amp;lt;GetJsonSelectionFinishedEvent&amp;gt;().Unregister(action);&lt;BR /&gt;&amp;nbsp; &amp;nbsp;}&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;public static void Unsubscribe(SubscriptionToken token)&lt;BR /&gt;&amp;nbsp; &amp;nbsp;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; FrameworkApplication.EventAggregator.GetEvent&amp;lt;GetJsonSelectionFinishedEvent&amp;gt;().Unregister(token);&lt;BR /&gt;&amp;nbsp; &amp;nbsp;}&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;internal static void Publish(GetJsonSelectionFinishedEventArgs activeMapViewEventArgs)&lt;BR /&gt;&amp;nbsp; &amp;nbsp;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; FrameworkApplication.EventAggregator.GetEvent&amp;lt;GetJsonSelectionFinishedEvent&amp;gt;().Broadcast(activeMapViewEventArgs);&lt;BR /&gt;&amp;nbsp; &amp;nbsp;}&lt;BR /&gt; }&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;EventArg-class&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;public class GetJsonSelectionFinishedEventArgs : System.EventArgs&lt;BR /&gt; {&lt;BR /&gt;&amp;nbsp; &amp;nbsp;public BasicFeatureLayer BasicFL&lt;BR /&gt;&amp;nbsp; &amp;nbsp;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; get;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; private set;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;}&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;public GetJsonSelectionFinishedEventArgs(BasicFeatureLayer bfl)&lt;BR /&gt;&amp;nbsp; &amp;nbsp;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; this.BasicFL = bfl;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;}&lt;BR /&gt; }&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And then you can use it just like the other available events.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Collin.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Mar 2017 10:05:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/create-a-custom-event/m-p/854088#M4392</guid>
      <dc:creator>CollinKleiboer</dc:creator>
      <dc:date>2017-03-21T10:05:39Z</dc:date>
    </item>
    <item>
      <title>Re: Create a custom event</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/create-a-custom-event/m-p/854089#M4393</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nice job Collin.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Mar 2017 19:45:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/create-a-custom-event/m-p/854089#M4393</guid>
      <dc:creator>CharlesMacleod</dc:creator>
      <dc:date>2017-03-21T19:45:33Z</dc:date>
    </item>
  </channel>
</rss>

