Layout Blazor API

Layout Properties

NameTypeDefaultDescription
ContextMenuDataSourceobjectN/ADetermines the options that will be available for selection inside the context menu.
DisabledboolfalseEnables or disables the element.
DataSourceIEnumerable<object>N/ASets or gets Layout's data source.
Localestring"en"Sets or gets the language. Used in conjunction with the property messages.
MessagesobjectN/ASets an object with string values, related to the different states of passwords strength.
OrientationOrientationOrientation.VerticalSets or gets Layout's main orientation. The orientation is applied to all Splitters inside the Layout unless they have their orientation explicitly set in the dataSource.
ReadonlyboolfalseIf the element is readonly, users cannot interact with it.
AllowLiveSplitboolfalseDetermines whether splitting is live or not.
RightToLeftboolfalseSets or gets the value indicating whether the element is aligned to support locales using right-to-left fonts.
SelectedIndexobjectN/ADetermines the selected item.
Themestring""Determines the theme. Theme defines the look of the element
UnfocusableboolfalseIf is set to true, the element cannot be focused.

Layout Methods

NameTypeArgumentsDescription
CreateLayoutItemvoidobject type, object positionInserts a new item inside the Layout.Args: dynamic type - The index of an item to be removed or an instance of Smart.SplitterItem.,object position - A string that represents the position where the new item will be created.
CreateLayoutItemvoidobject typeInserts a new item inside the Layout.
GetDataSourceAsync()Task<IEnumerable<object>>'N/A'Gets the &quot;DataSource&quot; property as Task&lt;IEnumerable&lt;object&gt;&gt;.
GetItemvoidobject indexReturns a Layout item according to the index that is passed.Args: int index - The index of an item.
GetItemvoidint indexReturns a Layout item according to the index that is passed.Args: int index - The index of an item.
GetItemvoidstring indexReturns a Layout item according to the index that is passed.Args: int index - The index of an item.
GetSelectedIndexAsync()Task<object>'N/A'Gets the &quot;SelectedIndex&quot; property as Task&lt;object&gt;.
MoveChildrenvoidobject oldItem, object newItemMoves all children from one item to another.Args: dynamic oldItem - The source item that will have it's content removed.,dynamic newItem - The host item that will have it's content replaced.
Refreshvoid'N/A'Refreshes the Blazor Component. Performs a layout of the HTML Elements and recalculates the measurements.
RefreshvoidN/ARefreshes the Layout
Rendervoid'N/A'Re-renders the Blazor Component. This method will make a full re-render.
StateHasChangedvoid'N/A'Refreshes the state and Re-renders the Blazor Component, if necessary.

Layout Events

NameTypeDescriptionEvent Detail
OnStateChangeEventCallback<Event>This event is triggered when a change regarding the Layout's state has occured, such as inserting a new item, removing an item, etc.dynamic item- The Splitter item that was the target of a change., dynamic type- A description of the operation that has cause the change.
StateChangedevent LayoutStateChangedEventHandlerThis event is triggered when a change regarding the Layout's state has occured, such as inserting a new item, removing an item, etc.LayoutStateChangedEventArgs
OnChangeEventCallback<Event>This event is triggered when the selection is changed.dynamic oldSelectedIndex- The Splitter item that was previously selected., dynamic selectedIndex- The Splitter item that is currently selected.
Changedevent LayoutChangedEventHandlerThis event is triggered when the selection is changed.LayoutChangedEventArgs
OnClosingEventCallback<Event>This event is triggered when a the context menu is about to be closed. The operation can be canceled by calling event.preventDefault() in the event handler function.N/A
Closingevent LayoutClosingEventHandlerThis event is triggered when a the context menu is about to be closed. The operation can be canceled by calling event.preventDefault() in the event handler function.LayoutClosingEventArgs
OnCloseEventCallback<Event>This event is triggered when a the context menu is closed.N/A
Closedevent LayoutClosedEventHandlerThis event is triggered when a the context menu is closed.LayoutClosedEventArgs
OnOpeningEventCallback<Event>This event is triggered when a the context menu is about to be opened. The operation can be canceled by calling event.preventDefault() in the event handler function.N/A
Openingevent LayoutOpeningEventHandlerThis event is triggered when a the context menu is about to be opened. The operation can be canceled by calling event.preventDefault() in the event handler function.LayoutOpeningEventArgs
OnOpenEventCallback<Event>This event is triggered when a the context menu is opened.N/A
Openedevent LayoutOpenedEventHandlerThis event is triggered when a the context menu is opened.LayoutOpenedEventArgs
OnMenuItemClickEventCallback<Event>This event is triggered when an option from the context menu has been clicked.dynamic target- The Splitter item that was the target of the context menu opening., dynamic item- The Context menu item that was clicked., string label- The label of the context menu that was clicked., dynamic value- The value of the context menu that was clicked.
MenuItemClickedevent LayoutMenuItemClickedEventHandlerThis event is triggered when an option from the context menu has been clicked.LayoutMenuItemClickedEventArgs

Enums

Orientation

Orientation.Horizontal
Orientation.Vertical