Button disabled but I can click on it

EnricoRossiniEnricoRossini USMember ✭✭✭

Hi guys,
look at this code

<Button IsEnabled="false" Text="Click me" Command="{Binding NextCommand}">
    <Button.Triggers>
        <MultiTrigger TargetType="Button">
            <MultiTrigger.Conditions>
                <BindingCondition Binding="{Binding IsASelected}" Value="true" />
            </MultiTrigger.Conditions>
            <Setter Property="IsEnabled" Value="true" />
        </MultiTrigger>
    </Button.Triggers>
</Button>

In my point of view the button is disable and I can't click on it, but you can :(
My simple question is: why?

Answers

  • ClintStLaurentClintStLaurent USUniversity ✭✭✭✭✭

    Are you certain your binding doesn't evaluate to true?
    Put a breakpoint on the get of the property to confirm your BindingContext is good and you are even trying to get the property.
    Since you only have one condition try using a regular trigger instead of multi

  • EnricoRossiniEnricoRossini USMember ✭✭✭

    Yes, I'm sure.

Sign In or Register to comment.