ItemsPanelTemplate
doesn't support AoT-safe binding
#10069
Replies: 1 comment
-
Transferred to an issue #10070 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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?Beta Was this translation helpful? Give feedback.
All reactions