Skip to content

Commit

Permalink
Enable AoT for net8 in Release (#417)
Browse files Browse the repository at this point in the history
* WinAppSdk AoT dynamic and unreference code suppression

* WinAppSdk AoT dynamic and unreference code suppression

* Update tooling pointer

* Update tooling pointer

* Updated tooling to latest main

* Update components/Collections/src/IncrementalLoadingCollection/IncrementalLoadingCollection.cs

Resolves https://github.com/CommunityToolkit/Windows/pull/417/files/8592e3a87b9b2bccd42d4320059df5a34f516a1c#r1607419411
  • Loading branch information
Arlodotexe authored Jun 3, 2024
1 parent 449cfea commit 9fae7ac
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public IncrementalLoadingCollectionSample()
private void Load()
{
// IncrementalLoadingCollection can be bound to a GridView or a ListView. In this case it is a ListView called PeopleListView.
var collection = new IncrementalLoadingCollection<PeopleSource, Person>();
var collection = new IncrementalLoadingCollection<PeopleSource, Person>(new PeopleSource());
PeopleListView.ItemsSource = collection;

// Binds the collection to the page DataContext in order to use its IsLoading and HasMoreItems properties.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ namespace CommunityToolkit.WinUI.Collections;
/// <summary>
/// A collection view implementation that supports filtering, sorting and incremental loading
/// </summary>
#if NET8_0_OR_GREATER
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Item sorting uses reflection to get property types and may not be AOT compatible.")]
#endif
public partial class AdvancedCollectionView : IAdvancedCollectionView, INotifyPropertyChanged, ISupportIncrementalLoading, IComparer<object>
{
private readonly List<object> _view;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,11 @@ private set
/// An <see cref="Action"/> that is called if an error occurs during data retrieval.
/// </param>
/// <seealso cref="IIncrementalSource{TSource}"/>
#if NET8_0_OR_GREATER
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("This constructor is not AOT compatible and will be removed in a future version.")]
#endif
[EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete("This constructor is not AOT compatible and will be removed in a future version. Use the other constructor and provide a source collection to use.")]
public IncrementalLoadingCollection(int itemsPerPage = 20, Action onStartLoading = null, Action onEndLoading = null, Action<Exception> onError = null)
: this(Activator.CreateInstance<TSource>(), itemsPerPage, onStartLoading, onEndLoading, onError)
{
Expand Down
3 changes: 3 additions & 0 deletions components/Converters/src/TaskResultConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ namespace CommunityToolkit.WinUI.Converters;
/// The methods in this converter will safely return <see langword="null"/> if the input
/// task is not set yet, still running, has faulted, or has been canceled.
/// </summary>
#if NET8_0_OR_GREATER
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("This method uses reflection to try to access the Task<T>.Result property of the input Task instance.")]
#endif
public sealed class TaskResultConverter : IValueConverter
{
/// <inheritdoc/>
Expand Down
3 changes: 3 additions & 0 deletions components/Extensions/src/Markup/EnumValuesExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ namespace CommunityToolkit.WinUI;
/// A markup extension that returns a collection of values of a specific <see langword="enum"/>
/// </summary>
[MarkupExtensionReturnType(ReturnType = typeof(Array))]
#if NET8_0_OR_GREATER
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("It might not be possible to create an array of a user-defined enum type at runtime.")]
#endif
public sealed class EnumValuesExtension : MarkupExtension
{
/// <summary>
Expand Down

0 comments on commit 9fae7ac

Please sign in to comment.