![]() For more information, see Create custom controls with handlers. When you create a cross-platform control whose implementation is provided on each platform by native views, you should implement a handler that maps the cross-platform control API to the native view APIs. In addition, the cross-platform control implemented by the handler is exposed via its VirtualView property. ![]() This property can be accessed to set native view properties, invoke native view methods, and subscribe to native view events. This avoids the cross-platform control having to reference its handler, and the handler having to reference the cross-platform control.Įach handler class exposes the native view for the cross-platform control via its PlatformView property. NET MAUI handlers are accessed through their control-specific interface, such as IButton for a Button. On Android, the Button is mapped to an AppCompatButton: Handlers are also responsible for instantiating the underlying native view, and mapping the cross-platform control API to the native view API. ![]() Handlers map these virtual views to controls on each platform, which are known as native views. Cross-platform controls that implement these interfaces are known as virtual views. ![]() Each control has an interface representation that abstracts the control. NET Multi-platform App UI (.NET MAUI) provides a collection of cross-platform controls that can be used to display data, initiate actions, indicate activity, display collections, pick data, and more. ![]()
0 Comments
Leave a Reply. |