<?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 Can only click GalleryItem once - Pro SDK in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/can-only-click-galleryitem-once-pro-sdk/m-p/865228#M4908</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In ArcGIS Pro, I can only click a particular item from my custom gallery once.&amp;nbsp; If I click the gallery drop down and click the same item again, nothing happens.&amp;nbsp; Here's the OnClick:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;protected override void OnClick(GalleryItem item)
{
 ArcGIS.Desktop.Framework.Dialogs.MessageBox.Show(item.Text);
 base.OnClick(item);
}&lt;/PRE&gt;&lt;P&gt;I put a breakpoint in the code on the message box line, and it hits it the first time I click an item but not the second.&amp;nbsp; However, if I click a different gallery item, then the breakpoint is hit (but not if I click that second gallery item again).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I compile the &lt;A href="https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Framework/Gallery" rel="nofollow noopener noreferrer" target="_blank"&gt;gallery sample&lt;/A&gt;, I get the same behavior.&amp;nbsp; To reproduce the bug:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Download and build the gallery sample (under Framework/Gallery).&lt;/P&gt;&lt;P&gt;2. Start Pro and click a web map from the gallery. It is added to your project.&lt;/P&gt;&lt;P&gt;3. Delete the map and click the same web map in the gallery again. No map is added this time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What's the trick to handling when a user clicks on a gallery item they've clicked before?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Environment:&lt;/P&gt;&lt;P&gt;Windows 10&lt;/P&gt;&lt;P&gt;Visual Studio 2017 Community Edition&lt;/P&gt;&lt;P&gt;Pro SDK for .NET (and Utilities) 2.3.0.15769&lt;/P&gt;&lt;P&gt;Pro 2.3.2&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 17:01:01 GMT</pubDate>
    <dc:creator>TimWhiteaker</dc:creator>
    <dc:date>2021-12-12T17:01:01Z</dc:date>
    <item>
      <title>Can only click GalleryItem once - Pro SDK</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/can-only-click-galleryitem-once-pro-sdk/m-p/865228#M4908</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In ArcGIS Pro, I can only click a particular item from my custom gallery once.&amp;nbsp; If I click the gallery drop down and click the same item again, nothing happens.&amp;nbsp; Here's the OnClick:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;protected override void OnClick(GalleryItem item)
{
 ArcGIS.Desktop.Framework.Dialogs.MessageBox.Show(item.Text);
 base.OnClick(item);
}&lt;/PRE&gt;&lt;P&gt;I put a breakpoint in the code on the message box line, and it hits it the first time I click an item but not the second.&amp;nbsp; However, if I click a different gallery item, then the breakpoint is hit (but not if I click that second gallery item again).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I compile the &lt;A href="https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Framework/Gallery" rel="nofollow noopener noreferrer" target="_blank"&gt;gallery sample&lt;/A&gt;, I get the same behavior.&amp;nbsp; To reproduce the bug:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Download and build the gallery sample (under Framework/Gallery).&lt;/P&gt;&lt;P&gt;2. Start Pro and click a web map from the gallery. It is added to your project.&lt;/P&gt;&lt;P&gt;3. Delete the map and click the same web map in the gallery again. No map is added this time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What's the trick to handling when a user clicks on a gallery item they've clicked before?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Environment:&lt;/P&gt;&lt;P&gt;Windows 10&lt;/P&gt;&lt;P&gt;Visual Studio 2017 Community Edition&lt;/P&gt;&lt;P&gt;Pro SDK for .NET (and Utilities) 2.3.0.15769&lt;/P&gt;&lt;P&gt;Pro 2.3.2&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 17:01:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/can-only-click-galleryitem-once-pro-sdk/m-p/865228#M4908</guid>
      <dc:creator>TimWhiteaker</dc:creator>
      <dc:date>2021-12-12T17:01:01Z</dc:date>
    </item>
    <item>
      <title>Re: Can only click GalleryItem once - Pro SDK</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/can-only-click-galleryitem-once-pro-sdk/m-p/865229#M4909</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tim,&lt;/P&gt;&lt;P&gt;I see this issue too using the sample. We will investigate this behavior. Thank you for reporting this!&lt;/P&gt;&lt;P&gt;Uma&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 May 2019 21:24:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/can-only-click-galleryitem-once-pro-sdk/m-p/865229#M4909</guid>
      <dc:creator>UmaHarano</dc:creator>
      <dc:date>2019-05-02T21:24:15Z</dc:date>
    </item>
    <item>
      <title>Re: Can only click GalleryItem once - Pro SDK</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/can-only-click-galleryitem-once-pro-sdk/m-p/865230#M4910</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tim&lt;/P&gt;&lt;P&gt;Set the&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/sdk/api-reference/#topic10480.html"&gt;AllywaysFireOnClick&lt;/A&gt;&amp;nbsp;property on the Gallery class to true. This will allow you to click the selected item in a gallery.&lt;/P&gt;&lt;P&gt;I will update the &lt;A href="https://github.com/esri/arcgis-pro-sdk/wiki/ProGuide-Galleries"&gt;Gallery wiki page&lt;/A&gt; with this info.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Uma&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 May 2019 21:15:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/can-only-click-galleryitem-once-pro-sdk/m-p/865230#M4910</guid>
      <dc:creator>UmaHarano</dc:creator>
      <dc:date>2019-05-07T21:15:23Z</dc:date>
    </item>
    <item>
      <title>Re: Can only click GalleryItem once - Pro SDK</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/can-only-click-galleryitem-once-pro-sdk/m-p/865231#M4911</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Uma,&lt;/P&gt;&lt;P&gt;I have this problem also with the Galley. I have followed your link to AlwaysFireOnClick . This is under the ArcPro SDK 2.3. Browsing up to the GalleryClass &lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/sdk/api-reference/#topic10461.html" title="https://pro.arcgis.com/en/pro-app/sdk/api-reference/#topic10461.html"&gt;ArcGIS Pro 2.3 API Reference Guide&lt;/A&gt; , AlwaysFireOnClick is not listed in the DAML Attributes. It is a property like loadingMessage. I can set a loadingMessage within the Gallery block in the Config.daml, however I cannot use alwaysFireOnclick. Intllesense returns "alwaysFireOnClick attribute not declared.&lt;/P&gt;&lt;P&gt;I have tried various capitalization's&amp;nbsp; for AlwaysFireOnClick&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do you use this property?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using:&lt;/P&gt;&lt;P&gt;Visual Studio 2017 Community&lt;/P&gt;&lt;P&gt;ArcPro SDK 2.3.0.15769&lt;/P&gt;&lt;P&gt;coding for ArcGIS Pro 2.3.0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Jun 2019 04:53:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/can-only-click-galleryitem-once-pro-sdk/m-p/865231#M4911</guid>
      <dc:creator>StefanDieters1</dc:creator>
      <dc:date>2019-06-05T04:53:52Z</dc:date>
    </item>
    <item>
      <title>Re: Can only click GalleryItem once - Pro SDK</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/can-only-click-galleryitem-once-pro-sdk/m-p/865232#M4912</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I put it in the .cs file for the gallery.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private bool _isInitialized;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; protected override void OnDropDownOpened()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Initialize();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private void Initialize()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (_isInitialized)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Code to add your gallery items...
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Items added. Now wrap up.
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AlwaysFireOnClick = true;&amp;nbsp; // Required so you can click a gallery item again that you had clicked last time
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _isInitialized = true;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 17:01:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/can-only-click-galleryitem-once-pro-sdk/m-p/865232#M4912</guid>
      <dc:creator>TimWhiteaker</dc:creator>
      <dc:date>2021-12-12T17:01:04Z</dc:date>
    </item>
    <item>
      <title>Re: Can only click GalleryItem once - Pro SDK</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/can-only-click-galleryitem-once-pro-sdk/m-p/865233#M4913</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's it. Works.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Jun 2019 00:26:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/can-only-click-galleryitem-once-pro-sdk/m-p/865233#M4913</guid>
      <dc:creator>StefanDieters1</dc:creator>
      <dc:date>2019-06-06T00:26:42Z</dc:date>
    </item>
  </channel>
</rss>

