-
Notifications
You must be signed in to change notification settings - Fork 2k
Setter.TargetName + ControlTemplate crash #26977
Copy link
Copy link
Labels
area-xamlXAML, CSS, Triggers, BehaviorsXAML, CSS, Triggers, Behaviorspartner/syncfusionIssues / PR's with Syncfusion collaborationIssues / PR's with Syncfusion collaborationplatform/androids/triagedIssue has been reviewedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering TriageVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't workingSomething isn't working
Milestone
Metadata
Metadata
Assignees
Labels
area-xamlXAML, CSS, Triggers, BehaviorsXAML, CSS, Triggers, Behaviorspartner/syncfusionIssues / PR's with Syncfusion collaborationIssues / PR's with Syncfusion collaborationplatform/androids/triagedIssue has been reviewedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering TriageVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't workingSomething isn't working
Type
Fields
Give feedbackNo fields configured for issues without a type.
Description
I have a simple
ContentPagewithVerticalStackLayout. Within that I have aVisualStateand aSetterwithTargetNameto modify a property on a specificLabelcontrol. After activating theVisualState, the label text and bg color should change. This works fine as long as I don't setContentPage.ControlTemplateproperty.Once I set
ControlTemplateproperty, I'm gettingXamlParseException: Cannot resolve 'TargetLabel' as Setter Target for 'Microsoft.Maui.Controls.VerticalStackLayout'.The problem doesn't occur if I comment out
ControlTemplate[MauiApp5TargetName.zip](https://github.com/user-attachments/files/18331679/MauiApp5TargetName.zip)block.For me this effectively blocks me from using
TargetNameanywhere in our app, as we use an implicit style for all pages that setsControlTemplateproperty.Steps to Reproduce
XamlParseException: Cannot resolve 'TargetLabel' as Setter Target for 'Microsoft.Maui.Controls.VerticalStackLayout'.MainPage.ControlTemplateproperty blockLink to public reproduction project repository
MauiApp5TargetName.zip
Version with bug
9.0.10 SR1
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
Android 34
Did you find any workaround?
No response
Relevant log output