We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
You can continue the conversation there. Go to discussion →
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
Unable to resolve property or method of name 'ClickCommand' on type 'AvaloniaApplication2.ViewModels.MainViewModel'.
I start new Avalonia App as it is just add one more property and one command to test.
here is the code
<UserControl.DataContext> <vm:MainViewModel /> </UserControl.DataContext>
public partial class MainViewModel : ViewModelBase { public MainViewModel() { ButtonTitle = "Click me"; } private int count = 0;
[ObservableProperty] private string _greeting = "Welcome to Avalonia!"; [ObservableProperty] private string _buttonTitle ; [RelayCommand] public void Click() { count++; if (count == 1) { ButtonTitle = $"You Clicked Me {count} Time"; return; } ButtonTitle = $"You Clicked Me {count} Times"; }
}
just start new project and add the property and the command
No response
11.0.2
The text was updated successfully, but these errors were encountered:
This almost certainly isn't a bug and should be moved to discussions.
But what XAML are you using? Particularly, the entirety of your <Button ... />
<Button ... />
Sorry, something went wrong.
I am guessing this is a casting problem. In which case you can either cast to your view model type or use reflection binding.
https://docs.avaloniaui.net/docs/basics/data/data-binding/compiled-bindings#type-casting
No branches or pull requests
Describe the bug
Unable to resolve property or method of name 'ClickCommand' on type 'AvaloniaApplication2.ViewModels.MainViewModel'.
I start new Avalonia App as it is just add one more property and one command to test.
here is the code
<UserControl.DataContext>
<vm:MainViewModel />
</UserControl.DataContext>
public partial class MainViewModel : ViewModelBase
{
public MainViewModel()
{
ButtonTitle = "Click me";
}
private int count = 0;
}
To Reproduce
just start new project and add the property and the command
Expected behavior
No response
Avalonia version
11.0.2
OS
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: