-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
XamlC XC0022 warning : Binding could be compiled if x:DataType is specified after upgrade to 8.0.7 #21288
Comments
Duplicate of #20568 |
Hi Shane,
I disagree that it is a duplicate of #20568<#20568>
I specified x:DataType at ContentPage level. But different to version 8.0.6 this definition is not inherited by the child objects.
<ContentPage
x:Class="MediaApp.Views.EpgPage"
xmlns=http://schemas.microsoft.com/dotnet/2021/maui
xmlns:x=http://schemas.microsoft.com/winfx/2009/xaml
xmlns:mc=http://schemas.openxmlformats.org/markup-compatibility/2006
xmlns:vm="clr-namespace:MediaApp.ViewModels"
x:DataType="vm:EpgViewModel">
<ContentPage.ToolbarItems>
<ToolbarItem Text="{Binding PrevText}" IconImageSource="previous.png" Command="{Binding PreviousCommand}" />
The problem is caused by the ToolBarItem object. A work around is to add x:DataType again in the ToolbarItem.
<ToolbarItem x:DataType="vm:EpgViewModel" Text="{Binding PrevText}" IconImageSource="previous.png" Command="{Binding PreviousCommand}" />
ToolBarItem does not inherit x:DataType which is not correct in my opinion.
Christian Riedl
Von: Shane Neuville ***@***.***>
Gesendet: Montag, 18. März 2024 21:31
An: dotnet/maui ***@***.***>
Cc: RTS Christian Riedl ***@***.***>; Author ***@***.***>
Betreff: Re: [dotnet/maui] XamlC XC0022 warning : Binding could be compiled if x:DataType is specified after upgrade to 8.0.7 (Issue #21288)
Duplicate of #20568<#20568>
—
Reply to this email directly, view it on GitHub<#21288 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAS3INAK3HPMLWYV4GKQCMDYY5FHPAVCNFSM6AAAAABE4I4RB6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMBUHEZDQNBZGE>.
You are receiving this because you authored the thread.Message ID: ***@***.******@***.***>>
|
@ChristianRiedl I could not reproduce the issue with the following minimal repro:
I'm not getting any warning. One more thing I noticed is that the warnings that you included refer to lines 19, 20, and 21. None of these lines are shown in the code snippet that you provided. Can you share a snippet that includes those lines? |
I tried to create a simple reproducer, but I was not able. Seems to depend on more things (community toolkit mvvm …)
After upgrading to latest 8.0.10 the problem disappeared. Please close it.
Christian Riedl
Von: dotnet-policy-service[bot] ***@***.***>
Gesendet: Dienstag, 19. März 2024 20:20
An: dotnet/maui ***@***.***>
Cc: RTS Christian Riedl ***@***.***>; Mention ***@***.***>
Betreff: Re: [dotnet/maui] XamlC XC0022 warning : Binding could be compiled if x:DataType is specified after upgrade to 8.0.7 (Issue #21288)
Hi @ChristianRiedl<https://github.com/ChristianRiedl>. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.
—
Reply to this email directly, view it on GitHub<#21288 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAS3INEZMOGOTQEG3M7HNQLYZCFWFAVCNFSM6AAAAABE4I4RB6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMBXHE2DSMBYGU>.
You are receiving this because you were mentioned.Message ID: ***@***.******@***.***>>
|
@ChristianRiedl thanks for testing this with the latest release of MAUI. It is likely that the original issue was fixed by #20742 |
Description
After upgrade to 8.0.7 I get a warning XC0022 and XAML is not compiled.
Steps to Reproduce
Create a ContentPage like (line with ToolbarItem produces the error) :
The text was updated successfully, but these errors were encountered: