Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AnnotatedScrollBarLabel does not work with AOT #10188

Open
Marv51 opened this issue Nov 20, 2024 · 0 comments
Open

AnnotatedScrollBarLabel does not work with AOT #10188

Marv51 opened this issue Nov 20, 2024 · 0 comments
Labels
bug Something isn't working needs-triage Issue needs to be triaged by the area owners

Comments

@Marv51
Copy link
Contributor

Marv51 commented Nov 20, 2024

Describe the bug

Code using an AnnotatedScrollBar does not work with PublishAOT.

My page contains a <AnnotatedScrollBar Name="annotatedScrollBar" />. At runtime an exception will be thrown when something is added to the label collection.

Exception:

System.NotSupportedException: 'ICustomProperty support used by XAML binding for type 
'Microsoft.UI.Xaml.Controls.AnnotatedScrollBarLabel' (property 'Content') requires the type to marked with
'WinRT.GeneratedBindableCustomPropertyAttribute'. If this is a built-in type or a type that can't be marked, 
a wrapper type should be used around it that is marked to enable this support.'

Code snippet to add label:

annotatedScrollBar.Labels.Add(new AnnotatedScrollBarLabel("MyLabel", 200));

Labels is an IList<AnnotatedScrollBarLabel> and AnnotatedScrollBarLabel is sealed, so I think there is nothing I can do to make this work with AOT enabled.

Expected behavior

It should work, just like it does without AOT compilation.

NuGet package version

WinUI 3 - Windows App SDK 1.6.3: 1.6.241114003

Windows version

Windows 11 (24H2): Build 26100

Additional context

It works without AOT and the exception above is thrown with PublishAOT enabled.

@Marv51 Marv51 added the bug Something isn't working label Nov 20, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the needs-triage Issue needs to be triaged by the area owners label Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-triage Issue needs to be triaged by the area owners
Projects
None yet
Development

No branches or pull requests

1 participant