ā Issue with NotifyCanExecuteChangedFor from MVVM CommunityTK
The problem occurs in my view model (Avalonia MVVM), I set a variable
and try to run my function
whenever the text in to box is changed, it never executes though. Anyone has an idea what the issue is?
This is how I use the binding in my xaml
27 Replies
Did you set the data-context for the view?
Other bindings work, so yeah
what UI framework is this?
Avalonia MVVM
Unknown Userā¢3y ago
Message Not Public
Sign In & Join Server To View
Notification is for properties not fields
In wpf atleast
Everything besides my function executing works, values update etc, so notification isnt the issue
Unknown Userā¢3y ago
Message Not Public
Sign In & Join Server To View
And how do I get that?
Unknown Userā¢3y ago
Message Not Public
Sign In & Join Server To View
not there for me, do I have to put it into the constructor or something? Just typing it in the class doesnt work for me, although the object exists
Unknown Userā¢3y ago
Message Not Public
Sign In & Join Server To View
I set the var to private, didnt change anything
Unknown Userā¢3y ago
Message Not Public
Sign In & Join Server To View
partial
Unknown Userā¢3y ago
Message Not Public
Sign In & Join Server To View
It inherits from ObservableObject
Unknown Userā¢3y ago
Message Not Public
Sign In & Join Server To View
Oh, it needed partial void
Unknown Userā¢3y ago
Message Not Public
Sign In & Join Server To View
That finally fixed it, wow, 2 hours wasted :( thank you a lot for helping me out!
Unknown Userā¢3y ago
Message Not Public
Sign In & Join Server To View
Yeah, I would have never guessed this, pretty weird way to go about this in my opinion...
Unknown Userā¢3y ago
Message Not Public
Sign In & Join Server To View
/cc @Sergio
You're confusing things
NotifyCanExecuteChangedFor
doesn't invoke your command
It just causes the command to signal its CanExecuteChanged
event š
This was in reply to this š
If you want to run code whenever that changes, just do:
šWas this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.