-
I'm trying to setup an attached property. Following the example here: https://docs.avaloniaui.net/docs/next/guides/custom-controls/how-to-create-attached-properties, I'm able set a breakpoint & see when the AddClassHandler callback gets called. However, if I just change the property type in the example from ICommand to bool (and bind to a bool property in my ViewModal rather than an ICommand)...it stops working, and the callback is never called. I'm sure I'm doing something dumb, but I've simplified it as far as I possibly could & just can't get it to work. Here's the sample code (just simplified/renamed a bit). This works - I can set a breakpoint in HandlePropertyChanged that gets hit:
Xaml:
Where OpenFileCommand is just a random command in my ViewModel. However, if I simply change each ICommand to a bool above:
And in xaml, bind to a boolean property:
In my ViewModel:
Then HandlePropertyChanged never gets called. What am I missing? Any pointers would be greatly appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Beta Was this translation helpful? Give feedback.
HasMore
is false and thus the default value. So no change. If you set it to true, it should trigger.