none
Dynamically disabling commands. RRS feed

  • Question

  •  

    I have a command that needs to be disabled if certain condition is met. I understand you can't change activities at runtime. Thus, I tried to set my command's command.Grammar.Enabled to false. It doesn't seem to do anything. Is there any way to disable a command?

     

     

    Thursday, May 15, 2008 5:59 PM

All replies

  • Have you tried disabling the command itselfinstead f the grammar by setting CommandActivity.Enabled to false?

     

    Thursday, May 22, 2008 2:17 PM
  • I have, however, it doesn't work because you can't make changes to a workflow activity at runtime. Setting Enabled property to false on an activity would cause an InvalidOperationException to be thrown.
    Thursday, May 22, 2008 2:25 PM