I have an add-in that Should be enabled by default when my custom tab is open and there is an Active map. I would like to be able to programmatically disable the tool if there is an error (in my case I need to connect to a remote large feature class and want to disable the tool if the FC is unavailable or unreachable).
As discussed in the documentation I've added a <conditions> tag after </AddInInfo> and a condition attributed to my <tool> but when I add the condition my tool is always disabled on first load.
Here is the condition:
<conditions>
<insertCondition id="srview_condition">
<state id="srview_state" />
</insertCondition>
</conditions>
<controls>
<!-- add your controls here -->
<tool id="SRView4Pro_modSRView4Pro" caption="SR View for Pro" className="SRView4ProTool" keytip="T3" loadOnClick="true" smallImage="Images\SRViewButton16.png" largeImage="Images\SRViewButton32.png" condition="srview_condition">
<tooltip heading="SR View for Pro">Show SR View 3 images or Google StreetView from left mouse click.<disabledText /></tooltip>
</tool>
</controls>
It looks like the condition is being set to Deactivated by default so the tool is never available to be run. In the Initialize event I added .Activate but I don't think this Event is actually RUN. Ideas? Code Attached.