Description
XAML Source Generator (XSG) may not correctly handle edge-case type conversions such as Padding="NaN".
Reproduction
<Button
Text="Button"
HorizontalOptions="Start"
Background="LightGray"
Padding="NaN"/>
This uses NaN as a special value for the Thickness type converter to indicate "use default/unset padding".
Affected File
src/Controls/samples/Controls.Sample/Pages/Controls/ButtonPage.xaml
Additional Context
The same file also uses a custom converter with string-to-color conversion:
<converters:BoolToCustomValueConverter
x:Key="BoolToColorConverter"
ValueIfTrue="Green"
ValueIfFalse="Red"/>
This may also be related to the parsing issue.
Workaround
Use Inflator="Runtime" for the affected XAML file.
Context
Discovered while enabling XSG on more projects in #33524.
Description
XAML Source Generator (XSG) may not correctly handle edge-case type conversions such as
Padding="NaN".Reproduction
This uses
NaNas a special value for theThicknesstype converter to indicate "use default/unset padding".Affected File
src/Controls/samples/Controls.Sample/Pages/Controls/ButtonPage.xamlAdditional Context
The same file also uses a custom converter with string-to-color conversion:
This may also be related to the parsing issue.
Workaround
Use
Inflator="Runtime"for the affected XAML file.Context
Discovered while enabling XSG on more projects in #33524.