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

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.

主站蜘蛛池模板: 丰城市| 鄂州市| 铜鼓县| 那曲县| 平昌县| 永顺县| 内乡县| 育儿| 贵州省| 宜城市| 长武县| 图们市| 萨迦县| 隆安县| 类乌齐县| 鄂尔多斯市| 临洮县| 兰西县| 会理县| 江华| 汪清县| 抚顺市| 奉新县| 余干县| 汝阳县| 麻城市| 高清| 土默特右旗| 新野县| 奉新县| 扎鲁特旗| 台前县| 和龙市| 奈曼旗| 崇明县| 涿州市| 阿克苏市| SHOW| 信宜市| 滨州市| 阿城市|