Skip to content

Commit

Permalink
Add trim annotations to 'TokenView'
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergio0694 committed Dec 24, 2024
1 parent d96cd92 commit db70025
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions components/TokenView/src/TokenView/TokenView.ItemsSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

#if NET8_0_OR_GREATER
using System.Diagnostics.CodeAnalysis;
#endif

namespace CommunityToolkit.Labs.WinUI;

public partial class TokenView : ListViewBase
Expand All @@ -15,6 +19,9 @@ protected override void OnItemsChanged(object e)
base.OnItemsChanged(e);
}

#if NET8_0_OR_GREATER
[RequiresUnreferencedCode("This method accesses the 'Remove' method of the assigned items source collection in a trim-unsafe way.")]
#endif
private void ItemsSource_PropertyChanged(DependencyObject sender, DependencyProperty dp)
{
// Use reflection to store a 'Remove' method of any possible collection in ItemsSource
Expand Down
7 changes: 7 additions & 0 deletions components/TokenView/src/TokenView/TokenView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

#if NET8_0_OR_GREATER
using System.Diagnostics.CodeAnalysis;
#endif

namespace CommunityToolkit.Labs.WinUI;

/// <summary>
Expand All @@ -26,6 +30,9 @@ public partial class TokenView : ListViewBase
/// <summary>
/// Creates a new instance of the <see cref="TokenView"/> class.
/// </summary>
#if NET8_0_OR_GREATER
[RequiresUnreferencedCode("This method accesses the 'Remove' method of the assigned items source collection in a trim-unsafe way.")]
#endif
public TokenView()
{
this.DefaultStyleKey = typeof(TokenView);
Expand Down

0 comments on commit db70025

Please sign in to comment.