I'm new to the AddIn customization model in ArcGIS 10 and I'm trying to figure out how to change a button image for a button. I'm looking for the equivalent to the BaseCommand UpdateBitmap method and haven't had any luck. Is this a limitation of the AddIn model? Or did I miss something obvious?
I have not worked with add-ins in ArcGIS 10, but looking at the documentation (see heading Add-in file anatomy), it appears that you would need to specify the image declaratively in the add-in's XML configuration (metadata):
<ESRI.Configuration xmlns="http://schemas.esri.com/Desktop/AddIns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <!-- Omitted --> <AddIn language="CLR" library="Acme.dll" namespace="Acme"> <ArcMap> <Commands> <Button id="Acme_ToggleDockWinBtn" class="ToggleDockWinBtn" caption="OpenDockWin" category="Acme Tools" image="Images\ToggleDockWinBtn.png" <!-- Define image URI --> tip="Toggle dockable window." message="Open dockable window."> <Help heading="Toggle">Turns the ACME dockable window on and off.</Help> </Button> </Commands> </ArcMap> </AddIn> </ESRI.Configuration>
See also the Advanced add-in concepts topic, which suggests that graphics should no longer be embedded as resources in the assembly.