Class MudDropZone<T>
- Namespace
- MudBlazor
- Assembly
- MudBlazor.dll
A location which can participate in a drag-and-drop operation.
public class MudDropZone<T> : MudComponentBase, IComponent, IHandleEvent, IHandleAfterRender, IMudStateHasChanged, IDisposable where T : notnull
Type Parameters
T
The kind of item to drag.
- Inheritance
-
MudDropZone<T>
- Implements
- Inherited Members
- Extension Methods
Constructors
MudDropZone()
public MudDropZone()
Properties
AllowReorder
Allows items to be reordered within a zone.
[Parameter]
[Category("Behavior")]
public bool AllowReorder { get; set; }
Property Value
Remarks
Defaults to false
.
ApplyDropClassesOnDragStarted
Applies either CanDropClass or NoDropClass to drop zones during a drag-and-drop transaction.
[Parameter]
[Category("DropRules")]
public bool? ApplyDropClassesOnDragStarted { get; set; }
Property Value
- bool?
Remarks
Defaults to false
. The CanDrop function determines which classes are applied. When set, overrides ApplyDropClassesOnDragStarted.
CanDrop
The function which determines whether an item can be dropped within a drop zone.
[Parameter]
[Category("DropRules")]
public Func<T, bool>? CanDrop { get; set; }
Property Value
Remarks
When a drop zone is allowed, the CanDropClass is applied, otherwise NoDropClass is applied. When set, overrides CanDrop.
CanDropClass
The CSS classes applied to valid drop zones.
[Parameter]
[Category("DropRules")]
public string? CanDropClass { get; set; }
Property Value
Remarks
This class is applied when CanDrop returns true
for an item. Multiple classes must be separated by spaces. When set, overrides CanDropClass.
ChildContent
The custom content within this drop zone.
[Parameter]
[Category("Appearance")]
public RenderFragment? ChildContent { get; set; }
Property Value
Classname
protected string Classname { get; }
Property Value
Container
[CascadingParameter]
protected MudDropContainer<T>? Container { get; set; }
Property Value
DisabledClass
The CSS classes applied to disabled drop items.
[Parameter]
[Category("Disable")]
public string? DisabledClass { get; set; }
Property Value
Remarks
This class is applied when ItemDisabled returns true
for an item. Multiple classes must be separated by spaces. When set, overrides DisabledClass.
DraggingClass
The CSS classes applied to drop zones during a drag-and-drop operation.
[Parameter]
[Category("DraggingClass")]
public string? DraggingClass { get; set; }
Property Value
Remarks
Multiple classes must be separated by spaces. When set, overrides DraggingClass.
Identifier
The unique identifier for this drop zone.
[Parameter]
[Category("Appearance")]
public string Identifier { get; set; }
Property Value
Remarks
Drag-and-drop zones each have a unique identifier to differentiate them during drag-and-drop operations.
ItemDisabled
The function which determines whether an item cannot be dragged.
[Parameter]
[Category("Disable")]
public Func<T, bool>? ItemDisabled { get; set; }
Property Value
Remarks
If no value is given, all items can be dragged by default. When an item is disabled, the DisabledClass is applied. When set, overrides ItemDisabled.
ItemDraggingClass
The CSS classes applied to items during a drag-and-drop operation.
[Parameter]
[Category("DraggingClass")]
public string? ItemDraggingClass { get; set; }
Property Value
Remarks
Multiple classes must be separated by spaces. When set, overrides ItemDraggingClass.
ItemRenderer
The template used to render items within this drop zone.
[Parameter]
[Category("Items")]
public RenderFragment<T>? ItemRenderer { get; set; }
Property Value
Remarks
When set, overrides the ItemRenderer.
ItemsClassSelector
The function which determines the CSS classes for each item.
[Parameter]
[Category("Items")]
public Func<T, string>? ItemsClassSelector { get; set; }
Property Value
Remarks
When set, overrides ItemsClassSelector.
ItemsSelector
The function which determines whether an item can be dropped within this drop zone.
[Parameter]
[Category("Items")]
public Func<T, bool>? ItemsSelector { get; set; }
Property Value
Remarks
When set, overrides the ItemsSelector function.
NoDropClass
The CSS classes applied to invalid drop zones.
[Parameter]
[Category("DropRules")]
public string? NoDropClass { get; set; }
Property Value
Remarks
This class is applied when CanDrop returns false
for an item. Multiple classes must be separated by spaces. When set, overrides NoDropClass.
OnlyZone
Allows this zone to only receive dropped items.
[Parameter]
[Category("Behavior")]
public bool OnlyZone { get; set; }
Property Value
Remarks
Defaults to false
.
PlaceholderClassname
protected string PlaceholderClassname { get; }
Property Value
Methods
BuildRenderTree(RenderTreeBuilder)
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
__builder
RenderTreeBuilder
Dispose()
Releases resources used by this drop zone.
public void Dispose()
Dispose(bool)
protected virtual void Dispose(bool disposing)
Parameters
disposing
bool
OnAfterRenderAsync(bool)
protected override Task OnAfterRenderAsync(bool firstRender)
Parameters
firstRender
bool
Returns
OnParametersSet()
protected override void OnParametersSet()