Changing Button's HitTestMode from within a WhileFalse trigger doesn't work

I have a basic scenario:

<Basic.Button ux:Name="button" Text="Button"" HitTestMode="LocalBounds" Opacity="1" Clicked="{doSomething}"/>
<WhileFalse Value="{isButtonEnabled}">
  <Change button.Opacity="0.5" Duration="0.2" Delay="0" />
  <Change button.HitTestMode="None" Duration="0" Delay="0" DurationBack="0" DelayBack="0" />
</WhileFalse>

Starting with isButtonEnabled.value=false; and then toggling this Observable opacity changes as expected but its HitTestMode property doesn’t change, or at least the button remains unclickable.

Any idea what am I doing wrong?

Does it happen with Duration and DurationBack set to a value larger than 0?

On a sidenote, if you want to instantly set the HitTestMode when your bool changes I would recommend this approach instead:

<WhileFalse Value="{isButtonEnabled}">
    <Set button.HitTestMode="None" />
</WhileFalse>
<WhileTrue Value="{isButtonEnabled}">
    <Set button.HitTestMode="LocalBoundsAndChildren" />
</WhileTrue>

Hey,

The way I usually do this is by actually changing button.Visibility="Collapsed" so that you can’t touch it and then button.Visibility="Visible" so that you can.

@vegard: I tried every combination without luck and I observed the following behaviour: as this is a part of a Page, the button becomes touchable if I navigate back and forth once. Then, disabling and enabling the Button works as it should. The isButtonEnabled is an observable function returning boolean, probably it makes a difference. Probably changing a Basic.Button's HitTestMode interferes with the default sytle settings.

@fudge: thanks for your reply, Visibility works indeed, however I need to change HitTestMode in this case:)