layout: default title: Widget parent: Core Classes —

dymaptic.GeoBlazor.Core

dymaptic.GeoBlazor.Core.Components.Widgets

Widget Class

The base class for widgets. Each widget’s presentation is separate from its properties, methods, and data.
ArcGIS Maps SDK for JavaScript

public abstract class Widget : dymaptic.GeoBlazor.Core.Components.MapComponent

Inheritance System.Object 🡒 Microsoft.AspNetCore.Components.ComponentBase 🡒 MapComponent 🡒 Widget

Derived
BasemapGalleryWidget
BasemapLayerListWidget
BasemapToggleWidget
BookmarksWidget
CompassWidget
ExpandWidget
HomeWidget
LayerListWidget
LegendWidget
LocateWidget
MeasurementWidget
PopupWidget
ScaleBarWidget
SearchWidget
SliderWidget

Fields

Widget.JsWidgetReference Field

JS Object Reference to the widget

public IJSObjectReference? JsWidgetReference;

Field Value

Microsoft.JSInterop.IJSObjectReference

Widget.WidgetChanged Field

Indicates if the widget has changed since the last render.

public bool WidgetChanged;

Field Value

System.Boolean

Properties

Widget.ContainerId Property

The id of an external HTML Element (div). If provided, the widget will be placed inside that element, instead of on
the map.

public string? ContainerId { get; set; }

Property Value

System.String

Widget.DotNetWidgetReference Property

DotNet Object Reference to the widget

public Microsoft.JSInterop.DotNetObjectReference<dymaptic.GeoBlazor.Core.Components.Widgets.Widget> DotNetWidgetReference { get; }

Property Value

Microsoft.JSInterop.DotNetObjectReference<Widget>

Widget.Icon Property

Icon which represents the widget. It is typically used when the widget is controlled by another one (e.g. in the Expand widget).
Default Value:null

public string? Icon { get; set; }

Property Value

System.String

Widget.MapView Property

If the Widget is defined outside of the MapView, this link is required to connect them together.

public dymaptic.GeoBlazor.Core.Components.Views.MapView? MapView { get; set; }

Property Value

MapView

Widget.OnWidgetCreated Property

Event handler to know when the widget has been created.

public Microsoft.AspNetCore.Components.EventCallback OnWidgetCreated { get; set; }

Property Value

Microsoft.AspNetCore.Components.EventCallback

Widget.Position Property

The position of the widget in relation to the map view.

public System.Nullable<dymaptic.GeoBlazor.Core.Components.OverlayPosition> Position { get; set; }

Property Value

System.Nullable<OverlayPosition>

Remarks

Either Position or ContainerId should be set, but not both.

Widget.WidgetId Property

The unique ID assigned to the widget when the widget is created. If not set by the developer, it will default to the container ID, or if that is not present then it will be automatically generated.

public string? WidgetId { get; set; }

Property Value

System.String

Widget.WidgetType Property

The type of widget

public abstract string WidgetType { get; }

Property Value

System.String

Methods

Widget.OnJsWidgetCreated(IJSObjectReference) Method

JS-invokable callback to register a JS Object Reference

public System.Threading.Tasks.Task OnJsWidgetCreated(Microsoft.JSInterop.IJSObjectReference jsObjectReference);

Parameters

jsObjectReference Microsoft.JSInterop.IJSObjectReference

Returns

System.Threading.Tasks.Task

Widget.SetParametersAsync(ParameterView) Method

Sets parameters supplied by the component’s parent in the render tree.

public override System.Threading.Tasks.Task SetParametersAsync(Microsoft.AspNetCore.Components.ParameterView parameters);

Parameters

parameters Microsoft.AspNetCore.Components.ParameterView

The parameters.

Implements SetParametersAsync(ParameterView)

Returns

System.Threading.Tasks.Task
A System.Threading.Tasks.Task that completes when the component has finished updating and rendering itself.

Remarks

Parameters are passed when Microsoft.AspNetCore.Components.ComponentBase.SetParametersAsync(Microsoft.AspNetCore.Components.ParameterView) is called. It is not required that
the caller supply a parameter value for all of the parameters that are logically understood by the component.

The default implementation of Microsoft.AspNetCore.Components.ComponentBase.SetParametersAsync(Microsoft.AspNetCore.Components.ParameterView) will set the value of each property
decorated with Microsoft.AspNetCore.Components.ParameterAttribute or Microsoft.AspNetCore.Components.CascadingParameterAttribute that has
a corresponding value in the Microsoft.AspNetCore.Components.ParameterView. Parameters that do not have a corresponding value
will be unchanged.

Widget.SetProperty(string, object) Method

Sets any property to a new value after initial render. Supports all basic types (strings, numbers, booleans, dictionaries) and properties.

public System.Threading.Tasks.Task SetProperty(string propertyName, object? value);

Parameters

propertyName System.String

The name of the property to set.

value System.Object

The new value.

Returns

System.Threading.Tasks.Task