ActionMessage ignoring Guard Clause

Oct 13, 2010 at 8:27 AM

We have used a custom KeyEventTrigger inspired by one of the older discussions on this site to allow users to press Enter in some text boxes as an alternative to explicitly pressing the button aligned next to it.

<i:Interaction.Triggers>
	<local:KeyPressTrigger KeyEvent="KeyUp" TriggerValue="Enter">
		<cal:ActionMessage MethodName="Search"/>
	</local:KeyPressTrigger>
</i:Interaction.Triggers>

However, this button is not enabled until all three text boxes have a valid value. This is handled by the VM's CanSearch property.

Unfortunately, the above ActionMessage causes the actual TextBox to get disabled as long as CanSearch is disabled.

Is there a way to overrule that behavior?