ItemsPanelTemplate
doesn't support AoT-safe binding
#10070
Labels
needs-triage
Issue needs to be triaged by the area owners
We are encountering issues when trying to bind properties within an
ItemsPanelTemplate
. Currently, we have this code in our project:This will crash at runtime when compiled under NativeAoT for both the WindowsAppSDK and UWP with modern .NET.
Removing the binding on the
ItemsPanelTemplate
fixes the issue, as shown in the image below:Unfortunately, we cannot use
x:Bind
here because it results in the following error:Neither a
DataTemplate
nor its accompanyingx:DataType
can be added here sinceItemsPanelTemplate
is already a template and must have a first child of typePanel
.Looking through documentation for 'official' examples of binding properties on an
ItemsPanelTemplate
, I'm not finding any where these properties are bound, whether using{Binding}
,{x:Bind}
, or{TemplateBinding}
.Using
{Binding}
worked before, but it's not AoT safe andx:Bind
doesn't seem to be compatible. What is the platform recommended approach here?The text was updated successfully, but these errors were encountered: