diff --git a/components/Extensions/src/Tree/FrameworkElementExtensions.LogicalTree.cs b/components/Extensions/src/Tree/FrameworkElementExtensions.LogicalTree.cs index 2e1b9d51..52d27723 100644 --- a/components/Extensions/src/Tree/FrameworkElementExtensions.LogicalTree.cs +++ b/components/Extensions/src/Tree/FrameworkElementExtensions.LogicalTree.cs @@ -6,7 +6,6 @@ using System.Collections.Generic; using System.Reflection; using CommunityToolkit.WinUI.Predicates; -using System.Diagnostics.CodeAnalysis; #nullable enable @@ -96,7 +95,7 @@ public static partial class FrameworkElementExtensions /// The root element. /// The predicatee to use to match the child nodes. /// The child that was found, or . - private static T? FindChild([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties)] this FrameworkElement element, ref TPredicate predicate) + private static T? FindChild(this FrameworkElement element, ref TPredicate predicate) where T : notnull, FrameworkElement where TPredicate : struct, IPredicate { @@ -663,7 +662,7 @@ public static IEnumerable FindParents(this FrameworkElement el /// /// The parent element. /// The retrieved content control, or if not available. - public static UIElement? GetContentControl([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties)] this FrameworkElement element) + public static UIElement? GetContentControl(this FrameworkElement element) { Type type = element.GetType(); TypeInfo? typeInfo = type.GetTypeInfo();