Can't use mvvm to bind #15773
Unanswered
MarkoShenodaa
asked this question in
Q&A
Replies: 2 comments
-
This almost certainly isn't a bug and should be moved to discussions. But what XAML are you using? Particularly, the entirety of your |
Beta Was this translation helpful? Give feedback.
0 replies
-
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 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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
Beta Was this translation helpful? Give feedback.
All reactions