Decorator

The decorator pattern is a design pattern that allows behavior to be added to an individual object dynamically, without affecting the behavior of other objects from the same class. Xamarin.Forms makes use of this pattern to use platform-agnostic visual elements (the views used in XAML) and attaches renderers to these elements that define the way they are rendered (creating native platform-specific controls) on target platforms. The composition of Xamarin.Forms elements does not in any way change the behavior of the renderers and vice versa, allowing the developers to create custom renderers and attach them to views without affecting other visual elements. The following diagram shows the abstraction of renderer class's interaction with the decorator pattern:

A similar approach is used to create so-called effects, which are simple behavioral modifiers that are attached to existing visual elements, as well as their native counterparts.