Class SortDefinition<T>
- Namespace
- MudBlazor
- Assembly
- MudBlazor.dll
Represents information about sorting in a MudDataGrid<T>.
public sealed record SortDefinition<T> : IEquatable<SortDefinition<T>>
Type Parameters
T
The type of item being sorted.
- Inheritance
-
SortDefinition<T>
- Implements
- Inherited Members
- Extension Methods
Constructors
SortDefinition(string, bool, int, Func<T, object>, IComparer<object>?)
Represents information about sorting in a MudDataGrid<T>.
public SortDefinition(string SortBy, bool Descending, int Index, Func<T, object> SortFunc, IComparer<object>? Comparer = null)
Parameters
SortBy
stringThe name of the column to sort by.
Descending
boolWhen
true
, sorts in descending order.Index
intThe order of this sort relative to other sort definitions.
SortFunc
Func<T, object>The custom function used to sort values.
Comparer
IComparer<object>The comparer used to compare values.
Properties
Comparer
The comparer used to compare values.
public IComparer<object>? Comparer { get; init; }
Property Value
Descending
When true
, sorts in descending order.
public bool Descending { get; init; }
Property Value
Index
The order of this sort relative to other sort definitions.
public int Index { get; init; }
Property Value
SortBy
The name of the column to sort by.
public string SortBy { get; init; }
Property Value
SortFunc
The custom function used to sort values.
public Func<T, object> SortFunc { get; init; }
Property Value
Methods
Deconstruct(out string, out bool, out int, out Func<T, object>, out IComparer<object>?)
public void Deconstruct(out string SortBy, out bool Descending, out int Index, out Func<T, object> SortFunc, out IComparer<object>? Comparer)
Parameters
Equals(SortDefinition<T>?)
public bool Equals(SortDefinition<T>? other)
Parameters
other
SortDefinition<T>
Returns
Equals(object?)
public override bool Equals(object? obj)
Parameters
obj
object
Returns
GetHashCode()
public override int GetHashCode()
Returns
ToString()
public override string ToString()
Returns
Operators
operator ==(SortDefinition<T>?, SortDefinition<T>?)
public static bool operator ==(SortDefinition<T>? left, SortDefinition<T>? right)
Parameters
left
SortDefinition<T>right
SortDefinition<T>
Returns
operator !=(SortDefinition<T>?, SortDefinition<T>?)
public static bool operator !=(SortDefinition<T>? left, SortDefinition<T>? right)
Parameters
left
SortDefinition<T>right
SortDefinition<T>