<?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: ArcMap TOC Selection Changed Event help in Developers Questions</title>
    <link>https://community.esri.com/t5/developers-questions/arcmap-toc-selection-changed-event-help/m-p/355127#M2263</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I got an &lt;A href="https://gis.stackexchange.com/questions/3685/event-raised-when-selected-layer-changes-in-toc"&gt;answer to this over at StackExchange&lt;/A&gt;, basically the event isn't implemented for the TOC. There's a couple 'hack' workarounds to get more or less the same functionality, but in my case I have used this information to explain to my team lead why adding a button and click event will be more suitable to our needs.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 10 Jul 2014 14:34:16 GMT</pubDate>
    <dc:creator>ClintDow</dc:creator>
    <dc:date>2014-07-10T14:34:16Z</dc:date>
    <item>
      <title>ArcMap TOC Selection Changed Event help</title>
      <link>https://community.esri.com/t5/developers-questions/arcmap-toc-selection-changed-event-help/m-p/355126#M2262</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have been trying to figure this out for almost a full working day and I just can't get it working. All I want to do is fire an event when the user clicks different layers in the arcmap table of contents.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can get it working with, for example, the PageLayout using this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IActiveViewEvents_Event pageLayoutEvent = ArcMap.Document.PageLayout as IActiveViewEvents_Event;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have googled and looked into a bunch of different threads, all revolving around the concept of 'IActiveViewEvents_Event' interfaces. Perhaps this is the wrong event interface for what I am trying to do. I've been able to get the event when the selection changes within the map document itself.. But I simply cant get an event to fire in the Table of Contents.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My best attempt looks like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;IActiveViewEvents toc = ArcMap.Document.get_ContentsView(0) as IActiveViewEvents;&lt;/P&gt;&lt;P&gt;IActiveViewEvents_Event tocEvent = ((TOCCatalogView)toc).SelectedItem as IActiveViewEvents_Event;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However tocEvent is set to null. If I do not cast to IActiveViewEvents_Event, SelectedItem is not null...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If anyone could provide a full example of doing this I would be very grateful!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jul 2014 18:07:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/arcmap-toc-selection-changed-event-help/m-p/355126#M2262</guid>
      <dc:creator>ClintDow</dc:creator>
      <dc:date>2014-07-09T18:07:27Z</dc:date>
    </item>
    <item>
      <title>Re: ArcMap TOC Selection Changed Event help</title>
      <link>https://community.esri.com/t5/developers-questions/arcmap-toc-selection-changed-event-help/m-p/355127#M2263</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I got an &lt;A href="https://gis.stackexchange.com/questions/3685/event-raised-when-selected-layer-changes-in-toc"&gt;answer to this over at StackExchange&lt;/A&gt;, basically the event isn't implemented for the TOC. There's a couple 'hack' workarounds to get more or less the same functionality, but in my case I have used this information to explain to my team lead why adding a button and click event will be more suitable to our needs.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jul 2014 14:34:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/arcmap-toc-selection-changed-event-help/m-p/355127#M2263</guid>
      <dc:creator>ClintDow</dc:creator>
      <dc:date>2014-07-10T14:34:16Z</dc:date>
    </item>
  </channel>
</rss>

