Shell.MenuItemTemplate Sometime Does Not Work
Description
In a release buil a Shell.MenuItemTemplate which includes x:DataType="MenuItem" does not work correctly (the binding to the Text property does not seem to work).
For example:
<Shell.MenuItemTemplate>
<DataTemplate>
<ContentView>
<Label Text="{Binding Text}"
x:DataType="MenuItem"
/>
</ContentView>
</DataTemplate>
</Shell.MenuItemTemplate>
Will produce a blank line in a release build on Windows but correctly show the MenuItem Text property in a debug build.
Steps to Reproduce
- Download the repository
- Create and run a Debug build, you should see this:
- Repeat with a Release Build and the MenuItem lines will be blank.
Link to public reproduction project repository
https://github.com/david-maw/ShellTemplate.git
Version with bug
8.0.7 SR2
Is this a regression from previous behavior?
Yes, this used to work in .NET MAUI
Last version that worked well
Unknown/Other
Affected platforms
Android, Windows, I was not able test on other platforms
Affected platform versions
Windows 11
Did you find any workaround?
Delete the x:DataType="MenuItem" and it works in both release and debug builds.
Relevant log output
No response
Verified on VS 17.10.0 Preview 4.0(8.0.20). Repro on Windows 11, Android 14.0-API34 with below Project: ShellTemplate.zip
Windows:
Android:
@XamlTest can you verify if this works in .NET7?
And based on that set if this is a regression or not?
The issue is no longer reproducible after the Net10 update (v10.0.11).
Download .NET claims the latest version is 10.0.1, so while I'd be happy to try the latest version, I'm not sure where to get 10.0.11, am I missing something?