What is Property Value Inheritance – XAML ?

When you created a new Windows Phone App , you would have noticed the following in the MainPage.XAML’s¬†PhoneApplicationPage¬† element .

 FontFamily="{StaticResource PhoneFontFamilyNormal}"
 FontSize="{StaticResource PhoneFontSizeNormal}"
 Foreground="{StaticResource PhoneForegroundBrush}"

The above sample code is an example of the Property Value Inheritance which indicates the default appearance of the child elements of the page when these properties are not set on the element.

The child element (for example : TextBlock) defined in a Windows Phone Page uses the closest ancestor’s value if it is not defined .

If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.

Leave a Reply