-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Open
Labels
s/triagedIssue has been reviewedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering TriageVerified / Reproducible Issue ready for Engineering TriagexsgXaml sourceGenXaml sourceGen
Description
Note
Are you waiting for the changes in this issue to be resolved?
Please check for existing PRs addressing this issue and test them if available.
Description
XSG fails to parse RelativeSource bindings when used with AncestorType but without an explicit Mode property. It parses the mode as '(none)' which is invalid.
Reproduction
<SwipeItem Command="{Binding Source={RelativeSource AncestorType={x:Type vm:MyViewModel}}, Path=MyCommand}" />Error:
error MAUIG1001: An error occured while parsing Xaml: Invalid RelativeSource Mode '(none)'.
Expected Behavior
When Mode is not specified but AncestorType is, the mode should default to FindAncestor (as it does at runtime).
Affected File
src/Controls/samples/Controls.Sample/Pages/Controls/SwipeViewGalleries/SwipeViewBindingContextGallery.xaml
Workaround
Use Inflator="Runtime" for the affected XAML file, or explicitly specify Mode=FindAncestor.
Context
Discovered while testing XSG fixes for #33524.
Metadata
Metadata
Assignees
Labels
s/triagedIssue has been reviewedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering TriageVerified / Reproducible Issue ready for Engineering TriagexsgXaml sourceGenXaml sourceGen