mirror of
https://gitee.com/ant-design-blazor/ant-design-blazor.git
synced 2024-12-15 17:31:42 +08:00
23 lines
613 B
C#
23 lines
613 B
C#
using System.Collections.Generic;
|
|
using Microsoft.AspNetCore.Components;
|
|
|
|
namespace AntDesign
|
|
{
|
|
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;
|
|
}
|
|
}
|
|
} |