xamarin/Xamarin.Forms

The order of 'IsEnabled' and 'Command' should not matter

オープン

#2,758 opened on 2018/05/17

 (24 件のコメント) (18 件のリアクション) (0 人の担当者)C# (1,926 件のフォーク)batch import
breakinge/5 :clock5:help wantedm/high impact :black_large_square:p/0t/bug :bug:up-for-grabs

Repository metrics

Stars
 (5,644 個のスター)
PR merge metrics
 (30d に merged PR はありません)

説明

Description

I have two buttons:

<Button
    Text="Button1"
    Command="{Binding TheCommand}"
    IsEnabled="False" />

<Button
    Text="Button2"
    IsEnabled="False"
    Command="{Binding TheCommand}" />

For some reason, the IsEnabled property is overwritten in Button2 - this enables the button incorrectly.

Button1 is disabled this way, but when I trigger TheCommand.ChangeCanExecute(), the button enables.

Expected Behavior

Both buttons stay disabled.

The matrix of this should be an && operation:

TheCommand.CanExecute() IsEnabled Final State
True True Enabled
True False Disabled
False True Disabled
False False Disabled

Actual Behavior

The button with the command applied later overwrites the enabled state.

Basic Information

  • Version with issue: 2.5.x and 3.0
  • Last known good version: unsure
  • IDE: VS2017
  • Platform Target Frameworks: all

コントリビューターガイド