Reputation: 312
I have this TextBox
that is disabled when a CheckBox
is ticked, using a binding on IsEnabled
. This works fine on its own.
<TextBox Text="{MyValue}" IsEnabled="{Binding CheckBoxTicked}" />
<CheckBox IsChecked="{Binding CheckBoxTicked, Converter={StaticResource BoolInverterConverter}}" />
I want to add a LostFocus
event to this TextBox
that will check if the value is correct using a command in the ViewModel
.
<i:Interaction.Triggers>
<i:EventTrigger EventName="LostFocus">
<prism:InvokeCommandAction Command="{Binding LostFocusCommand}" />
</i:EventTrigger>
</i:Interaction.Triggers>
This works too, but the IsEnabled
binding gets broken when the trigger is added and the TextBox
no longer reacts to the ticking of the CheckBox
.
Things I tried :
IsEnabled
to False
, the TextBox
is correctly disabled.InvokeCommandAction
binding to an incorrect command name, the binding to the CheckBox
works again.Upvotes: 1
Views: 336
Reputation: 169400
Try to remove the converter or replace <prism:InvokeCommandAction ... />
with <i:InvokeCommandAction ... />
. Then it should work.
Upvotes: 5