ViewHandler Class

Definition

Base class for handlers that manage views which implement IView.

public ref class ViewHandler abstract : Microsoft::Maui::Handlers::ElementHandler, Microsoft::Maui::IViewHandler
public abstract class ViewHandler : Microsoft.Maui.Handlers.ElementHandler, Microsoft.Maui.IViewHandler
type ViewHandler = class
    inherit ElementHandler
    interface IViewHandler
    interface IElementHandler
Public MustInherit Class ViewHandler
Inherits ElementHandler
Implements IViewHandler
Inheritance
ViewHandler
Derived
Implements

Remarks

Handlers map virtual views (.NET MAUI layer) to controls on each platform (iOS, Android, Windows, macOS, etc.), which are known as platform views. Handlers are also responsible for instantiating the underlying platform view, and mapping the cross-platform control API to the platform view API.

Constructors

ViewHandler(IPropertyMapper, CommandMapper)

Initializes a new instance of the ViewHandler class.

Fields

ViewCommandMapper

A dictionary that maps the virtual view commands to their platform view counterparts.

ViewMapper

A dictionary that maps the virtual view properties to their platform view counterparts.

Properties

ContainerView

Gets the view that acts as a container for the PlatformView.

HasContainer

Gets or sets a value that indicates whether the PlatformView is contained within a view.

MauiContext (Inherited from ElementHandler)
NeedsContainer

Gets a value that indicates whether or not the VirtualView needs a container view.

PlatformView

Gets or sets the platform representation of the view associated to this handler.

Services (Inherited from ElementHandler)
VirtualView

Gets or sets the .NET MAUI repesentation of the view associated to this handler.

Methods

GetDesiredSize(Double, Double)

Computes the actual size of a view based on the desired size and constraints.

Invoke(String, Object) (Inherited from ElementHandler)
MapAnchorX(IViewHandler, IView)
MapAnchorY(IViewHandler, IView)
MapAutomationId(IViewHandler, IView)

Maps the abstract AutomationId property to the platform-specific implementations.

MapBackground(IViewHandler, IView)

Maps the abstract Background property to the platform-specific implementations.

MapBorderView(IViewHandler, IView)

Maps the abstract Border property to the platform-specific implementations.

MapClip(IViewHandler, IView)

Maps the abstract Clip property to the platform-specific implementations.

MapContainerView(IViewHandler, IView)

Maps the abstract ContainerView property to the platform-specific implementations.

MapContextFlyout(IViewHandler, IView)
MapFlowDirection(IViewHandler, IView)

Maps the abstract FlowDirection property to the platform-specific implementations.

MapFocus(IViewHandler, IView, Object)

Maps the abstract Focus() property to the platform-specific implementations.

MapFrame(IViewHandler, IView, Object)

Maps the abstract Frame property to the platform-specific implementations.

MapHeight(IViewHandler, IView)

Maps the abstract Height property to the platform-specific implementations.

MapInputTransparent(IViewHandler, IView)

Maps the abstract InputTransparent property to the platform-specific implementations.

MapInvalidateMeasure(IViewHandler, IView, Object)

Maps the abstract InvalidateMeasure() method to the platform-specific implementations.

MapIsEnabled(IViewHandler, IView)

Maps the abstract IsEnabled property to the platform-specific implementations.

MapMaximumHeight(IViewHandler, IView)

Maps the abstract MaximumHeight property to the platform-specific implementations.

MapMaximumWidth(IViewHandler, IView)

Maps the abstract MaximumWidth property to the platform-specific implementations.

MapMinimumHeight(IViewHandler, IView)

Maps the abstract MinimumHeight property to the platform-specific implementations.

MapMinimumWidth(IViewHandler, IView)

Maps the abstract MinimumWidth property to the platform-specific implementations.

MapOpacity(IViewHandler, IView)

Maps the abstract Opacity property to the platform-specific implementations.

MapRotation(IViewHandler, IView)
MapRotationX(IViewHandler, IView)
MapRotationY(IViewHandler, IView)
MapScale(IViewHandler, IView)
MapScaleX(IViewHandler, IView)
MapScaleY(IViewHandler, IView)
MapSemantics(IViewHandler, IView)

Maps the abstract Semantics property to the platform-specific implementations.

MapShadow(IViewHandler, IView)

Maps the abstract Shadow property to the platform-specific implementations.

MapToolTip(IViewHandler, IView)

Maps the abstract ToolTip property to the platform-specific implementations.

MapTranslationX(IViewHandler, IView)
MapTranslationY(IViewHandler, IView)
MapUnfocus(IViewHandler, IView, Object)

Maps the abstract Unfocus() method to the platform-specific implementations.

MapVisibility(IViewHandler, IView)

Maps the abstract Visibility property to the platform-specific implementations.

MapWidth(IViewHandler, IView)

Maps the abstract Width property to the platform-specific implementations.

MapZIndex(IViewHandler, IView, Object)

Maps the abstract ZIndex property to the platform-specific implementations.

PlatformArrange(Rect)

Positions child elements and determines a size for a view.

RemoveContainer()

Deconstructs the ContainerView and removes PlatformView from its container.

SetMauiContext(IMauiContext) (Inherited from ElementHandler)
SetupContainer()

Constructs the ContainerView and adds PlatformView to a container.

SetVirtualView(IElement) (Inherited from ElementHandler)
UpdateValue(String) (Inherited from ElementHandler)

Explicit Interface Implementations

IElementHandler.DisconnectHandler() (Inherited from ElementHandler)
IViewHandler.ContainerView

Applies to