To follow the examples in this topic, you should also understand Extensible Application Markup Language (XAML) and know how to write WPF applications.
The WPF property system offers a powerful way to have the value of dependency properties be determined by a variety of factors, enabling features such as real-time property validation, late binding, and notifying related properties of changes to values for other properties.
With the exception of animated values and coercion, local property sets are set at the highest precedence.
If you set a value locally you can expect that the value will be honored, even above any styles or control templates.
If you removed the local value of Red from that Button instance, then the style would have precedence and the button would obtain the Background value from the style.
Within the style, triggers take precedence, so the button will be blue if the mouse is over it, and green otherwise.
My blog includes posts on a wide range of topics, including HTML5 / Java Script and data visualisation with D3 and d3fc.
You'll also find a whole host of posts about previous technology interests including i OS, Swift, WPF and Silverlight.
The following is the definitive order that the property system uses when assigning the run-time values of dependency properties. This list expands on some of the generalizations made in the Dependency Properties Overview.
Templated Parent as a precedence item does not apply to any property of an element that you declare directly in standard application markup.