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

[BUG] Windows IconTintColorBehavior Navigate away and then back to a page and the tint is removed #1595

Open
2 tasks done
SamuelJames101 opened this issue Dec 8, 2023 · 7 comments · May be fixed by #2077
Open
2 tasks done
Labels
area/behaviors Issue/Discussion/PR that has to do with Behaviors bug Something isn't working

Comments

@SamuelJames101
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Did you read the "Reporting a bug" section on Contributing file?

Current Behavior

Navigating away from a page which has an image and a tint, and then back to removes a the tint

Expected Behavior

The tint remains

Steps To Reproduce

1.Have a page with an image with a tint
2.Navigate to a second page
3.Navigate back to the first page

Screen.Recording.2023-12-08.at.16.09.43.mov

Link to public reproduction project repository

https://github.com/SamuelJames101/IconTintColourWindowsIssue

Environment

- .NET MAUI CommunityToolkit: 7.0.0
- OS: Windows 11 22H2
- .NET MAUI: Net8 GA

Anything else?

No response

@SamuelJames101 SamuelJames101 added bug Something isn't working unverified labels Dec 8, 2023
@vhugogarcia vhugogarcia added the area/behaviors Issue/Discussion/PR that has to do with Behaviors label Dec 8, 2023
@vhugogarcia
Copy link
Contributor

Thanks @SamuelJames101 for reporting the issue. I have verified the issue.

@SamuelJames101
Copy link
Author

@vhugogarcia I have created a fix in my code but I have a question, why do we remove the tint when we un-attach the behaviour? As that is where the issue lies, if we don't remove the tint but instead make sure the view (the image with the attached behaviour) only has one IconTintBehaviour at any given time then that resolved it for me.

@gsgou
Copy link

gsgou commented Feb 13, 2024

@SamuelJames101 can you attach your workaround?
@vhugogarcia is this scheduled any time soon for a fix?

@RuddyOne
Copy link

RuddyOne commented Apr 2, 2024

Also having this issue, ETA on a fix?

@SamuelJames101 Would also like to see your workaround if possible.

@bijington
Copy link
Contributor

I think it he fix for this is to apply a similar approach to how StatusBarBehavior works - allowing a developer to define when the behavior is applied and make the default do it in OnNavigatedTo.

I'm away for just over a week but happy to look at this when I return if there isn't any progress.

@sbloom82
Copy link

sbloom82 commented Apr 29, 2024

I am also running into this issue on windows. The first time the view is displayed it works fine, but navigating back to the view results in no tint. Hopefully a fix is coming in the near future.

The work around that I am using requires re-setting of the image's source in the view's Loaded event.

private IconTintColorBehavior myIconTint = new();

private void MyView_Loaded(object sender, EventArgs e)
{
     if (myImage.Behaviors.Contains(myIconTint))
     {
         var source = myImage.Source;
         myImage.Source = null;
         myImage.Source = source;
     }
     else
     {
         myImage.Behaviors.Add(myIconTint);
     }
}

@myix765 myix765 linked a pull request Jul 31, 2024 that will close this issue
6 tasks
@RuddyOne
Copy link

RuddyOne commented Aug 9, 2024

Any progress on this? Or a way to overwrite all images to fix this for now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/behaviors Issue/Discussion/PR that has to do with Behaviors bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants