✅ Help with Avalonia Templated Controls
I am currently working on a templated control for a sliding button.
I, however, get an error for the binding of the Click Event to the Method SwitchStates saying that it is unable to find a suitable getter or setter.
Do you have to bind differently? I cant use Command, as this is something I want to make accessible from the outside.
6 Replies
Here the Button XAML
This is the relevant Code behind of the Templated Control.
The other Styled Properties are tied to the IsOn property.
There's already a control for this. It's called
ToggleSwitch
. Not sure if it was on 0.10.x or if it's 11-preview.<ToggleSwitch Content="Testing" />
It exists in 0.10.21
Oh right. Didn't know that. Thanks!