Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ClearCommand not found #852

Open
TheR7angelo opened this issue Feb 11, 2025 · 0 comments
Open

ClearCommand not found #852

TheR7angelo opened this issue Feb 11, 2025 · 0 comments
Assignees
Labels
bug Something isn't working input-field-group
Milestone

Comments

@TheR7angelo
Copy link

In version 2.11.0 I can't use the clear button inside a textfield.

            <material:TextField Grid.Row="0" Grid.Column="0"
                                Title="{Binding PlaceholderText, Mode=OneWay}"
                                Text="{Binding EntryText, Mode=TwoWay}"
                                AllowClear="True"
                                ClearButtonVisibility="WhileEditing"
                                MaxLength="{Binding MaxLenght, Mode=OneWay}">
            </material:TextField>

The clear button do no work and when I want to use the ClearCommandto create manualy I got this error

            <material:TextField Grid.Row="0" Grid.Column="0"
                                Title="{Binding PlaceholderText, Mode=OneWay}"
                                Text="{Binding EntryText, Mode=TwoWay}"
                                AllowClear="True"
                                ClearButtonVisibility="WhileEditing"
                                MaxLength="{Binding MaxLenght, Mode=OneWay}"
                                ClearCommand="{Binding ClearCommand, Source={Reference This}}">
            </material:TextField> 
 public ICommand ClearCommand { get; }

    public CustomPopupEditCategory()
    {
        ClearCommand = new Command<object>(OnClear);

        InitializeComponent();
    }

    private void OnClear(object obj)
    {
        if (obj is TextField textField)
        {
            textField.Text = string.Empty;
        }
    }

CustomPopupEditCategory.xaml(44, 33): [XC0009] No property, BindableProperty, or event found for "ClearCommand", or mismatching type between value and property.

@enisn enisn added bug Something isn't working input-field-group labels Feb 18, 2025
@enisn enisn self-assigned this Feb 18, 2025
@enisn enisn added this to the v2.11 milestone Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working input-field-group
Projects
None yet
Development

No branches or pull requests

2 participants