<?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: Passing parameters to Icommand in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/passing-parameters-to-icommand/m-p/1268745#M9545</link>
    <description>&lt;P&gt;Thanks for the response, this example uses binding and don't think it's translates to what I'm trying to do with Maptool.&lt;/P&gt;</description>
    <pubDate>Thu, 16 Mar 2023 20:08:17 GMT</pubDate>
    <dc:creator>Cheetah24</dc:creator>
    <dc:date>2023-03-16T20:08:17Z</dc:date>
    <item>
      <title>Passing parameters to Icommand</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/passing-parameters-to-icommand/m-p/1268635#M9542</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;How can I pass a parameter using the following code where commandId is a custom class that extends MapTool. Is CanExecute implemented to accept parameters? I always get false when I specify an object.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;IPlugInWrapper wrapper = FrameworkApplication.GetPlugInWrapper(commandId);&lt;BR /&gt;&lt;SPAN&gt;var&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;command = wrapper&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;as&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;ICommand;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;if&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;((command !=&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;null&lt;/SPAN&gt;) &amp;amp;&amp;amp; command.CanExecute(&lt;SPAN&gt;null&lt;/SPAN&gt;))&lt;BR /&gt;&amp;nbsp; command.Execute(&lt;SPAN&gt;null&lt;/SPAN&gt;);&lt;/P&gt;</description>
      <pubDate>Thu, 16 Mar 2023 17:55:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/passing-parameters-to-icommand/m-p/1268635#M9542</guid>
      <dc:creator>Cheetah24</dc:creator>
      <dc:date>2023-03-16T17:55:33Z</dc:date>
    </item>
    <item>
      <title>Re: Passing parameters to Icommand</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/passing-parameters-to-icommand/m-p/1268731#M9544</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Look at the existing thread:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/arcgis-pro-sdk-questions/passing-a-parameter-to-an-icommand/m-p/787266" target="_self"&gt;https://community.esri.com/t5/arcgis-pro-sdk-questions/passing-a-parameter-to-an-icommand/m-p/787266&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Mar 2023 19:51:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/passing-parameters-to-icommand/m-p/1268731#M9544</guid>
      <dc:creator>GKmieliauskas</dc:creator>
      <dc:date>2023-03-16T19:51:06Z</dc:date>
    </item>
    <item>
      <title>Re: Passing parameters to Icommand</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/passing-parameters-to-icommand/m-p/1268745#M9545</link>
      <description>&lt;P&gt;Thanks for the response, this example uses binding and don't think it's translates to what I'm trying to do with Maptool.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Mar 2023 20:08:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/passing-parameters-to-icommand/m-p/1268745#M9545</guid>
      <dc:creator>Cheetah24</dc:creator>
      <dc:date>2023-03-16T20:08:17Z</dc:date>
    </item>
    <item>
      <title>Re: Passing parameters to Icommand</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/passing-parameters-to-icommand/m-p/1268749#M9546</link>
      <description>&lt;P&gt;You can use your module for parameter exchanging. Make property in module with public get and set methods. Before Execute call set parameter, and on tool activating read it.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Mar 2023 20:15:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/passing-parameters-to-icommand/m-p/1268749#M9546</guid>
      <dc:creator>GKmieliauskas</dc:creator>
      <dc:date>2023-03-16T20:15:21Z</dc:date>
    </item>
    <item>
      <title>Re: Passing parameters to Icommand</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/passing-parameters-to-icommand/m-p/1268768#M9548</link>
      <description>&lt;P&gt;if your always getting null, you should check that you have Activated the tab your button is on.&amp;nbsp;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;FrameworkApplication.ActivateTab('esri_mapping_homeTab');&lt;/P&gt;&lt;P&gt;One activated you execute the button with&amp;nbsp;command..Execute() as you show.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Mar 2023 21:17:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/passing-parameters-to-icommand/m-p/1268768#M9548</guid>
      <dc:creator>RichardDaniels</dc:creator>
      <dc:date>2023-03-16T21:17:18Z</dc:date>
    </item>
    <item>
      <title>Re: Passing parameters to Icommand</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/passing-parameters-to-icommand/m-p/1268805#M9550</link>
      <description>&lt;P&gt;Hi. I only get false if i attempt to pass a parameter to canexecute()&lt;/P&gt;</description>
      <pubDate>Thu, 16 Mar 2023 22:23:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/passing-parameters-to-icommand/m-p/1268805#M9550</guid>
      <dc:creator>Cheetah24</dc:creator>
      <dc:date>2023-03-16T22:23:16Z</dc:date>
    </item>
    <item>
      <title>Re: Passing parameters to Icommand</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/passing-parameters-to-icommand/m-p/1269045#M9551</link>
      <description>&lt;P&gt;Neither classes derived from Button (processing your OnClick) nor classes derived from MapTool (processing your Tool) are accepting parameters.&amp;nbsp; If you need to configure any of these button or tool classes, i recommend using properties in your Module derived class (or settings if that's appropriate).&amp;nbsp; Your module derived class is a singleton and easily accessible from any of your code.&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;internal class Module1 : Module
{
    private static Module1 _this = null;
...
    internal static string MyToolSetting
    {
      get; set;
    }
}&lt;/LI-CODE&gt;&lt;P&gt;To access this from your tool (within the same project):&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;internal class MapTool1 : MapTool
{
  private string myParameter;
  public MapTool1()
  {
    IsSketchTool = true;
    SketchType = SketchGeometryType.Rectangle;
    SketchOutputMode = SketchOutputMode.Map;
  }
  protected override Task OnToolActivateAsync(bool active)
  {
    myParameter = Module1.MyToolSetting;
    return base.OnToolActivateAsync(active);
  }
...
}&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 17 Mar 2023 17:05:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/passing-parameters-to-icommand/m-p/1269045#M9551</guid>
      <dc:creator>Wolf</dc:creator>
      <dc:date>2023-03-17T17:05:39Z</dc:date>
    </item>
  </channel>
</rss>

