One of the important tasks while developing applications is to ensure the design is consistent within the whole solution. However, copying and pasting the same code in several places, for instance, for each button located on the page, is not a suitable solution. In the case of any modifications, you will need to perform many changes and ensure that all the occurrences of a previous value have been replaced correctly. For this reason, it is a beneficial approach to use styles.
In this recipe, you will learn how to apply page-limited styles to the controls on the page. What is more, two kinds of styles will be taken into account: styles applied automatically to all the controls of a given type and styles applied only to a particular subset of controls.
As an example, you will create a photo gallery with the header. Each photo is represented by an Image
control placed within Border
. A style should be automatically applied to all Border
elements to set its borders...