diff --git a/src/Atc.Wpf.Controls/LabelControls/Extensions/LabelControlBaseExtensions.cs b/src/Atc.Wpf.Controls/LabelControls/Extensions/LabelControlBaseExtensions.cs index 0341d5c0..4f309116 100644 --- a/src/Atc.Wpf.Controls/LabelControls/Extensions/LabelControlBaseExtensions.cs +++ b/src/Atc.Wpf.Controls/LabelControls/Extensions/LabelControlBaseExtensions.cs @@ -6,4 +6,15 @@ public static class LabelControlBaseExtensions public static bool IsValid( this ILabelControlBase labelControl) => labelControl is not ILabelControl control || control.IsValid(); + + public static T? FindByIdentifier( + this List labelControls, + string identifier) + where T : class, ILabelControlBase + { + ArgumentNullException.ThrowIfNull(labelControls); + ArgumentException.ThrowIfNullOrEmpty(identifier); + + return labelControls.Find(x => x.Identifier == identifier) as T; + } } \ No newline at end of file