Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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 for Bug 42447 on
Developer Community or GitHub if you have new
information to add and do not yet see a matching new report.
If the latest results still closely match this report, you can use the
In special cases on GitHub you might also want the comments:
GitHub Markdown with public comments
Created attachment 16618 [details]
Bug and test project descriptions
=== Overview ===
In a Xamarin.Forms project, application-wide Styles are not being picked up on certain pages of UWP, Windows 8.1 and Windows Phone 8.1 projects. The Styles are being applied correctly for all pages of iOS and Android projects. The Styles are also correctly applied to the main (root) page of UWP, Windows 8.1 and Windows Phone 8.1 projects. They are not being applied to subsequent pages navigated to from the main page in UWP, Windows 8.1 and Windows Phone 8.1 projects.
=== Steps to Reproduce ===
1) Create a Xamarin.Forms PCL project.
2) Add an Application.Resources ResourceDictionary with one or more Styles having no key to the App.xaml file, creating an application-wide ResourceDictionary:
<Setter Property="BorderColor" Value="Red"/>
<Setter Property="TextColor" Value="Red"/>
3) Define multiple pages in the application each using a control with the TargetType of the Style
4) Add a page navigation to the main (root) page of the application to navigate to a subsequent page.
5) Run the application and navigate to a subsequent page.
=== Expected Behavior ===
The application-wide Style should be applied to all controls of the TargetType on all pages of the all five application types.
=== Actual Behavior ===
After navigating to the subsequent page, in the UWP, Windows 8.1 and Windows Phone 8.1 applications, the Style will not be applied to the controls with indicated TargetType. In the iOS and Android applications, the Styles will be correctly applied. The Styles are also correctly applied to the root page of all five applications (iOS, Android, UWP, Windows 8.1 and Windows Phone 8.1).
=== Build Information ===
Build date 2016-07-08 on Windows 10, Visual Studio Enterprise 2015 Version 14.0.25421.03 Update 3, Xamarin.Forms 126.96.36.199
== Additional Info ===
A Xamarin.Forms test project demonstrating the issue is attached (TestRD.zip), along with more explanatory detail in a PDF file (Case 356930 Bug Report.PDF). This test was built with version 188.8.131.52 of Xamarin.Forms. Another test project is attached (TestUWP.zip) that demonstrates the same functionality in a native UWP (non-Xamarin.Forms) project. This project works as expected and the application-wide Styles are properly applied to all controls on all pages of the application.
A work-around has been identified - Add the following line in the code-behind for each subsequent (non-main or non-root) page of the application in the PCL project, just after the line that calls InitializeComponent:
Resources = App.Current.Resources;
With this the Styles will be correctly applied to the TargetType controls on that page.
Created attachment 16619 [details]
Test project demonstrating the issue
Created attachment 16620 [details]
Test project demonstrating that a native UWP application does not demonstrate the issue
This is still the case in version 2.3.3 of Xamarin.Forms
The styles are not working for modal pages only.
I am still seeing this issue with Forms 184.108.40.206 using the project in comment 1. This is happening with pages pushed modally only so I've changed the report title to better reflect the issue.
However the issue appears to be fixed in Forms 220.127.116.11-pre1 as I can no longer reproduce it after updating the same project to the newer version.
seeing this issue in 18.104.22.168863