<?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: Enable/Disable Buttons with Condition based on state in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/enable-disable-buttons-with-condition-based-on/m-p/1074333#M6822</link>
    <description>&lt;P&gt;I think you're on the right track.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I would first setup your conditions like this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;lt;insertCondition id="Disconnected_condition"&amp;gt;&lt;BR /&gt;&amp;lt;not&amp;gt;&lt;BR /&gt;&amp;lt;state id="Connected_state" /&amp;gt;&lt;BR /&gt;&amp;lt;/not&amp;gt;&lt;BR /&gt;&amp;lt;/insertCondition&amp;gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;lt;insertCondition id="Connected_condition"&amp;gt;&lt;BR /&gt;&amp;lt;state id="Connected_state" /&amp;gt;&lt;BR /&gt;&amp;lt;/insertCondition&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;By default, you are in a disconnected state so your connect button should be enabled.&amp;nbsp; Your disconnect button should be disabled.&lt;/P&gt;&lt;P&gt;In the OnClick method of your connect button, change the state:&lt;/P&gt;&lt;P&gt;FrameworkApplication.State.Activate("Connected_state");&lt;/P&gt;&lt;P&gt;The UI should automatically update itself and your connect button should become disabled and your disconnect button enabled.&lt;/P&gt;&lt;P&gt;In the OnClick method of your disconnect button, change the state:&lt;/P&gt;&lt;P&gt;FrameworkApplication.State.Deactivate("Connected_state");&lt;/P&gt;&lt;P&gt;At this point, your disconnect button should now disable and your connect button is enabled.&lt;/P&gt;&lt;P&gt;HTH,&lt;/P&gt;&lt;P&gt;Kris&lt;/P&gt;&lt;P&gt;p.s. instead of using hard-coded strings, I recommend using constants.&amp;nbsp; You won't be able to use the constants in the config.daml file but you will be able to use them in code.&lt;/P&gt;</description>
    <pubDate>Wed, 30 Jun 2021 17:59:00 GMT</pubDate>
    <dc:creator>KrisCulin</dc:creator>
    <dc:date>2021-06-30T17:59:00Z</dc:date>
    <item>
      <title>Enable/Disable Buttons with Condition based on state</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/enable-disable-buttons-with-condition-based-on/m-p/1074309#M6821</link>
      <description>&lt;P&gt;Hello all. &amp;nbsp;I have a plugin where I have a Connect and Disconnect &amp;nbsp;button. &amp;nbsp;I've been exploring the use of conditions to enable/disable the buttons. &amp;nbsp;What I cannot figure out is how to have the Connect enabled while the Disconnect is disabled from the start. &amp;nbsp;Below is the snippet from my Config.daml. &amp;nbsp;With this setup the Connect and Disconnect buttons are disabled from the start. &amp;nbsp;Based on the state of the connection I'd like the button state to change too.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;button id="btnConnect" caption="Connect" className="Connect" smallImage="Images\greenCheck16.png" largeImage="Images\greenCheck32.png" condition="Disconnected"&amp;gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;tooltip heading="Tooltip"&amp;gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;Use this button to connect to the system&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&amp;lt;/tooltip&amp;gt;"&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&amp;lt;/button&amp;gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;button id="btnDisconnect" caption="Disconnect" className="Disconnect" smallImage="Images\redX16.png" largeImage="Images\redX32.png" condition="Connected"&amp;gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;tooltip heading="Tooltip"&amp;gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;Use this button to disconnect to the system&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&amp;lt;/tooltip&amp;gt;"&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&amp;lt;/button&amp;gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/controls&amp;gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;lt;/insertModule&amp;gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;lt;/modules&amp;gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;lt;conditions&amp;gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;lt;!-- our custom condition --&amp;gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;lt;insertCondition id="Connected" caption="Connected to the system"&amp;gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;lt;!-- our condition is set true or false based on this underlying state --&amp;gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;lt;state id="connected" /&amp;gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;lt;/insertCondition&amp;gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;lt;insertCondition id="Disconnected" caption="Disconnected from the system"&amp;gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;lt;!-- our condition is set true or false based on this underlying state --&amp;gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;lt;state id="disconnected" /&amp;gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;lt;/insertCondition&amp;gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;lt;/conditions&amp;gt;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Wed, 30 Jun 2021 17:38:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/enable-disable-buttons-with-condition-based-on/m-p/1074309#M6821</guid>
      <dc:creator>TimothyReed1</dc:creator>
      <dc:date>2021-06-30T17:38:04Z</dc:date>
    </item>
    <item>
      <title>Re: Enable/Disable Buttons with Condition based on state</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/enable-disable-buttons-with-condition-based-on/m-p/1074333#M6822</link>
      <description>&lt;P&gt;I think you're on the right track.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I would first setup your conditions like this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;lt;insertCondition id="Disconnected_condition"&amp;gt;&lt;BR /&gt;&amp;lt;not&amp;gt;&lt;BR /&gt;&amp;lt;state id="Connected_state" /&amp;gt;&lt;BR /&gt;&amp;lt;/not&amp;gt;&lt;BR /&gt;&amp;lt;/insertCondition&amp;gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;lt;insertCondition id="Connected_condition"&amp;gt;&lt;BR /&gt;&amp;lt;state id="Connected_state" /&amp;gt;&lt;BR /&gt;&amp;lt;/insertCondition&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;By default, you are in a disconnected state so your connect button should be enabled.&amp;nbsp; Your disconnect button should be disabled.&lt;/P&gt;&lt;P&gt;In the OnClick method of your connect button, change the state:&lt;/P&gt;&lt;P&gt;FrameworkApplication.State.Activate("Connected_state");&lt;/P&gt;&lt;P&gt;The UI should automatically update itself and your connect button should become disabled and your disconnect button enabled.&lt;/P&gt;&lt;P&gt;In the OnClick method of your disconnect button, change the state:&lt;/P&gt;&lt;P&gt;FrameworkApplication.State.Deactivate("Connected_state");&lt;/P&gt;&lt;P&gt;At this point, your disconnect button should now disable and your connect button is enabled.&lt;/P&gt;&lt;P&gt;HTH,&lt;/P&gt;&lt;P&gt;Kris&lt;/P&gt;&lt;P&gt;p.s. instead of using hard-coded strings, I recommend using constants.&amp;nbsp; You won't be able to use the constants in the config.daml file but you will be able to use them in code.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Jun 2021 17:59:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/enable-disable-buttons-with-condition-based-on/m-p/1074333#M6822</guid>
      <dc:creator>KrisCulin</dc:creator>
      <dc:date>2021-06-30T17:59:00Z</dc:date>
    </item>
    <item>
      <title>Re: Enable/Disable Buttons with Condition based on state</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/enable-disable-buttons-with-condition-based-on/m-p/1074447#M6823</link>
      <description>&lt;P&gt;Here is a Pro Guide on States &amp;amp; Conditions:&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/Esri/arcgis-pro-sdk/wiki/ProGuide-Code-Your-Own-States-and-Conditions" target="_blank"&gt;ProGuide Code Your Own States and Conditions · Esri/arcgis-pro-sdk Wiki (github.com)&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Jun 2021 20:34:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/enable-disable-buttons-with-condition-based-on/m-p/1074447#M6823</guid>
      <dc:creator>Wolf</dc:creator>
      <dc:date>2021-06-30T20:34:43Z</dc:date>
    </item>
  </channel>
</rss>

