ControlTemplate not propagating the BindingContext correctly if set through Binding #22607
Labels
area-layout
StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter
area-xaml
XAML, CSS, Triggers, Behaviors
platform/android 🤖
t/bug
Something isn't working
Milestone
Description
It's a repeat of the Issue #12470 that was supposedly fixed with the Pull #12536 except in my case the propagation doesn't seem to work correctly if the ControlTemplate is set through Binding.
Steps to Reproduce
Link to public reproduction project repository
No response
Version with bug
8.0.10 SR3
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
Android, I was not able test on other platforms
Affected platform versions
API 34 (Android 14.0) - Didn't test others
Did you find any workaround?
Adding the BindingContext on the Control that's defined inside the ControlTemplate to "renew" the BindingContext fixes it.
It also works if I were to set the ControlTemplate as a StaticResource like this:
But that defeats the purpose of being able to dynamically switch between ControlTemplates without extra C# code.
Relevant log output
No response
The text was updated successfully, but these errors were encountered: