-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Auto theme change doesn't behave as expected on .NET 7 whereas the same works fine on .NET 6 #11299
Comments
On an additional note, even on .NET 6, the auto theme change works only once. Then it doesn't respond. |
Hi @egvijayanand. We have added the "s/needs-repro" label to this issue, which indicates that we require steps and sample code to reproduce the issue before we can take further action. Please try to create a minimal sample project/solution or code samples which reproduce the issue, ideally as a GitHub repo that we can clone. See more details about creating repros here: https://github.com/dotnet/maui/blob/main/.github/repro.md This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time. |
Could be fixed by #11200 |
This issue is getting simulated with the default template itself, without requiring any changes. dotnet new maui -f net7.0 dotnet new maui -f net6.0 |
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process. |
@davidortinau Moving critical issues like this to the backlog defeats the whole purpose of reporting issues and the stability of the product becomes questionable. |
Yeah, I'm puzzled how this was overlooked in the release, I have been pounding my head against the wall for several days being sure it is something with my code, until I realized that even with a fresh template 6 works while 7 does not... |
Confirmed the I have to close and restart the app to get some colors to update, and at runtime some views update while others on the same screen do not. Simulator.Screen.Recording.-.iPhone.14.Pro.-.2022-12-05.at.15.09.27.mp4 |
I have this issue too. I think it solved in #11200 but still not migrated yet. |
Totally, 100% agree. Our business has gone all in on Xamarin in the last 4-5 years with two heavily used apps in production today (40k active installs) and Microsoft has us scared out of our skin with stuff like this! We're trying to port some of our internal libraries to MAUI as a test to see the viability of migrating from Xamarin due to the sorry state of Xamarin's support and on day 1 I've noticed that themed bindings nor the app theme callback is not being fired at all on the default template?! This is basic, basic stuff which should work out of the box in V1. Xamarin has been a mess for a while now, but the excuse in the last year or so has been lack of support due to MAUI, but obviously that excuse doesn't wash with MAUI itself. We're just barely clinging on to Xamarin/MAUI due to the fact that we have so much existing code invested in the ecosystem and our developers love C#, but it seems that with each month that goes by the scales tip a little further towards us biting the bullet, dumping the lot and taking the proverbial "life boat" to another framework with more stable functionality and support. This is coming from a business where we are 100% a Microsoft shop (except for React/Redux on web). I'm probably just shouting into the wind, but please don't treat this as badly as Xamarin!! |
The marked answer from this thread can still be used in MAUI: |
Any updates? |
I tried adding some code to manually switch the UserAppTheme. What I noticed was that the control colors were not correctly updating. The only way for all the colors to update correctly was to kill the app and launch it again. |
Looks these were both fixed by #11200 as @mostafagamal68 mentioned! @jsuarezruiz can you approve? ThemeChangeAndroid.movThemeChangeiOS.mov |
Yes, must be fixed by #11200 Closing for now this issue, but let us know if find any detail and can reopen it etc. |
@jsuarezruiz / @samhouts - this problem still persists on latest windows 11, .net with latest stable visual studio and latest maui workloads under android 33. devenv_iIJQMfhN0H.mp4EDIT: This also affects latest iOS builds - the event is not executed correctly and some elements still do not react correctly to theme changes. The on resume behaviour might also be broken, but hasn't been tested by me yet |
@jsuarezruiz / @samhouts will this issue be resolved in one of the coming releases and if so, will it be backported to .net7? |
I am unable to reproduce this using the default VS Info: https://gist.github.com/mattleibow/c59cd29ca1e7a164e65f463fb91a8b8e Themes-Android.mp4Themes-iOS.mp4Themes-Windows.mp4I think if this is still happening, there is something else that is going wrong. Can you attach a sample that you have (even if it is just the default project) and then a binlog that was used to build it: https://github.com/xamarin/xamarin-macios/wiki/Diagnosis Other info that will help is the android device/simulator, API version and anything else that you can see. I think I used the same emulator as you as my VS just updated to the latest stable and this was the default emulator that came with the wizard. |
Hi @egvijayanand @UkeHa. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time. |
@mattleibow as of the latest VS (17.5.5) i am no longer able to reproduce it. Both in the sample project as well as in our production software. Therefore this issue can be closed. |
Description
The styling in the default .NET MAUI app project template is loaded with AppThemeBinding constructs to detect theme change and behave accordingly like updating the back color, text color, and so on ...
This works fine on .NET 6 whereas, on .NET 7, it doesn't work as expected. The theme change is not honored.,
Note:
Have selected Unknown/Other as the Version with the bug since .NET 7 (7.0.49) is not appearing in that list.
Have selected Unknown/Other as the Last version that worked well since SR7 (6.0.547) is not appearing in that list.
Steps to Reproduce
Link to public reproduction project repository
The default template itself is sufficient.
Version with bug
Unknown/Other (please specify)
.NET 7 GA (7.0.49)
Last version that worked well
Unknown/Other
.NET 6 SR7 (6.0.547)
Affected platforms
Android, Windows, I was not able test on other platforms
Affected platform versions
Android 33.0, Windows SDK 10.0.19041
Did you find any workaround?
So far none, need to explore further.
Relevant log output
No response
The text was updated successfully, but these errors were encountered: