dymaptic.GeoBlazor.Core
dymaptic.GeoBlazor.Core.Components
LayerListViewModel Class
Provides the logic for the LayerList widget.
ArcGIS Maps SDK for JavaScript
public class LayerListViewModel : dymaptic.GeoBlazor.Core.Components.MapComponent,
dymaptic.GeoBlazor.Core.Interfaces.IViewModel
Inheritance System.Object 🡒 Microsoft.AspNetCore.Components.ComponentBase 🡒 MapComponent 🡒 LayerListViewModel
Implements IViewModel
Constructors
LayerListViewModel() Constructor
Parameterless constructor for use as a Razor Component.
public LayerListViewModel();
LayerListViewModel(Nullable, Func<ListItem,Task>, Nullable) Constructor
Constructor for use in C# code. Use named parameters (e.g., item1: value1, item2: value2) to set properties in any order.
public LayerListViewModel(System.Nullable<bool> checkPublishStatusEnabled=null, System.Func<dymaptic.GeoBlazor.Core.Components.ListItem,System.Threading.Tasks.Task<dymaptic.GeoBlazor.Core.Components.ListItem>>? listItemCreatedFunction=null, System.Nullable<bool> listModeDisabled=null);
Parameters
checkPublishStatusEnabled
System.Nullable<System.Boolean>
Whether to provide an indication if a layer is being published in the LayerList.
default false
ArcGIS Maps SDK for JavaScript
listItemCreatedFunction
System.Func<ListItem,System.Threading.Tasks.Task<ListItem>>
Specifies a function that accesses each ListItem.
default null
ArcGIS Maps SDK for JavaScript
listModeDisabled
System.Nullable<System.Boolean>
Specifies whether to ignore the listMode property of the layers to display all layers.
default false
ArcGIS Maps SDK for JavaScript
Properties
LayerListViewModel.CheckPublishStatusEnabled Property
Whether to provide an indication if a layer is being published in the
LayerList.
default false
ArcGIS Maps SDK for JavaScript
public System.Nullable<bool> CheckPublishStatusEnabled { get; set; }
Property Value
System.Nullable<System.Boolean>
LayerListViewModel.HasCustomHandler Property
A convenience property that signifies whether a custom OnListItemCreatedHandler was registered.
public bool HasCustomHandler { get; }
Property Value
LayerListViewModel.HasTriggerActionListener Property
Used in JavaScript layer to determine if the event listener is registered.
public bool HasTriggerActionListener { get; }
Property Value
LayerListViewModel.ListModeDisabled Property
Specifies whether to ignore the listMode property of the layers to display all layers.
default false
ArcGIS Maps SDK for JavaScript
public System.Nullable<bool> ListModeDisabled { get; set; }
Property Value
System.Nullable<System.Boolean>
LayerListViewModel.OnListItemCreatedHandler Property
A delegate to implement a custom handler for setting up each ListItem.
Function must take in a ListItem and return a Task with the same (updated) item.
public System.Func<dymaptic.GeoBlazor.Core.Components.ListItem,System.Threading.Tasks.Task<dymaptic.GeoBlazor.Core.Components.ListItem>>? OnListItemCreatedHandler { get; set; }
Property Value
System.Func<ListItem,System.Threading.Tasks.Task<ListItem>>
LayerListViewModel.OnTriggerAction Property
Fires after the user clicks on an action or action toggle inside the LayerList widget.
This event may be used to define a custom function to execute when particular
actions are clicked.
public Microsoft.AspNetCore.Components.EventCallback<dymaptic.GeoBlazor.Core.Events.LayerListViewModelTriggerActionEvent> OnTriggerAction { get; set; }
Property Value
Microsoft.AspNetCore.Components.EventCallback<LayerListViewModelTriggerActionEvent>
LayerListViewModel.OperationalItems Property
A collection of ListItems representing operational layers.
ArcGIS Maps SDK for JavaScript
public System.Collections.Generic.IReadOnlyList<dymaptic.GeoBlazor.Core.Components.ListItem>? OperationalItems { get; set; }
Property Value
System.Collections.Generic.IReadOnlyList<ListItem>
LayerListViewModel.State Property
The view model’s state.
default “disabled”
ArcGIS Maps SDK for JavaScript
public System.Nullable<dymaptic.GeoBlazor.Core.Enums.ViewModelState> State { get; set; }
Property Value
System.Nullable<ViewModelState>
Methods
LayerListViewModel.GetCheckPublishStatusEnabled() Method
Asynchronously retrieve the current value of the CheckPublishStatusEnabled property.
public System.Threading.Tasks.Task<System.Nullable<bool>> GetCheckPublishStatusEnabled();
Returns
System.Threading.Tasks.Task<System.Nullable<System.Boolean>>
LayerListViewModel.GetListModeDisabled() Method
Asynchronously retrieve the current value of the ListModeDisabled property.
public System.Threading.Tasks.Task<System.Nullable<bool>> GetListModeDisabled();
Returns
System.Threading.Tasks.Task<System.Nullable<System.Boolean>>
LayerListViewModel.GetOperationalItems() Method
Asynchronously retrieve the current value of the OperationalItems property.
public System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyList<dymaptic.GeoBlazor.Core.Components.ListItem>?> GetOperationalItems();
Returns
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyList<ListItem>>
LayerListViewModel.GetState() Method
Asynchronously retrieve the current value of the State property.
public System.Threading.Tasks.Task<System.Nullable<dymaptic.GeoBlazor.Core.Enums.ViewModelState>> GetState();
Returns
System.Threading.Tasks.Task<System.Nullable<ViewModelState>>
LayerListViewModel.MoveListItem(ListItem, ListItem, ListItem, int) Method
Moves a list item from one position to another in the LayerList widget.
param fromParentItem If the targetItem
is a child of a parent list item and you want to move it out of the parentItem, then use this parameter to indicate the parent item to move from.
param newIndex The new index to move the targetItem
to. If moving the item as a child to a parent item, then specify the index of the item within that parent.
ArcGIS Maps SDK for JavaScript
public System.Threading.Tasks.Task MoveListItem(dymaptic.GeoBlazor.Core.Components.ListItem targetItem, dymaptic.GeoBlazor.Core.Components.ListItem fromParentItem, dymaptic.GeoBlazor.Core.Components.ListItem toParentItem, int newIndex);
Parameters
targetItem
ListItem
The list item (or layer) to move.
fromParentItem
ListItem
If the
targetItem
``` is a child of a parent list item and you want to move it out of the parentItem, then use this parameter to indicate the parent item to move from.
<a name='dymaptic.GeoBlazor.Core.Components.LayerListViewModel.MoveListItem(dymaptic.GeoBlazor.Core.Components.ListItem,dymaptic.GeoBlazor.Core.Components.ListItem,dymaptic.GeoBlazor.Core.Components.ListItem,int).toParentItem'></a>
`toParentItem` [ListItem](dymaptic.GeoBlazor.Core.Components.ListItem.html 'dymaptic.GeoBlazor.Core.Components.ListItem')
The parent list item to move the `targetItem` to if moving it as a child to another parent item.
<a name='dymaptic.GeoBlazor.Core.Components.LayerListViewModel.MoveListItem(dymaptic.GeoBlazor.Core.Components.ListItem,dymaptic.GeoBlazor.Core.Components.ListItem,dymaptic.GeoBlazor.Core.Components.ListItem,int).newIndex'></a>
`newIndex` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32')
The new index to move the
```csharp
targetItem
``` to. If moving the item as a child to a parent item, then specify the index of the item within that parent.
#### Returns
[System.Threading.Tasks.Task](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.Task 'System.Threading.Tasks.Task')
<a name='dymaptic.GeoBlazor.Core.Components.LayerListViewModel.OnJsTriggerAction(Microsoft.JSInterop.IJSStreamReference)'></a>
## LayerListViewModel.OnJsTriggerAction(IJSStreamReference) Method
JavaScript-Invokable Method for internal use only.
```csharp
public System.Threading.Tasks.Task OnJsTriggerAction(Microsoft.JSInterop.IJSStreamReference jsStreamRef);
Parameters
jsStreamRef
Microsoft.JSInterop.IJSStreamReference
Returns
LayerListViewModel.OnListItemCreated(ListItem) Method
A JavaScript invokable method that is triggered whenever a ListItem is created and a handler is attached.
public System.Threading.Tasks.Task<object?> OnListItemCreated(dymaptic.GeoBlazor.Core.Components.ListItem item);
Parameters
item
ListItem
The ListItem from the original source.
Returns
System.Threading.Tasks.Task<System.Object>
Returns the modified ListItem
LayerListViewModel.SetCheckPublishStatusEnabled(Nullable) Method
Asynchronously set the value of the CheckPublishStatusEnabled property after render.
public System.Threading.Tasks.Task SetCheckPublishStatusEnabled(System.Nullable<bool> value);
Parameters
value
System.Nullable<System.Boolean>
The value to set.
Returns
LayerListViewModel.SetListModeDisabled(Nullable) Method
Asynchronously set the value of the ListModeDisabled property after render.
public System.Threading.Tasks.Task SetListModeDisabled(System.Nullable<bool> value);
Parameters
value
System.Nullable<System.Boolean>
The value to set.
Returns
LayerListViewModel.TriggerAction(ActionBase, ListItem) Method
Triggers the trigger-action event and executes
the given action or action toggle.
param item An item associated with the action.
ArcGIS Maps SDK for JavaScript
public System.Threading.Tasks.Task TriggerAction(dymaptic.GeoBlazor.Core.Components.ActionBase action, dymaptic.GeoBlazor.Core.Components.ListItem item);
Parameters
action
ActionBase
The action to execute.
item
ListItem
An item associated with the action.