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

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.

主站蜘蛛池模板: 河东区| 西畴县| 洛隆县| 河东区| 金寨县| 桂东县| 峨山| 梅河口市| 道孚县| 达拉特旗| 台州市| 汉寿县| 商洛市| 巴林右旗| 新昌县| 黔东| 安图县| 松阳县| 婺源县| 慈利县| 西乡县| 大渡口区| 晋江市| 沿河| 荔浦县| 郁南县| 盐城市| 景洪市| 晋州市| 济阳县| 河间市| 泰和县| 塔城市| 明溪县| 西林县| 金秀| 十堰市| 修水县| 阿拉尔市| 怀远县| 伽师县|