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

[Bug] DynamicResource not updated #14381

Open
MattePozzy opened this issue Jun 30, 2021 · 2 comments
Open

[Bug] DynamicResource not updated #14381

MattePozzy opened this issue Jun 30, 2021 · 2 comments
Assignees
Labels
a/Xaml </> s/unverified New report that has yet to be verified t/bug 🐛
Projects

Comments

@MattePozzy
Copy link

MattePozzy commented Jun 30, 2021

Description

Hi,

in our application we have some global x:Boolean DynamicResource that we use to show\hide some buttons along all the application.

We have updated from XF 4.8.0.1560 to 5.0.0.2012 and that DynamicResource doesn't update the UI anymore.
The value changes correctly but the UI value not changes.

The issue is present from the XF version 5.0.0.1931.
Up to version 5.0.0.1905 works fine.

I'm using the same verision of Xamarin.Essentials.

Steps to Reproduce

  1. add a x:Boolean resource to the resourceDictionary in App.xaml
    ex. <x:Boolean x:Key="MostraMenuDettaglioWo">False</x:Boolean>
  2. add a Button with a command that get and change the resource
    ex:
    bool actual = (bool)Application.Current.Resources["MostraMenuDettaglioWo"]; Device.BeginInvokeOnMainThread(() => { Application.Current.Resources["MostraMenuDettaglioWo"] = !actual; });
  3. bind the resource to something in the XAML page
    ex to the text button:
    <Button BackgroundColor="Red" Command="{Binding TestCommand}" Text="{DynamicResource MostraMenuDettaglioWo}" />

EDIT:
This happens also with the latest version 5.0.0.2083 but only on iOS devices.

Expected Behavior

The value should be chage and also the UI value.

Actual Behavior

The value changes but not the UI value

Basic Information

  • Version with issue: 5.0.0.1931
  • Last known good version: 5.0.0.1905
  • Platform Target Frameworks:
    • iOS: tested on emulator iPhone with iOS 14.5 and on physical iPhone with iOS 14.6
    • Android: tested on Galaxy S10 with Android 11

Environment

Show/Hide Visual Studio info
=== Visual Studio Community 2019 for Mac ===

Version 8.10.3 (build 15)
Installation UUID: fd0d6d0d-0b3e-40bd-8ca6-5c8026be0927
	GTK+ 2.24.23 (Raleigh theme)
	Xamarin.Mac 6.18.0.23 (d16-6 / 088c73638)

	Package version: 612000140

=== Mono Framework MDK ===

Runtime:
	Mono 6.12.0.140 (2020-02/51d876a041e) (64-bit)
	Package version: 612000140

=== Roslyn (Language Service) ===

3.10.0-4.21269.26+029847714208ebe49668667c60ea5b0a294e0fcb

=== NuGet ===

Version: 5.9.0.7134

=== .NET Core SDK ===

SDK: /usr/local/share/dotnet/sdk/5.0.301/Sdks
SDK Versions:
	5.0.301
	5.0.203
	5.0.202
	5.0.201
	5.0.103
	5.0.102
	5.0.101
	5.0.100
	3.1.410
	3.1.409
	3.1.408
	3.1.407
	3.1.406
	3.1.405
	3.1.404
	3.1.403
	3.1.402
	3.1.401
	3.1.302
	3.1.301
	3.1.300
	3.1.200
	3.1.102
	3.1.101
MSBuild SDKs: /Applications/Visual Studio.app/Contents/Resources/lib/monodevelop/bin/MSBuild/Current/bin/Sdks

=== .NET Core Runtime ===

Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
	5.0.7
	5.0.6
	5.0.5
	5.0.4
	5.0.3
	5.0.2
	5.0.1
	5.0.0
	3.1.16
	3.1.15
	3.1.14
	3.1.13
	3.1.12
	3.1.11
	3.1.10
	3.1.9
	3.1.8
	3.1.7
	3.1.6
	3.1.5
	3.1.4
	3.1.2
	3.1.1
	2.1.23
	2.1.22
	2.1.21
	2.1.20
	2.1.19
	2.1.18
	2.1.17
	2.1.16
	2.1.15

=== .NET Core 3.1 SDK ===

SDK: 3.1.410

=== Xamarin.Profiler ===

Version: 1.6.15.68
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Updater ===

Version: 11

=== Xamarin.Android ===

Version: 11.3.0.4 (Visual Studio Community)
Commit: xamarin-android/d16-10/ae14caf
Android SDK: /Users/pozzy/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		8.0 (API level 26)

SDK Tools Version: 26.1.1
SDK Platform Tools Version: 30.0.4
SDK Build Tools Version: 30.0.2

Build Information: 
Mono: b4a3858
Java.Interop: xamarin/java.interop/d16-10@f39db25
ProGuard: Guardsquare/proguard/v7.0.1@912d149
SQLite: xamarin/sqlite/3.35.4@85460d3
Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-10@c5732a0

=== Microsoft OpenJDK for Mobile ===

Java SDK: /Users/pozzy/Library/Developer/Xamarin/jdk/microsoft_dist_openjdk_1.8.0.25
1.8.0-25
Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Android SDK Manager ===

Version: 16.10.0.12
Hash: e240b8c
Branch: remotes/origin/d16-10
Build date: 2021-06-01 18:26:34 UTC

=== Android Device Manager ===

Version: 16.10.0.14
Hash: e340248
Branch: remotes/origin/d16-10
Build date: 2021-06-01 18:26:52 UTC

=== Xamarin Designer ===

Version: 16.10.0.119
Hash: 36a2d986f
Branch: remotes/origin/d16-10
Build date: 2021-06-02 19:41:34 UTC

=== Apple Developer Tools ===

Xcode 12.5.1 (18212)
Build 12E507

=== Xamarin.Mac ===

Xamarin.Mac not installed. Can't find /Library/Frameworks/Xamarin.Mac.framework/Versions/Current/Version.

=== Xamarin.iOS ===

Version: 14.20.0.10 (Visual Studio Community)
Hash: 0e35b2e0b
Branch: d16-10
Build date: 2021-06-03 18:45:46-0400

=== Build Information ===

Release ID: 810030015
Git revision: 9579bfad0898e06fdd77b8f4127bdcb5412a5b38
Build date: 2021-06-17 13:42:21-04
Build branch: release-8.10

=== Operating System ===

Mac OS X 10.16.0
Darwin 20.5.0 Darwin Kernel Version 20.5.0
    Sat May  8 05:10:33 PDT 2021
    root:xnu-7195.121.3~9/RELEASE_X86_64 x86_64


Screenshots

Download videos

@MattePozzy MattePozzy added s/unverified New report that has yet to be verified t/bug 🐛 labels Jun 30, 2021
@jsuarezruiz jsuarezruiz added this to New in Triage via automation Sep 3, 2021
@jsuarezruiz jsuarezruiz moved this from New to Needs Estimate in Triage Dec 13, 2021
@gjschoneveld
Copy link

Hi, We have the same problem. Also only on iOS and also since Xamarin Forms higher than 5.0.0.1905. On Android it works fine.

I have stripped down our app and attached it as example. The DynamicResource is used to set the background color in some places. It is set/changed when you login. The issue is that in our menu page the toolbar is not updated and also when you go back to the settings or login page, you still see the old color.

Steps:

  1. Start the app -> you go to the settings page with a blue background
  2. Press "Save" -> you go to the login page with a blue background
  3. Press "Login with Red theme" -> you go to the demo page with a red toolbar.
  4. Press "Menu" -> you go to the menu page with a red page but the toolbar is blue (= wrong; should be red)
  5. Press "Logout" -> you go to the login page again but the background is still blue (= wrong; should be red)

(the theme is saved; if you restart the app you will get your last theme)

DynamicResourceTest.zip

@gjschoneveld
Copy link

@jsuarezruiz Any news on this issue? We are now stuck to this old version of Xamarin Forms. It is so old that we cannot use Hot Reload anymore and we have to build our iOS version with an old version of Xcode on an old mac that still runs Big Sur.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a/Xaml </> s/unverified New report that has yet to be verified t/bug 🐛
Projects
Triage
  
Needs Estimate
Development

No branches or pull requests

4 participants