When my tool is disabled I need to change the tooltip to explain to the user why the tool cannot be used but setting the description attribute does not seem to work.
Here is my code:
[DisplayName("My name")]
[ESRI.ArcGIS.Client.Extensibility.Description("My tooltip")]
public class MyToolCommand : ICommand
...
public bool CanExecute(object parameter)
{
bool ok=true;
if (!MapApplication.Current.IsEditMode)
{
//tool needs to be disabled for some application reason
ok=false;
ESRI.ArcGIS.Client.Extensibility.DescriptionAttribute descriptionAttribute = (ESRI.ArcGIS.Client.Extensibility.DescriptionAttribute)Attribute.GetCustomAttribute(typeof(MyToolCommand ), typeof(ESRI.ArcGIS.Client.Extensibility.DescriptionAttribute));
//change tool tip
descriptionAttribute.Description = "My new tool tip";
}
return ok;
}
Thanks