Replies: 1 comment
-
twoway |
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
Uh oh!
There was an error while loading. Please reload this page.
-
I have recently used a ListBox-related function repeatedly in my project, so I encapsulated it as a TemplatedControl for easy reuse.
This is the sample code I wrote. For convenience, I deleted all the extra ones and only kept the ListBox related ones.
TemplatedControl
XAML:
Code-Behind
ViewModel:
View
XAML:
Code-Behind:
For your convenience, I have packaged the source code of the entire example project.
AvaloniaApplication2.zip
After the program runs, there are no errors. But if you add a breakpoint to the Set method of CurrentTheme in ViewModel, you will find that it is not triggered at all.
In other words, the value of CurrentTheme in ViewModel will not change at all. What is the reason for this?
Beta Was this translation helpful? Give feedback.
All reactions