Opening up a NavigationPage with a child having ToolBarItems specified only shows icons if they are used elsewhere on the page (for example in an IconButton). For example if you use the XAML below on Windows the X and Z icons show up, but Y does not (all 3 show up on Android).
Compile and run it on Android and Windows, you should get the result illustrated below.
Note the missing 'Y' icon in the tool bar on the Windows version.
Version with bug
Preview 14 (current)
Last version that worked well
Unknown/Other
Affected platforms
Windows, I was not able test on other platforms
Affected platform versions
Windows 10
Did you find any workaround?
Yes, it turns out the icon shows up if it is declared on the page - it does not need to actually be shown, so you can set IsVisible false on the item that uses the Icon on the page and the icon will still show in the tool bar.
Verified the issue on Windows and Android, it's repro on windows Main 17.2.0 preview 2.0 32222.408.main, not repro on android 12 - API31. Repro Project:
MAUIToolBar.zip
Description
Opening up a NavigationPage with a child having ToolBarItems specified only shows icons if they are used elsewhere on the page (for example in an IconButton). For example if you use the XAML below on Windows the X and Z icons show up, but Y does not (all 3 show up on Android).
If you uncomment the 'Y' Imagebutton, the 'Y' icon will show up in the toolbar.
Steps to Reproduce
Version with bug
Preview 14 (current)
Last version that worked well
Unknown/Other
Affected platforms
Windows, I was not able test on other platforms
Affected platform versions
Windows 10
Did you find any workaround?
Yes, it turns out the icon shows up if it is declared on the page - it does not need to actually be shown, so you can set IsVisible false on the item that uses the Icon on the page and the icon will still show in the tool bar.
Relevant log output
No response