diff --git a/Maui.DataGrid/Extensions/ReflectionExtensions.cs b/Maui.DataGrid/Extensions/ReflectionExtensions.cs index 503b6be..2ce758e 100644 --- a/Maui.DataGrid/Extensions/ReflectionExtensions.cs +++ b/Maui.DataGrid/Extensions/ReflectionExtensions.cs @@ -105,11 +105,7 @@ internal static class ReflectionExtensions [MethodImpl(MethodImplOptions.AggressiveInlining)] private static PropertyDescriptor? GetPropertyDescriptor(Type type, string propertyName) { - if (!PropertyTypeCache.TryGetValue(type, out var properties)) - { - properties = TypeDescriptor.GetProperties(type); - PropertyTypeCache[type] = properties; - } + var properties = PropertyTypeCache.GetOrAdd(type, TypeDescriptor.GetProperties); return properties.Find(propertyName, false); }