mirror of
https://github.com/chylex/Minecraft-Phantom-Panel.git
synced 2024-11-23 19:42:51 +01:00
14 lines
431 B
C#
14 lines
431 B
C#
using Microsoft.AspNetCore.Components.Forms;
|
|
|
|
namespace Phantom.Web.Components.Utils;
|
|
|
|
public static class EditContextExtensions {
|
|
public static void RevalidateWhenFieldChanges(this EditContext editContext, string tracked, string revalidated) {
|
|
editContext.OnFieldChanged += (_, args) => {
|
|
if (args.FieldIdentifier.FieldName == tracked) {
|
|
editContext.NotifyFieldChanged(editContext.Field(revalidated));
|
|
}
|
|
};
|
|
}
|
|
}
|