Skip to content
This repository was archived by the owner on May 1, 2024. It is now read-only.

[Bug] ToolbarItem icons no longer use bar text color on UWP #9162

Open
velocitysystems opened this issue Jan 11, 2020 · 5 comments
Open

[Bug] ToolbarItem icons no longer use bar text color on UWP #9162

velocitysystems opened this issue Jan 11, 2020 · 5 comments

Comments

@velocitysystems
Copy link

velocitysystems commented Jan 11, 2020

Description

ToolbarItem icons no longer use (or inherit) the BarTextColor property from the parent NavigationPage on UWP.

Note: Works fine in iOS, Android. Regressed on UWP in XF 4.3.991211.

Steps to Reproduce

  1. Create a new Xamarin.Forms template project with a UWP target (1903).
  2. Create a blank page inside a NavigationPage.
  3. Set the BarTextColor of the NavigationPage in code-behind or XAML.
  4. Add a ToolbarItem with an icon.
  5. Run the application.

Expected Behavior

The icon should be tinted to the color specified in the BarTextColor property.

Actual Behavior

The icon is not updated and remains it's original color.

Basic Information

  • Version with issue: 4.4.0.991477 (vLatest)
  • Last known good version: 4.3.0.947036
  • IDE: Microsoft Visual Studio 2019 Enterprise
  • Platform Target Frameworks:
    • UWP: Build 1903

Screenshots

XF 4.3.0.947036 or below.
Icon is tinted white.
Screenshot 2020-01-10 at 7 27 51 pm

XF 4.3.0.991211 and above (incl 4.40-sr2).
Icon is not tinted.
Screenshot 2020-01-10 at 7 30 08 pm

Previously on 16299
Previously when building for 16299, this is how the command bar used to look.
Notice how the icon is properly scaled and is in larger. This is a separate issue reported in #9042.
Screenshot 2020-01-10 at 7 26 38 pm

Reproduction Link

See attached sample projects:
ToolbarIconTint_4.2.910310_Ok.zip
ToolbarIconTint_4.3.991211_Bad.zip

@velocitysystems velocitysystems added s/unverified New report that has yet to be verified t/bug 🐛 labels Jan 11, 2020
@velocitysystems
Copy link
Author

Related to #9042.

@rmarinho rmarinho added i/regression p/UWP e/3 🕒 3 and removed s/unverified New report that has yet to be verified labels Jan 13, 2020
@velocitysystems
Copy link
Author

@samhouts @rmarinho This is due to the following changes made in Platform.cs in #8147:

Removed

button.SetBinding(AppBarButton.IconProperty, "IconImageSource", _imageSourceIconElementConverter);

Added

if (commandBar.IsDynamicOverflowEnabled && item.Order == ToolbarItemOrder.Secondary)
{
    button.SetBinding(AppBarButton.IconProperty, "IconImageSource", _imageSourceIconElementConverter);
}
else
{
    var img = new WImage();
    img.SetBinding(WImage.SourceProperty, "Value");
    img.SetBinding(WImage.DataContextProperty, "IconImageSource", _imageConverter);
    button.Content = img;
}

When setting the IconProperty on an AppBarButton, this also automatically applies the tint color from BarTextColor. With the change to dynamically setting the button content, this native behavior is lost.

@velocitysystems
Copy link
Author

@samhouts Just wanted to touch base on this issue as I see it is marked "Ready for Work". Since this is a noticeable regression, would there be any chance to get this one looked at soon? Thanks!

@samhouts samhouts added the 4.4.0 regression on 4.4.0 label May 1, 2020
@samhouts
Copy link
Member

samhouts commented May 1, 2020

This is on the backlog. I don't currently have an estimate of when we may begin work on this item, but we do prioritize regressions. Thank you for your patience!

@samhouts samhouts added this to the 5.0.0 milestone Aug 13, 2020
@samhouts samhouts removed this from the 5.0.0 milestone Nov 2, 2020
@mattclarkie
Copy link

This is on the backlog. I don't currently have an estimate of when we may begin work on this item, but we do prioritize regressions. Thank you for your patience!

Over a year later and and still no hope of a fix on the horizon

The biggest issue is not merely that the colours are incorrect but disabled icons are visually the same as enabled ones

image

Compared to the correct behaviour which would fade the icon
image

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants