Repository: unoplatform/uno
File: src/Uno.UI/UI/Xaml/FrameworkElementExtensions.cs (C#)

Code before:
		private static DependencyProperty GetDependencyPropertyFromFields(object element, string property)
		{
			FieldInfo fieldInfo = null;
			var currentType = element.GetType();
			do
			{
				fieldInfo = GetField(currentType, property + "Property");

				if (fieldInfo == null)
				{
					currentType = currentType.GetTypeInfo().BaseType;
				}

			}
			while (currentType != null && fieldInfo == null);

			if (fieldInfo != null)
			{
				var dependencyProperty = (DependencyProperty)fieldInfo.GetValue(null);
				return dependencyProperty;
			}

			return null;

			[UnconditionalSuppressMessage("Trimming", "IL2070", Justification = "TODO")]
			[UnconditionalSuppressMessage("Trimming", "IL2075", Justification = "TODO")]
			static FieldInfo GetField(Type type, string fieldName)
				=> type.GetTypeInfo().GetDeclaredField(fieldName);
		}

		private static DependencyProperty GetDependencyPropertyFromProperties(object element, string property)
		{
			PropertyInfo propertyInfo = null;
			var currentType = element.GetType();

			do
			{
				propertyInfo = GetProperty(currentType, property + "Property");

				if (propertyInfo == null)
				{
					currentType = currentType.GetTypeInfo().BaseType;
				}

			} while (currentType != null && propertyInfo == null);

			if (propertyInfo != null)
			{
				var dependencyProperty = (DependencyProperty)propertyInfo.GetMethod.Invoke(null, Array.Empty<object>());
				return dependencyProperty;
			}

Review comment (suggestion):
```suggestion
			[UnconditionalSuppressMessage("Trimming", "IL2070", Justification = "Expected behavior, the XamltypeInfo generator takes care of this")]
			[UnconditionalSuppressMessage("Trimming", "IL2075", Justification = "Expected behavior, the XamltypeInfo generator takes care of this")]
```

Code after:
		private static DependencyProperty GetDependencyPropertyFromFields(object element, string property)
		{
			FieldInfo fieldInfo = null;
			var currentType = element.GetType();
			do
			{
				fieldInfo = GetField(currentType, property + "Property");

				if (fieldInfo == null)
				{
					currentType = currentType.GetTypeInfo().BaseType;
				}

			}
			while (currentType != null && fieldInfo == null);

			if (fieldInfo != null)
			{
				var dependencyProperty = (DependencyProperty)fieldInfo.GetValue(null);
				return dependencyProperty;
			}

			return null;

			[UnconditionalSuppressMessage("Trimming", "IL2070", Justification = "`Uno.UI.SourceGenerators/BindableTypeProviders` / `BindableMetadata.g.cs` ensures the field exists.")]
			[UnconditionalSuppressMessage("Trimming", "IL2075", Justification = "`Uno.UI.SourceGenerators/BindableTypeProviders` / `BindableMetadata.g.cs` ensures the field exists.")]
			static FieldInfo GetField(Type type, string fieldName)
				=> type.GetTypeInfo().GetDeclaredField(fieldName);
		}

		private static DependencyProperty GetDependencyPropertyFromProperties(object element, string property)
		{
			PropertyInfo propertyInfo = null;
			var currentType = element.GetType();

			do
			{
				propertyInfo = GetProperty(currentType, property + "Property");

				if (propertyInfo == null)
				{
					currentType = currentType.GetTypeInfo().BaseType;
				}

			} while (currentType != null && propertyInfo == null);

			if (propertyInfo != null)
			{
				var dependencyProperty = (DependencyProperty)propertyInfo.GetMethod.Invoke(null, Array.Empty<object>());
				return dependencyProperty;
			}