<?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 Change Active Map based on Active Ribbon in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/change-active-map-based-on-active-ribbon/m-p/874082#M5327</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;By using&amp;nbsp;ActiveMapViewChangedEvent subscribe method (&lt;A href="https://community.esri.com/thread/212871"&gt;ActiveMapViewChangedEvent&lt;/A&gt;&amp;nbsp;), i am able to change/activate my ribbon/tab based on the active map view.&lt;/P&gt;&lt;P&gt;Now we want to implement opposite communication. i.e whenever we change the ribbon/tab, the corresponding MapView has to get activate.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried to use&amp;nbsp;ArcGIS.Desktop.Framework.Events.ActivePaneChangedEvent.Subscribe(OnActivePanChanged) and&amp;nbsp;ActiveWindowChangedEvent.Subscribe(OnActiveWindowChanged) options. But these two methods are not getting fired when we change the ribbon/tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Appreciate your help on this. Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 12 Dec 2019 04:08:15 GMT</pubDate>
    <dc:creator>SreenivasaRaoPigili</dc:creator>
    <dc:date>2019-12-12T04:08:15Z</dc:date>
    <item>
      <title>Change Active Map based on Active Ribbon</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/change-active-map-based-on-active-ribbon/m-p/874082#M5327</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;By using&amp;nbsp;ActiveMapViewChangedEvent subscribe method (&lt;A href="https://community.esri.com/thread/212871"&gt;ActiveMapViewChangedEvent&lt;/A&gt;&amp;nbsp;), i am able to change/activate my ribbon/tab based on the active map view.&lt;/P&gt;&lt;P&gt;Now we want to implement opposite communication. i.e whenever we change the ribbon/tab, the corresponding MapView has to get activate.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried to use&amp;nbsp;ArcGIS.Desktop.Framework.Events.ActivePaneChangedEvent.Subscribe(OnActivePanChanged) and&amp;nbsp;ActiveWindowChangedEvent.Subscribe(OnActiveWindowChanged) options. But these two methods are not getting fired when we change the ribbon/tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Appreciate your help on this. Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Dec 2019 04:08:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/change-active-map-based-on-active-ribbon/m-p/874082#M5327</guid>
      <dc:creator>SreenivasaRaoPigili</dc:creator>
      <dc:date>2019-12-12T04:08:15Z</dc:date>
    </item>
    <item>
      <title>Re: Change Active Map based on Active Ribbon</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/change-active-map-based-on-active-ribbon/m-p/874083#M5328</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Srinu,&lt;/P&gt;&lt;P&gt;&amp;nbsp;Can you explain your desired workflow in a bit more detail?&amp;nbsp; Are these ribbons or tabs you are changing defined in your add-in?&amp;nbsp;&amp;nbsp;There is sample code that manipulates which map views are activated from a dockpane, maybe that helps:&amp;nbsp;&lt;A href="https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Framework/OpenMapViews"&gt;https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Framework/OpenMapViews&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Wolf&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Dec 2019 20:07:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/change-active-map-based-on-active-ribbon/m-p/874083#M5328</guid>
      <dc:creator>Wolf</dc:creator>
      <dc:date>2019-12-12T20:07:56Z</dc:date>
    </item>
    <item>
      <title>Re: Change Active Map based on Active Ribbon</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/change-active-map-based-on-active-ribbon/m-p/874084#M5329</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Wolf,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;Thank you for your response.&lt;/P&gt;&lt;P&gt;Yes all these ribbons are defined in my add-in, through config.daml. Also, Mapview are created through code.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.5pt; color: #3d3d3d; background: white;"&gt;For ex, If “MapViewA” is tagged to “Ribbon A”, “MapViewB” is tagged to “RibbonB” etc. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Now requirement is :&lt;/P&gt;&lt;P&gt;If we make “RibbonA” active, then “MapViewA” has to get active automatically.&lt;/P&gt;&lt;P&gt;If RibbonB is active then MapViewB should become active etc etc.&lt;/P&gt;&lt;P&gt;Hope this clarifies your question. Please let me know, if you need any details further.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Dec 2019 03:54:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/change-active-map-based-on-active-ribbon/m-p/874084#M5329</guid>
      <dc:creator>SreenivasaRaoPigili</dc:creator>
      <dc:date>2019-12-16T03:54:27Z</dc:date>
    </item>
    <item>
      <title>Re: Change Active Map based on Active Ribbon</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/change-active-map-based-on-active-ribbon/m-p/874085#M5330</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Srinu,&lt;/P&gt;&lt;P&gt;&amp;nbsp;Unfortunately i can't find any 'out-of-box' events in the API that will help you with this.&amp;nbsp;As a possible workaround&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;i think you can&amp;nbsp;override one of your&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;UI&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;control's OnUpdate() methods in order to trigger your code&amp;nbsp;to&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;check if the matching map pane is being displayed.&amp;nbsp; Needless to say you have to implement this for one UI control on each tab.&amp;nbsp; I did a sample test on a button control:&amp;nbsp;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;internal&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;class&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;Button1&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; Button
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;protected&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;override&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;OnClick&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
    &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;

    &lt;SPAN class="keyword token"&gt;protected&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;override&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;OnUpdate&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
        System&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Diagnostics&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Debug&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;WriteLine&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Add your logic here"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;base&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;OnUpdate&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
    &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;OnUpdate was called as soon as the add-in was loaded (in my case i am using JIT loading - with a module 'autoLoad=false', so my code is not executed until i click on a button or other component of my add-in).&lt;/P&gt;&lt;P&gt;I hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Wolf&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 10:56:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/change-active-map-based-on-active-ribbon/m-p/874085#M5330</guid>
      <dc:creator>Wolf</dc:creator>
      <dc:date>2021-12-12T10:56:58Z</dc:date>
    </item>
    <item>
      <title>Re: Change Active Map based on Active Ribbon</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/change-active-map-based-on-active-ribbon/m-p/874086#M5331</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Wolf for your time in analyzing this. I will use this approach.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Dec 2019 03:04:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/change-active-map-based-on-active-ribbon/m-p/874086#M5331</guid>
      <dc:creator>SreenivasaRaoPigili</dc:creator>
      <dc:date>2019-12-17T03:04:07Z</dc:date>
    </item>
    <item>
      <title>Re: Change Active Map based on Active Ribbon</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/change-active-map-based-on-active-ribbon/m-p/874087#M5332</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Wolf,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; I have tried this option. Please find the observations below.&lt;/P&gt;&lt;P&gt;1. I have added this piece of code in my class file and inherited from ArcGIS Button.&lt;/P&gt;&lt;P&gt;2. This code is getting executed only when i clicked on the button.&lt;/P&gt;&lt;P&gt;3. Then OnUpdate() is executing infinitely.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;button id="Button1" caption="Button1" className="Button1" loadOnClick="true" smallImage="Images\xyz16.png" largeImage="Images\xyz32.png"&amp;gt;&lt;BR /&gt; &amp;lt;tooltip heading="Button1"&amp;gt;&lt;BR /&gt; Button1&amp;lt;disabledText /&amp;gt;&lt;BR /&gt; &amp;lt;/tooltip&amp;gt;&lt;BR /&gt; &amp;lt;/button&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;internal class &lt;SPAN&gt;Button1&lt;/SPAN&gt; : Button&lt;BR /&gt; {&lt;BR /&gt; /*&lt;BR /&gt; protected override void OnClick()&lt;BR /&gt; {&lt;BR /&gt; MessageBox.Show("Testing");&lt;BR /&gt; OnUpdate();&lt;BR /&gt; }*/&lt;BR /&gt; &lt;BR /&gt; protected override void OnUpdate()&lt;BR /&gt; {&lt;BR /&gt; MessageBox.Show("Observing the ribbon loading event" + FrameworkApplication.ActiveTab);&lt;BR /&gt; base.OnUpdate();&amp;nbsp; &amp;nbsp; &amp;nbsp;//&lt;SPAN&gt;base.OnUpdate();&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt; }&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know, if i am doing any wrong here.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Dec 2019 10:14:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/change-active-map-based-on-active-ribbon/m-p/874087#M5332</guid>
      <dc:creator>SreenivasaRaoPigili</dc:creator>
      <dc:date>2019-12-18T10:14:42Z</dc:date>
    </item>
    <item>
      <title>Re: Change Active Map based on Active Ribbon</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/change-active-map-based-on-active-ribbon/m-p/874088#M5333</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Srinu,&lt;/P&gt;&lt;P&gt;&amp;nbsp;When debugging methods like OnUpdate, that are repetitively called in the background, you cannot use MessageBox.Show or any other method that will hang the OnUpdate function.&amp;nbsp; Using methods like&lt;/P&gt;&lt;PRE class="" style="color: #000000; background: #f5f2f0; border: 0px; margin: 0.5em 0px; padding: 1em 1em 1em 3.8em;"&gt;&lt;CODE style="border: 0px; font-weight: inherit;"&gt;System&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;.&lt;/SPAN&gt;Diagnostics&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;.&lt;/SPAN&gt;Debug&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="" style="color: #d74444; border: 0px; font-weight: inherit;"&gt;WriteLine&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;as i did in my sample because these functions will not 'hang' the method and you can still see our output when&amp;nbsp;looking at the Visual Studio output window.&amp;nbsp; Also you cannot set breakpoints in these types of methods for the same reason.&amp;nbsp; After reading your bullets 1 and 2 above, i wanted to note that you can use the ArcGIS Pro SDK Item templates to add buttons to your add-in.&amp;nbsp; Pro SDK item templates will stub out all code and daml you need.&amp;nbsp; See:&amp;nbsp;&lt;A _jive_internal="true" href="https://community.esri.com/message/(https:/github.com/Esri/arcgis-pro-sdk/wiki/ProGuide-Installation-and-Upgrade#install-arcgis-pro-sdk-for-net"&gt;install-arcgis-pro-sdk-for-net&lt;/A&gt;&amp;nbsp;and&amp;nbsp;&lt;A href="https://github.com/Esri/arcgis-pro-sdk/wiki/ProGuide-Build-Your-First-Add-in"&gt;ProGuide-Build-Your-First-Add-in&lt;/A&gt;&amp;nbsp;for more details in case you are not aware of this.&lt;/P&gt;&lt;P&gt;I attached a sample project TabShowMappane.&amp;nbsp; Look at the code in the Module1 class and the two buttons (one for each tab).&amp;nbsp; You need a project that has two map panes: Map1 and Map2 as shown here and click on the "Tab Map 1" tab:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jive-emoji image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/476561_s1.png" /&gt;&lt;/P&gt;&lt;P&gt;Not that the Map1 mapview is active.&amp;nbsp; Now click on the "Tab Map2" tab:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jive-emoji jive-image image-2 j-img-original" src="https://community.esri.com/legacyfs/online/476562_s2.png" /&gt;&lt;/P&gt;&lt;P&gt;and see the active mapview change to Map2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this gets you started.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Dec 2019 19:01:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/change-active-map-based-on-active-ribbon/m-p/874088#M5333</guid>
      <dc:creator>Wolf</dc:creator>
      <dc:date>2019-12-18T19:01:22Z</dc:date>
    </item>
    <item>
      <title>Re: Change Active Map based on Active Ribbon</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/change-active-map-based-on-active-ribbon/m-p/874089#M5334</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Wolf. This helped me to start. Appreciate your help on this resolution and clarification.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Dec 2019 09:58:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/change-active-map-based-on-active-ribbon/m-p/874089#M5334</guid>
      <dc:creator>SreenivasaRaoPigili</dc:creator>
      <dc:date>2019-12-19T09:58:00Z</dc:date>
    </item>
  </channel>
</rss>

