Skip to content

Commit

Permalink
Only enable suppression message for trimming warning in GetContentCon…
Browse files Browse the repository at this point in the history
…trol method in .NET 8.0 or greater
  • Loading branch information
Arlodotexe committed Dec 17, 2024
1 parent 92b401d commit 49dac1c
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,9 @@ public static IEnumerable<FrameworkElement> FindParents(this FrameworkElement el
/// </summary>
/// <param name="element">The parent element.</param>
/// <returns>The retrieved content control, or <see langword="null"/> if not available.</returns>
#if NET8_0_OR_GREATER
[System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessage("Trimming", "IL2075", Justification = "This method is currently not safe for trimming, and annotations here wouldn't help.")]
#endif
public static UIElement? GetContentControl(this FrameworkElement element)
{
Type type = element.GetType();
Expand Down

0 comments on commit 49dac1c

Please sign in to comment.