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

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.

主站蜘蛛池模板: 棋牌| 巴南区| 休宁县| 郸城县| 安吉县| 轮台县| 沙雅县| 清远市| 定远县| 尼木县| 高州市| 孟连| 盐亭县| 延吉市| 安丘市| 威远县| 汪清县| 福鼎市| 文山县| 万山特区| 邯郸县| 陈巴尔虎旗| 科尔| 镇坪县| 平谷区| 曲周县| 丁青县| 元阳县| 重庆市| 中西区| 鱼台县| 上虞市| 柯坪县| 齐河县| 安达市| 杂多县| 日喀则市| 新兴县| 天津市| 东莞市| 乌拉特前旗|