Bug 31329 - Implicit styling with inheritance.
Summary: Implicit styling with inheritance.
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.4.4
Hardware: PC Windows
: Normal enhancement
Target Milestone: ---
Assignee: Jason Smith [MSFT]
Depends on:
Reported: 2015-06-23 13:54 UTC by Brad Chase
Modified: 2016-04-10 02:16 UTC (History)
6 users (show)

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

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:

Description Brad Chase 2015-06-23 13:54:16 UTC

Here is an example in the main app xaml:

     <Style TargetType="Layout">
        <Setter Property="Padding" Value="0"/>

Controls like the Grid control as an example do not obey inheritance like this style with TargetType="Layout" even though the Grid itself is of type Layout.
Comment 1 asimk 2015-07-03 12:17:52 UTC
I have checked this issue and I am also getting the same behavior.

Observation: When I set the TargetType property to "Layout" it is not working for layouts like stack layout, grid etc. but when I set the TargetType property to "StackLayout" it is working fine.

Screencast: http://www.screencast.com/t/4T03c8kzeL


Windows 8.1
Microsoft Visual Studio Professional 2013
Version 12.0.30723.00 Update 3
Microsoft .NET Framework
Version 4.5.51641
Installed Version: Professional
Xamarin   3.11.666.0 (ebae43a)
Xamarin.Android (5f55a9ef61c11b6ce0890bc91e4c71b1b92be214)
Xamarin.Forms Intellisense   1.0
Xamarin.iOS (67b390d0d1bd741582cf7b7fd3ffea08583a3f83)
Comment 2 Jason Smith [MSFT] 2016-04-10 02:16:10 UTC
This is standard behavior for how Styles work, however you can now set ApplyToDerivedTypes to get the behavior you want.