Open strajk- opened 5 months ago
Hi I'm an AI powered bot that finds similar issues based off the issue title.
Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!
Note: You can give me feedback by thumbs upping or thumbs downing this comment.
I've created a repro project for this issue here: https://github.com/AceCoderLaura/MauiBugs/tree/master/ContentViewBug
I might create a repro for the binding scenario too if I get some time, but it's ultimately the same bug.
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
public ControlTemplate TypeTemplate { get => (ControlTemplate)GetValue(TypeTemplateProperty); set => SetValue(TypeTemplateProperty, value); }
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