-
Notifications
You must be signed in to change notification settings - Fork 742
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
[Android] Update/Binding on BitmapImage does not update parent ImageBrush #7288
Comments
@iury-kc Probably related/similar to the other bug you're working on .You should take a look after. |
Hi @queequac ! Do you mind to give more details about your issue? I tried to reproduce the scenario, however, it doesn`t work with UWP also. |
@iury-kc In my case it works like a charme and I am using this under UWP even in production.😅 Create a new blank UWP project (e.g. with Visual Studio 2022) and modify only the MainPage.xaml
MainPage.xaml.cs
Click the button at the bottom and it switches the narcis to the blue rose. |
GitHub Issue (If applicable): closes #11673, closes #7288, closes #9533 <!-- Link to relevant GitHub issue if applicable. All PRs should be associated with an issue (GitHub issue or internal), unless the change is documentation related. --> ## PR Type What kind of change does this PR introduce? <!-- Please uncomment one or more that apply to this PR - Bugfix - Feature - Code style update (formatting) - Refactoring (no functional changes, no api changes) - Build or CI related changes - Documentation content changes - Project automation - Other... Please describe: --> ## What is the current behavior? <!-- Please describe the current behavior that you are modifying, or link to a relevant issue. --> ## What is the new behavior? <!-- Please describe the new behavior after your modifications. --> ## PR Checklist Please check if your PR fulfills the following requirements: - [ ] Docs have been added/updated which fit [documentation template](https://github.com/unoplatform/uno/blob/master/doc/.feature-template.md) (for bug fixes / features) - [ ] [Unit Tests and/or UI Tests](https://github.com/unoplatform/uno/blob/master/doc/articles/uno-development/working-with-the-samples-apps.md) for the changes have been added (for bug fixes / features) (if applicable) - [ ] Validated PR `Screenshots Compare Test Run` results. - [ ] Contains **NO** breaking changes - [ ] Associated with an issue (GitHub or internal) and uses the [automatic close keywords](https://help.github.com/en/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue). - [ ] Commits must be following the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/#summary) specification. <!-- If this PR contains a breaking change, please describe the impact and migration path for existing applications below. Please note that breaking changes are likely to be rejected --> ## Other information <!-- Please provide any additional information if necessary --> Internal Issue (If applicable): <!-- Link to relevant internal issue if applicable. All PRs should be associated with an issue (GitHub issue or internal) -->
Current behavior
When using a BitmapImage as ImageSource for a ImageBrush, updates on the BitmapImage are not triggering updates on the brush.
Sample:
In the sample above, the UriSource is bound against a property of type Uri. Whenever the uri changes, the new image shall be loaded and the content of the ImageBrush should change.
While this works as expected under Windows, on Android only the initial BitmapImage will be created and any further change (via binding or set programmatically) will be ignored.
Obviously the ImageBrush does not realize the actual instance of its BitmapImage changed.
Expected behavior
Should behave like under Windows. Any change to the BitmapImage (e.g. by modifying the UriSource property) should also be reflected by the ImageBrush using the BitmapImage as its ImageSource.
How to reproduce it (as minimally and precisely as possible)
Use the snippet above and bind against a DependencyProperty. Switching the uri will change the image under Windows, while it will be created under Android once and not change afterwards.
Workaround
Instead of modifying the BitmapImage, under Android the ImageSource has to be set explicitly.
In my case I added code-behind:
Explicitly setting the ImageSource as a whole will make the ImageBrush realize that something on the underlying BitmapImage object changed.
Works on UWP/WinUI
Yes
Environment
Uno.UI / Uno.UI.WebAssembly / Uno.UI.Skia
NuGet package version(s)
Uno.UI version 3.10.11
Affected platforms
Android
IDE
Visual Studio 2019
IDE version
16.11.4
Relevant plugins
No response
Anything else we need to know?
No response
The text was updated successfully, but these errors were encountered: