Command: enabling/disabling UI elements

Topics: CAB & Smart Client Software Factory
Dec 8, 2005 at 2:18 AM
originally posted by: Felice_Pollano

Hi all,
Is there some consistent way to enabling/disabling the UI element related to a certain command ? I'm talking about someting like AddUpdater("OnUpdateMyCommand") and
Updater("OnUpdateMyCommand")
void MyUpdater(object sender,CommandUpdaterEventArgs e)
{
if( something )
e.Disable();
if( other )
e.SetCheck();
}
and something to disable the UI element if there is no Invoker connected to a command.
This would be very similar to the OnUpdateCommandUI and fDisableIfNoHandler strategy in MFC. If nothing exists, could someone please me suggest the best way to implement something similar, or another way to achieve the same results ?
Thank You
Dec 8, 2005 at 8:32 AM
originally posted by: BradWilsonMSFT

The Command object offers a Status property which can be used to enable, disable, or hide the elements associated with the command.

Since a command hides many types of objects, and can hide multiple objects at once, there are no specific methods like 'SetCheck' (which implies that there is something "checkable" hiding behind the command).
Dec 9, 2005 at 1:16 AM
originally posted by: Felice_Pollano

Tank you,
I saw the Status property, and it works.