<?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: IActiveViewEvents_Event not working in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/iactiveviewevents-event-not-working/m-p/619971#M16668</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Sebastian,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;m_activeViewEventsEvent_ItemAdded is not a variable - its a method. Sorry I should rename the method to just activeViewEventsEvent_ItemAdded - sorry dealing with some legacy code here. I will try out the other links. I really appreciate your help.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;VK&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 18 Apr 2012 14:39:55 GMT</pubDate>
    <dc:creator>Vamseekonda</dc:creator>
    <dc:date>2012-04-18T14:39:55Z</dc:date>
    <item>
      <title>IActiveViewEvents_Event not working</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/iactiveviewevents-event-not-working/m-p/619967#M16664</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am working on an Add-In where I need to wire up events for IActiveViewEvents_Event.ItemAdded and IActiveViewEvents_Event.ItemDeleted. Basically I need to way to execute my code when a layer is added/deleted.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have tried:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;m_activeViewEventsEvent = ArcMap.Document.FocusMap as IActiveViewEvents_Event;
m_activeViewEventsEvent.ItemDeleted += new IActiveViewEvents_ItemDeletedEventHandler(m_activeViewEventsEvent_ItemDeleted);
m_activeViewEventsEvent.ItemAdded += new IActiveViewEvents_ItemAddedEventHandler(m_activeViewEventsEvent_ItemAdded);&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But the events never fire. This code used to work just fine in 9.3. Has something change in 10.0? Any help will be appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;VK&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Apr 2012 14:02:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/iactiveviewevents-event-not-working/m-p/619967#M16664</guid>
      <dc:creator>Vamseekonda</dc:creator>
      <dc:date>2012-04-13T14:02:03Z</dc:date>
    </item>
    <item>
      <title>Re: IActiveViewEvents_Event not working</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/iactiveviewevents-event-not-working/m-p/619968#M16665</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;hey&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;does this snippet do what you want?&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#//004900000051000000"&gt;http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#//004900000051000000&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sebastian&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Apr 2012 09:57:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/iactiveviewevents-event-not-working/m-p/619968#M16665</guid>
      <dc:creator>SebastianKrings</dc:creator>
      <dc:date>2012-04-16T09:57:26Z</dc:date>
    </item>
    <item>
      <title>Re: IActiveViewEvents_Event not working</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/iactiveviewevents-event-not-working/m-p/619969#M16666</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Sebastian,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;No this isn't working. This is actually what I am doing in my code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;VK.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Apr 2012 15:23:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/iactiveviewevents-event-not-working/m-p/619969#M16666</guid>
      <dc:creator>Vamseekonda</dc:creator>
      <dc:date>2012-04-16T15:23:10Z</dc:date>
    </item>
    <item>
      <title>Re: IActiveViewEvents_Event not working</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/iactiveviewevents-event-not-working/m-p/619970#M16667</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;hey&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;in the snippet this is done:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp; // Create an instance of the delegate, add it to ItemAdded event
&amp;nbsp; m_ActiveViewEventsItemAdded = new ESRI.ArcGIS.Carto.IActiveViewEvents_ItemAddedEventHandler(OnActiveViewEventsItemAdded);
&amp;nbsp; activeViewEvents.ItemAdded += m_ActiveViewEventsItemAdded;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;that differs from what you have posted. Unless you variable "m_activeViewEventsEvent_ItemAdded" is like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;m_activeViewEventsEvent_ItemAdded = OnActiveViewEventsItemAdded;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;But "OnActiveViewEventsItemAdded" is a method, the method handler and not a variable. So this method is called when the event is fired.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I do not know if you're working with delegates on "m_activeViewEventsEvent_ItemAdded".&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This seem to work for another user (quick google search within first 5 hits):&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://forums.arcgis.com/threads/26019-IActiveView-Events" rel="nofollow noopener noreferrer" target="_blank"&gt;http://forums.arcgis.com/threads/26019-IActiveView-Events&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://resources.esri.com/help/9.3/ArcGISEngine/dotnet/ViewCodePages/e9d3cad8-0770-466a-a62d-6cd9d059c464Form1.cs.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;http://resources.esri.com/help/9.3/ArcGISEngine/dotnet/ViewCodePages/e9d3cad8-0770-466a-a62d-6cd9d059c464Form1.cs.htm&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sebastian&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 02:28:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/iactiveviewevents-event-not-working/m-p/619970#M16667</guid>
      <dc:creator>SebastianKrings</dc:creator>
      <dc:date>2021-12-12T02:28:17Z</dc:date>
    </item>
    <item>
      <title>Re: IActiveViewEvents_Event not working</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/iactiveviewevents-event-not-working/m-p/619971#M16668</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Sebastian,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;m_activeViewEventsEvent_ItemAdded is not a variable - its a method. Sorry I should rename the method to just activeViewEventsEvent_ItemAdded - sorry dealing with some legacy code here. I will try out the other links. I really appreciate your help.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;VK&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2012 14:39:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/iactiveviewevents-event-not-working/m-p/619971#M16668</guid>
      <dc:creator>Vamseekonda</dc:creator>
      <dc:date>2012-04-18T14:39:55Z</dc:date>
    </item>
  </channel>
</rss>

