[BUG] Image tint color behavior doesn't get applied from DynamicResource or ViewModel
See original GitHub issueIs there an existing issue for this?
- I have searched the existing issues
Current Behavior
On setting the IconTintColorBehavior
in Image, the TintColor
property is working on setting colors directly or by any StaticResource.
But it isn’t working when setting the TintColor
as DynamicResource or a binding property from ViewModel.
Expected Behavior
<Image HeightRequest="30" WidthRequest="30" Source="ic_notification"> <Image.Behaviors> <toolkit:IconTintColorBehavior TintColor="{Binding ChangedColor}" /> </Image.Behaviors> </Image>
This should also work like it was working in XF with the Effects.
Steps To Reproduce
- Open and run the solution from reproduction repository
- Click the change button & see there is no effect.
Link to public reproduction project repository
https://github.com/hemantbeast/StatusBarSample/tree/tint_color
Environment
- .NET MAUI CommunityToolkit: 3.0.0
- OS: Mac OS 13.0.1
- .NET MAUI: 7.0
Anything else?
No response
Issue Analytics
- State:
- Created 10 months ago
- Comments:9 (2 by maintainers)
Top Results From Across the Web
[BUG] IconTintColorBehavior to change TintColor at ...
Using .Net Maui Community Toolkit to change the TintColor at runtime. DynamicResource is not working. Expected Behavior. DynamicResource works ...
Read more >Using Tint color on UIImageView - ios
I would like to paint it over the image with a tint color but it doesn't work. So far I have: - (id)initWithFrame:(CGRect)frame...
Read more >Bug - Transitions breaks background-color and image tint ...
I encountered this bug after upgrading from 2022.1.22f1 to 2022.2.1f1, here's how to reproduce it: Create a simple UXML view, like this one:...
Read more >IconTintColorBehavior - .NET MAUI Community Toolkit
The IconTintColorBehavior is a behavior allows you to tint an image.
Read more >Tint color not working in IOS storyboard designer.
I am having trouble getting the tint color to work in the storyboard designer. I added an image (icon) to my assets and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I tried this,
and it caused System.InvalidOperationException: ‘Operation is not valid due to the current state of the object.’
Perhaps the developer should provide us, the dummies with some sample in the documentation?
Thanks @pictos!
Could you do us a favor and update our Community Toolkit docs to add this info? I know it’s a bit repetitive since the .NET MAUI docs already document it, but I imagine we’ll continue to get Issues + Discussions opened around this topic if we don’t.
I think the best way for us to implement this information in every
Behavior
doc is to add a new file,communitytoolkit-behavior.md
, to theincludes/
folder, similar to how we createdcommunitytoolkit-converter.md
to describe common functionality included in all converters.Once
includes/communitytoolkit-behavior.md
is created with this binding information included, then we can add it to each*-behavior.md
doc file, similar to how we include the snippet fromcommunitytoolkit-converter.md
in each Converter doc.Once it’s documented, let’s close this Issue.