提交 e2d88484 编写于 作者: R Rafael Rosa

refactor: update for performance issue.

上级 18262e06
......@@ -14,6 +14,7 @@ using Uno.Disposables;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using Uno.Extensions;
using Windows.Foundation.Metadata;
#if HAS_UNO_WINUI
using Microsoft.UI.Input;
......@@ -1108,24 +1109,7 @@ namespace Windows.UI.Xaml.Controls
private bool IsImplemented(Type Type, string Property)
{
var propertyInfo = Type.GetProperty(Property);
var methodInfo = propertyInfo?.GetGetMethod();
if (methodInfo != null && methodInfo != default)
{
MethodBody? methodBody = methodInfo?.GetMethodBody();
byte[]? ilBytes = methodBody?.GetILAsByteArray();
if (ilBytes != null)
{
for (int i = 0; i <= ilBytes.Length - 1; i++)
{
if (ilBytes[i] == OpCodes.Throw.Value)
{
return false;
}
}
}
}
return true;
return ApiInformation.IsPropertyPresent(Type.Namespace + "." + Type.Name, Property);
}
// visual states
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册