Availability Effects

Explanation

An availability effect is a class that implements the IAvailabilityEffect interface, located in Caliburn.PresentationFramework. Availability effects allow a developer to alter the UI when a trigger for a particular message is not available. ie. an action/command cannot execute. The default effect is to disable the UI, but there are several other built-in effects and you can create your own.

Details

Built-in Effects

Effect Name Result
Disable Disable the UI
Hide Hides the UI; still takes up space in the layout.
Collapse Hides the UI; does not take up space in the layout.
None The UI will not be affected by availability.


When using the Message.Attach attached property for shortened trigger declaration, you can use the Message.AvailabilityEffect attached property to set a non-default availability effect. If you are using the long Xaml declaration for triggers/messages, every message has an AvailabilityEffect property that allows you to fine tune the effect for individual messages. See the sample named "AvailabilityEffects" for a demonstration of all effects as well as the use of a user-defined effect.

Last edited Oct 23, 2009 at 6:54 PM by EisenbergEffect, version 4