Bug 26889 - Global, Implicit Styles Are Not Applied to Modal Pages
Summary: Global, Implicit Styles Are Not Applied to Modal Pages
Status: VERIFIED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.3.3
Hardware: PC Mac OS
: Normal normal
Target Milestone: 1.3.5
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-02-09 19:51 UTC by Jimmy [MSFT]
Modified: 2017-01-30 19:26 UTC (History)
8 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Reproduction project (177.30 KB, application/zip)
2015-02-09 19:51 UTC, Jimmy [MSFT]
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
VERIFIED FIXED

Description Jimmy [MSFT] 2015-02-09 19:51:10 UTC
Created attachment 9731 [details]
Reproduction project

=== Overview ===
An implicit style added to App.Current.Resources (programmatically or through XAML) is not applied to a page when it is shown modally. If an implicit style is added to the modal page's resources dictionary then the local style is applied, but not the global one. 

I've attached a repro project that demonstrates both cases by toggling lines 11 - 20 in TestModalPage.cs.

=== Steps to Reproduce  ===
Run the attached repro project OR

1. Create a new Forms project
2. Create and add an implicit style to App.Current.Reources
3. Use PushModalAsync() to display a page with the targeted control

=== Expected Behavior ===
Any control on the modal page that meets the target type of any of the styles in the global resources dictionary should be styled appropriately.

=== Actual Behavior ===
The controls on the modal page are styled with the default app styling. (Black text/clear background on iOS and white text/clear background on Android)

== Additional Info ===
If lines 11 - 20 in TestModalPage.cs in the repro project are uncommented

=== Build Information ===

=== Xamarin Studio ===

Version 5.7.1 (build 17)
Installation UUID: 94ce5106-6a72-4691-b34e-cd5857b1db66
Runtime:
	Mono 3.12.0 ((detached/de2f33f)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 312000076

=== Xamarin.Android ===

Version: 4.20.0.28 (Business Edition)
Android SDK: /Users/jimmygarrido/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		2.1   (API level 7)
		2.2   (API level 8)
		2.3   (API level 10)
		3.1   (API level 12)
		4.0   (API level 14)
		4.0.3 (API level 15)
		4.4   (API level 19)
		5.0   (API level 21)
Java SDK: /usr
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)

=== Apple Developer Tools ===

Xcode 6.1.1 (6611)
Build 6A2008a

=== Xamarin.iOS ===

Version: 8.6.1.20 (Business Edition)
Hash: 3b3ef43
Branch: 
Build date: 2015-01-24 09:42:21-0500

=== Xamarin.Mac ===

Version: 1.10.0.18 (Business Edition)

=== Build Information ===

Release ID: 507010017
Git revision: 0bc7d3550b6b088ac25b08dcf7bbe73bcc8658b3
Build date: 2015-02-03 19:43:29-05
Xamarin addins: f7b7d34419c9ec24501bfa7c658e80a6305613e0

=== Operating System ===

Mac OS X 10.10.2
Darwin Jimmys-MacBook-Pro.local 14.1.0 Darwin Kernel Version 14.1.0
    Mon Dec 22 23:10:38 PST 2014
    root:xnu-2782.10.72~2/RELEASE_X86_64 x86_64
Comment 1 laygr 2015-02-09 20:39:38 UTC
Happens to me too.
Comment 2 Rajneesh Kumar 2015-02-10 04:22:17 UTC
I have checked this issue and able to reproduce the reported behaviour and here are my observations:

I observed that if I run the attached test case with lines 11 - 20 in TestModalPage.cs in the project are uncommented, the controls on the modal page are styled with the applied style.

I also observed that if I run the attached test case with lines 11 - 20 in TestModalPage.cs in the project are commented, the controls on the modal page are styled with the default app styling.

please refer the screencast for the same: http://www.screencast.com/t/1dZQxyhrw5P

So please confirm me that Is this the same behaviour you are experiencing at your end ?

Ide Logs: https://gist.github.com/Rajneesh360Logica/6160d9a14b181cdcffe8
Application Output: https://gist.github.com/Rajneesh360Logica/3db726f3fcf2161ad92e

Environment Info:

Xamarin.Forms Version: 1.3.4.6325-pre1

=== Xamarin Studio ===

Version 5.7.1 (build 17)
Installation UUID: 011d70a5-dede-428b-ab04-ef451c2e539d
Runtime:
	Mono 3.12.0 ((detached/de2f33f)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 312000076

=== Xamarin.Android ===

Version: 4.20.0.28 (Trial Edition)
Android SDK: /Users/MM/Desktop/android-sdk-macosx
	Supported Android versions:
		2.1    (API level 7)
		2.2    (API level 8)
		2.3    (API level 10)
		3.1    (API level 12)
		4.0    (API level 14)
		4.0.3  (API level 15)
		4.1    (API level 16)
		4.2    (API level 17)
		4.3    (API level 18)
		4.4    (API level 19)
		4.4.87 (API level 20)
		5.0    (API level 21)
Java SDK: /usr
java version "1.7.0_65"
Java(TM) SE Runtime Environment (build 1.7.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)

=== Apple Developer Tools ===

Xcode 6.1 (6604)
Build 6A1052d

=== Xamarin.iOS ===

Version: 8.6.1.20 (Trial Edition)
Hash: 3b3ef43
Branch: 
Build date: 2015-01-24 09:42:21-0500

=== Xamarin.Mac ===

Version: 1.12.0.5 (Trial Edition)

=== Build Information ===

Release ID: 507010017
Git revision: 0bc7d3550b6b088ac25b08dcf7bbe73bcc8658b3
Build date: 2015-02-03 19:43:29-05
Xamarin addins: f7b7d34419c9ec24501bfa7c658e80a6305613e0

=== Operating System ===

Mac OS X 10.9.5
Darwin MacMini.local 13.4.0 Darwin Kernel Version 13.4.0
    Sun Aug 17 19:50:11 PDT 2014
    root:xnu-2422.115.4~1/RELEASE_X86_64 x86_64
Comment 3 Jimmy [MSFT] 2015-02-10 12:06:31 UTC
Yes, I confirm that I observe the same behavior.
Comment 4 Jason Smith [MSFT] 2015-02-11 08:40:07 UTC
Should be fixed in 1.3.5-pre1
Comment 5 Rajneesh Kumar 2015-02-18 05:08:28 UTC
I have checked this issue with the following builds:

Xamarin.Forms Version: 1.3.5.6333-pre1
Xamarin Studio Version 5.7.1 (build 17)
Installation UUID: 011d70a5-dede-428b-ab04-ef451c2e539d
Runtime:
Mono 3.12.0 ((detached/de2f33f)
GTK+ 2.24.23 (Raleigh theme)
Package version: 312000076
Xamarin.Android Version: 4.20.0.28 (Business Edition)
Xamarin.iOS Version: 8.6.1.20 (Business Edition)
===Build Information ===
Release ID: 507010017
Git revision: 0bc7d3550b6b088ac25b08dcf7bbe73bcc8658b3
Build date: 2015-02-03 19:43:29-05
Xamarin addins: f7b7d34419c9ec24501bfa7c658e80a6305613e0
=== Operating System ===
Mac OS X 10.9.5
Darwin MacMini.local 13.4.0 Darwin Kernel Version 13.4.0
Sun Aug 17 19:50:11 PDT 2014
root:xnu-2422.115.4~1/RELEASE_X86_64 x86_64

I observed that, if I run the attached test case with lines 11 - 20 in TestModalPage.cs in the project are commented, now the controls on the modal page are styled with styles in the global resources dictionary . Here is screencast for the same: http://www.screencast.com/t/dnyklnvo9cgH

This issue has been fixed hence, I am closing this issue.
Comment 6 mark 2016-08-22 07:05:44 UTC
Already existed in UWP(XF 2.1.0.6529), Android and iOS works fine.
Comment 7 Vladislav Kosev 2017-01-30 13:41:46 UTC
The issue still persists in UWP. Can somebody reopen this bug?
Comment 8 Jimmy [MSFT] 2017-01-30 19:21:08 UTC
I can repro this issue on UWP with Forms 2.3.3.180, however it seems resolved with Forms 2.3.4-pre1.

This exact bug report can be considered closed at this time since it was filed for all platforms and has been marked as resolved for over a year. For similar issues on UWP with Forms version 2.3.3.180 or higher, please file a new bug report with as much detail as possible and ideally a test case. Thanks!

[1] https://developer.xamarin.com/guides/cross-platform/troubleshooting/questions/howto-file-bug/
Comment 9 Vladislav Kosev 2017-01-30 19:26:05 UTC
Actually there is another bug filed six months ago: https://bugzilla.xamarin.com/show_bug.cgi?id=42447.