In my add-in I'm using Delegate Commands to control button sensitivity, but it does not seem to affect the initial button state. I am not specifying any condition in the DAML, but all buttons appear enabled at startup instead of just the one desired. Here are the corresponding methods and properties.
internal static void OnConnectButtonClick()
{
_connected = true;
}
internal static bool CanOnConnectButtonClick
{
get {
return !_connected;
}
}
internal static void OnDisconnectButtonClick()
{
_connected = false;
}
internal static bool CanOnDisconnectButtonClick
{
get {
return _connected;
}
}
What am I missing here? It seems the only way I'm able to achieve the desired effect is to create a configuration with custom conditions and set the condition/state in the OnApplicationReady() method. Is there a way to accomplish this with just an add-in?