ant-design-blazor/components/core/Helpers/ComponentBaseExtensions.cs

23 lines
613 B
C#

using System.Collections.Generic;
using Microsoft.AspNetCore.Components;
namespace AntBlazor
{
public static class ComponentBaseExtensions
{
public static bool ParameterIsChanged<T>(this ComponentBase cmp, ParameterView parameters,
string parameterName, T value)
{
T newValue;
if (parameters.TryGetValue(parameterName, out newValue))
{
if (!EqualityComparer<T>.Default.Equals(value, newValue))
{
return true;
}
}
return false;
}
}
}