Skip to content

SetCommand() messes up with UI controls IsEnabled property #447

@TimofeyBurak

Description

@TimofeyBurak

Description

SetCommand() extension methods manipulate with Enabled/IsEnabled properties of UI elements (whenever possible), which makes it impossible to. properly control Enabled state (with bindings, for. example)

Steps to Reproduce

  1. Set command to a button (button.SetCommand(ViewModel.TestCommand))
  2. Add binding to enabled property (this.Bind(() => ViewModel.IsEnabled, () => button.Enabled) where ViewModel.IsEnabled == false)

Expected Behavior

Button should be disabled

Actual Behavior

Button could still be enabled

Possible Fix

SetCommand should not manipulate Enabled state of the UI elements by default. Maybe it could be an additional feature, possibility to bind to ICommand.CanExecute()

Basic Information

  • Version with issue: 4f060ee
  • Affected Platforms: iOS, Android

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions