官术网_书友最值得收藏!

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.

主站蜘蛛池模板: 永新县| 铜陵市| 云霄县| 鹰潭市| 四平市| 长葛市| 油尖旺区| 自贡市| 揭西县| 太保市| 集安市| 信宜市| 洛隆县| 靖西县| 澄江县| 云霄县| 高陵县| 梨树县| 铜川市| 安吉县| 灵宝市| 邹城市| 汽车| 来宾市| 吉木乃县| 论坛| 搜索| 汝阳县| 安龙县| 富裕县| 绥中县| 天镇县| 涿州市| 宣化县| 黔东| 始兴县| 湛江市| 丹阳市| 石楼县| 民勤县| 阳西县|