Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -205,13 +205,6 @@ jobs:
name: build-logs-${{ matrix.multitarget }}-winui${{ matrix.winui }}
path: ./**/*.*log

- name: Artifact - ILC Repro
uses: actions/upload-artifact@v4
if: ${{ (env.ENABLE_DIAGNOSTICS == 'true' || env.COREHOST_TRACE != '') && always() }}
with:
name: ilc-repro-${{ matrix.multitarget }}-winui${{ matrix.winui }}
path: ./*.zip

# https://github.com/dorny/paths-filter#custom-processing-of-changed-files
- name: Detect If any Dump Files
id: detect-dump
Expand Down
5 changes: 0 additions & 5 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
<Project>
<ItemGroup>
<!-- Workaround for WebView2 on uap pulling in Microsoft.VCLibs.Desktop when it shouldn't -->
<SDKReference Remove="Microsoft.VCLibs.Desktop, Version=14.0" />
</ItemGroup>

<ItemGroup Condition="'$(Configuration)' == 'Release'">
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
</ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions components/Animations/samples/Dependencies.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!--
WinUI 2 under UWP uses TargetFramework uap10.0.*
WinUI 3 under WinAppSdk uses TargetFramework net6.0-windows10.*
WinUI 2 under UWP and WinUI 3 under WinAppSdk both use TargetFramework net*-windows10.*
(use the 'IsUwp' and 'IsWinAppSdk' properties below to tell them apart)
However, under Uno-powered platforms, both WinUI 2 and 3 can share the same TargetFramework.

MSBuild doesn't play nicely with this out of the box, so we've made it easy for you.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ internal interface ICompositionAnimationFactory
/// </summary>
private sealed record AnimationFactory<T>(
string Property,
#pragma warning restore CS0518 // Predefined type 'System.Runtime.CompilerServices.IsExternalInit' is not defined or imported
T To,
T? From,
TimeSpan Delay,
Expand Down Expand Up @@ -258,7 +257,7 @@ private TValue GetToAs<TValue>()
// IL_000b: unbox.any !!TValue
// IL_0010: ret
// =============================
// The key point is that the JIT (and AOT compilers such as .NET Native) can recognize this
// The key point is that the JIT (and AOT compilers such as NativeAOT) can recognize this
// pattern and optimize the boxing away in case the types match. This is the case whenever
// the generic arguments are value types, which due to generic types in .NET being reified
// results in a completely different generic instantiation of the same method, making the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,7 @@ public CompositionAnimation GetAnimation(CompositionObject targetHint, out Compo
// We can retrieve the total duration from the last timed keyframe, and then set
// this as the target duration and use it to normalize the keyframe progresses.
ArraySegment<KeyFrameInfo> keyFrames = this.keyFrames.GetArraySegment();
#if !NETSTANDARD2_0
TimeSpan duration = keyFrames[keyFrames.Count - 1].GetTimedProgress(default);
#else
TimeSpan duration = keyFrames.Array[keyFrames.Count - 1].GetTimedProgress(default);
#endif

return NormalizedKeyFrameAnimationBuilder<T>.GetAnimation(
targetHint,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,7 @@ public bool TryInsertExpressionKeyFrame(KeyFrameAnimation animation, TimeSpan du
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float GetNormalizedProgress(TimeSpan duration)
{
#if !NETSTANDARD2_0
return (float)Math.Clamp(this.progress.TotalMilliseconds / duration.TotalMilliseconds, 0, 1);
#else
var result = this.progress.TotalMilliseconds / duration.TotalMilliseconds;
return (float)Math.Max(Math.Min(result, 1), 0);
#endif
}

/// <inheritdoc/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@
<ItemGroup>
<InternalsVisibleTo Include="CommunityToolkit.WinUI.Media" />
<InternalsVisibleTo Include="CommunityToolkit.WinUI.Behaviors" />

<PackageReference Include="PolySharp" Version="1.13.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions components/Animations/src/Dependencies.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!--
WinUI 2 under UWP uses TargetFramework uap10.0.*
WinUI 3 under WinAppSdk uses TargetFramework net6.0-windows10.*
WinUI 2 under UWP and WinUI 3 under WinAppSdk both use TargetFramework net*-windows10.*
(use the 'IsUwp' and 'IsWinAppSdk' properties below to tell them apart)
However, under Uno-powered platforms, both WinUI 2 and 3 can share the same TargetFramework.

MSBuild doesn't play nicely with this out of the box, so we've made it easy for you.
Expand Down
10 changes: 0 additions & 10 deletions components/Animations/src/Xaml/AnimationSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,17 +98,7 @@ public Task StartAsync(UIElement element)

CancellationTokenSource cancellationTokenSource = new();

#if !NETSTANDARD2_0
this.cancellationTokenMap.AddOrUpdate(element, cancellationTokenSource);
#else
// If we have a token, remove it first, before adding new one.
if (this.cancellationTokenMap.TryGetValue(element, out _))
{
this.cancellationTokenMap.Remove(element);
}

this.cancellationTokenMap.Add(element, cancellationTokenSource);
#endif

return StartAsync(element, cancellationTokenSource.Token);
}
Expand Down
4 changes: 2 additions & 2 deletions components/Behaviors/samples/Dependencies.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!--
WinUI 2 under UWP uses TargetFramework uap10.0.*
WinUI 3 under WinAppSdk uses TargetFramework net6.0-windows10.*
WinUI 2 under UWP and WinUI 3 under WinAppSdk both use TargetFramework net*-windows10.*
(use the 'IsUwp' and 'IsWinAppSdk' properties below to tell them apart)
However, under Uno-powered platforms, both WinUI 2 and 3 can share the same TargetFramework.

MSBuild doesn't play nicely with this out of the box, so we've made it easy for you.
Expand Down
4 changes: 2 additions & 2 deletions components/Behaviors/src/Dependencies.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!--
WinUI 2 under UWP uses TargetFramework uap10.0.*
WinUI 3 under WinAppSdk uses TargetFramework net6.0-windows10.*
WinUI 2 under UWP and WinUI 3 under WinAppSdk both use TargetFramework net*-windows10.*
(use the 'IsUwp' and 'IsWinAppSdk' properties below to tell them apart)
However, under Uno-powered platforms, both WinUI 2 and 3 can share the same TargetFramework.

MSBuild doesn't play nicely with this out of the box, so we've made it easy for you.
Expand Down
4 changes: 2 additions & 2 deletions components/CameraPreview/samples/Dependencies.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!--
WinUI 2 under UWP uses TargetFramework uap10.0.*
WinUI 3 under WinAppSdk uses TargetFramework net6.0-windows10.*
WinUI 2 under UWP and WinUI 3 under WinAppSdk both use TargetFramework net*-windows10.*
(use the 'IsUwp' and 'IsWinAppSdk' properties below to tell them apart)
However, under Uno-powered platforms, both WinUI 2 and 3 can share the same TargetFramework.

MSBuild doesn't play nicely with this out of the box, so we've made it easy for you.
Expand Down
4 changes: 2 additions & 2 deletions components/CameraPreview/src/Dependencies.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!--
WinUI 2 under UWP uses TargetFramework uap10.0.*
WinUI 3 under WinAppSdk uses TargetFramework net6.0-windows10.*
WinUI 2 under UWP and WinUI 3 under WinAppSdk both use TargetFramework net*-windows10.*
(use the 'IsUwp' and 'IsWinAppSdk' properties below to tell them apart)
However, under Uno-powered platforms, both WinUI 2 and 3 can share the same TargetFramework.

MSBuild doesn't play nicely with this out of the box, so we've made it easy for you.
Expand Down
6 changes: 0 additions & 6 deletions components/Collections/samples/Collections.Samples.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,4 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<PackageReference Include="PolySharp" Version="1.14.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
</Project>
4 changes: 2 additions & 2 deletions components/Collections/samples/Dependencies.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!--
WinUI 2 under UWP uses TargetFramework uap10.0.*
WinUI 3 under WinAppSdk uses TargetFramework net6.0-windows10.*
WinUI 2 under UWP and WinUI 3 under WinAppSdk both use TargetFramework net*-windows10.*
(use the 'IsUwp' and 'IsWinAppSdk' properties below to tell them apart)
However, under Uno-powered platforms, both WinUI 2 and 3 can share the same TargetFramework.

MSBuild doesn't play nicely with this out of the box, so we've made it easy for you.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,20 +46,16 @@ public SortDescription(SortDirection direction, IComparer? comparer = null)
/// <param name="propertyName">Name of property to sort on</param>
/// <param name="direction">Direction of sort</param>
/// <param name="comparer">Comparer to use. If null, will use default comparer</param>
#if NET8_0_OR_GREATER
[RequiresUnreferencedCode("Item sorting with the property name uses reflection to get the property and is not trim-safe. Either use SortDescription<T> to preserve the required metadata, or use the other constructor without a property name.")]
#endif
public SortDescription(string propertyName, SortDirection direction, IComparer? comparer = null)
{
PropertyName = propertyName;
Direction = direction;
Comparer = comparer ?? ObjectComparer.Instance;
}

#if NET8_0_OR_GREATER
[UnconditionalSuppressMessage("Trimming", "IL2070:'this' argument does not satisfy 'DynamicallyAccessedMembersAttribute' in call to target method. The parameter of method does not have matching annotations.",
Justification = "The path which does reflection is only triggered if the user uses the constructor with RequiresUnreferencedCode, which will inform them of the risk.")]
#endif
internal virtual PropertyInfo? GetProperty(Type type)
=> PropertyName != null ? type.GetProperty(PropertyName) : null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ namespace CommunityToolkit.WinUI.Collections;
/// </summary>
/// <typeparam name="T">The type to sort</typeparam>
public sealed class SortDescription<
#if NET8_0_OR_GREATER
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties)]
#endif
T> : SortDescription
{
private readonly PropertyInfo _prop;
Expand All @@ -25,10 +23,8 @@ public sealed class SortDescription<
/// <param name="propertyName">Name of property to sort on</param>
/// <param name="direction">Direction of sort</param>
/// <param name="comparer">Comparer to use. If null, will use default comparer</param>
#if NET8_0_OR_GREATER
[UnconditionalSuppressMessage("Trimming", "IL2026:Members annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code",
Justification = "This class preserves metadata and ensures at runtime that the received type is compatible.")]
#endif
public SortDescription(string propertyName, SortDirection direction, IComparer? comparer = null) : base(propertyName, direction, comparer)
{
_prop = typeof(T).GetProperty(propertyName) ?? throw new ArgumentException($"Could not find property {propertyName}");
Expand Down
4 changes: 2 additions & 2 deletions components/Collections/src/Dependencies.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!--
WinUI 2 under UWP uses TargetFramework uap10.0.*
WinUI 3 under WinAppSdk uses TargetFramework net6.0-windows10.*
WinUI 2 under UWP and WinUI 3 under WinAppSdk both use TargetFramework net*-windows10.*
(use the 'IsUwp' and 'IsWinAppSdk' properties below to tell them apart)
However, under Uno-powered platforms, both WinUI 2 and 3 can share the same TargetFramework.

MSBuild doesn't play nicely with this out of the box, so we've made it easy for you.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ namespace CommunityToolkit.WinUI.Collections;
/// <seealso cref="ISupportIncrementalLoading"/>
#pragma warning disable CA1001 // Types that own disposable fields should be disposable
#pragma warning disable CS8625 // Cannot convert null literal to non-nullable reference type.
#pragma warning disable CS1061
#pragma warning disable CS8619
public class IncrementalLoadingCollection<TSource, IType> : ObservableCollection<IType>,
ISupportIncrementalLoading
Expand Down Expand Up @@ -130,9 +129,7 @@ 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)
Expand Down Expand Up @@ -237,11 +234,7 @@ protected virtual async Task<IEnumerable<IType>> LoadDataAsync(CancellationToken
throw t.Exception!;
}

#if HAS_UNO
if (t.IsCompleted && t.Status == TaskStatus.RanToCompletion)
#else
if (t.IsCompletedSuccessfully)
#endif
{
CurrentPageIndex += 1;
}
Expand Down Expand Up @@ -312,5 +305,4 @@ private async Task<LoadMoreItemsResult> LoadMoreItemsAsync(uint count, Cancellat
}
#pragma warning restore CA1001 // Types that own disposable fields should be disposable
#pragma warning restore CS8625 // Cannot convert null literal to non-nullable reference type.
#pragma warning restore CS1061
#pragma warning restore CS8619
4 changes: 2 additions & 2 deletions components/ColorPicker/samples/Dependencies.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!--
WinUI 2 under UWP uses TargetFramework uap10.0.*
WinUI 3 under WinAppSdk uses TargetFramework net6.0-windows10.*
WinUI 2 under UWP and WinUI 3 under WinAppSdk both use TargetFramework net*-windows10.*
(use the 'IsUwp' and 'IsWinAppSdk' properties below to tell them apart)
However, under Uno-powered platforms, both WinUI 2 and 3 can share the same TargetFramework.

MSBuild doesn't play nicely with this out of the box, so we've made it easy for you.
Expand Down
4 changes: 2 additions & 2 deletions components/ColorPicker/src/Dependencies.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!--
WinUI 2 under UWP uses TargetFramework uap10.0.*
WinUI 3 under WinAppSdk uses TargetFramework net6.0-windows10.*
WinUI 2 under UWP and WinUI 3 under WinAppSdk both use TargetFramework net*-windows10.*
(use the 'IsUwp' and 'IsWinAppSdk' properties below to tell them apart)
However, under Uno-powered platforms, both WinUI 2 and 3 can share the same TargetFramework.

MSBuild doesn't play nicely with this out of the box, so we've made it easy for you.
Expand Down
4 changes: 2 additions & 2 deletions components/Converters/samples/Dependencies.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!--
WinUI 2 under UWP uses TargetFramework uap10.0.*
WinUI 3 under WinAppSdk uses TargetFramework net6.0-windows10.*
WinUI 2 under UWP and WinUI 3 under WinAppSdk both use TargetFramework net*-windows10.*
(use the 'IsUwp' and 'IsWinAppSdk' properties below to tell them apart)
However, under Uno-powered platforms, both WinUI 2 and 3 can share the same TargetFramework.

MSBuild doesn't play nicely with this out of the box, so we've made it easy for you.
Expand Down
4 changes: 2 additions & 2 deletions components/Converters/src/ColorToDisplayNameConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ public object Convert(
return DependencyProperty.UnsetValue;
}

#if WINDOWS_UWP && NET8_0_OR_GREATER
// Windows.UI.ColorHelper not yet supported on modern uwp.
#if WINDOWS_UWP
// Windows.UI.ColorHelper not yet supported on UWP.
// Following advice from Sergio0694
return color.ToString();
#elif WINUI2
Expand Down
4 changes: 2 additions & 2 deletions components/Converters/src/Dependencies.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!--
WinUI 2 under UWP uses TargetFramework uap10.0.*
WinUI 3 under WinAppSdk uses TargetFramework net6.0-windows10.*
WinUI 2 under UWP and WinUI 3 under WinAppSdk both use TargetFramework net*-windows10.*
(use the 'IsUwp' and 'IsWinAppSdk' properties below to tell them apart)
However, under Uno-powered platforms, both WinUI 2 and 3 can share the same TargetFramework.

MSBuild doesn't play nicely with this out of the box, so we've made it easy for you.
Expand Down
2 changes: 0 additions & 2 deletions components/Converters/src/TaskResultConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ 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 partial class TaskResultConverter : IValueConverter
{
/// <inheritdoc/>
Expand Down
4 changes: 2 additions & 2 deletions components/DeveloperTools/samples/Dependencies.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!--
WinUI 2 under UWP uses TargetFramework uap10.0.*
WinUI 3 under WinAppSdk uses TargetFramework net6.0-windows10.*
WinUI 2 under UWP and WinUI 3 under WinAppSdk both use TargetFramework net*-windows10.*
(use the 'IsUwp' and 'IsWinAppSdk' properties below to tell them apart)
However, under Uno-powered platforms, both WinUI 2 and 3 can share the same TargetFramework.

MSBuild doesn't play nicely with this out of the box, so we've made it easy for you.
Expand Down
4 changes: 2 additions & 2 deletions components/DeveloperTools/src/Dependencies.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!--
WinUI 2 under UWP uses TargetFramework uap10.0.*
WinUI 3 under WinAppSdk uses TargetFramework net6.0-windows10.*
WinUI 2 under UWP and WinUI 3 under WinAppSdk both use TargetFramework net*-windows10.*
(use the 'IsUwp' and 'IsWinAppSdk' properties below to tell them apart)
However, under Uno-powered platforms, both WinUI 2 and 3 can share the same TargetFramework.

MSBuild doesn't play nicely with this out of the box, so we've made it easy for you.
Expand Down
4 changes: 2 additions & 2 deletions components/Extensions/samples/Dependencies.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!--
WinUI 2 under UWP uses TargetFramework uap10.0.*
WinUI 3 under WinAppSdk uses TargetFramework net6.0-windows10.*
WinUI 2 under UWP and WinUI 3 under WinAppSdk both use TargetFramework net*-windows10.*
(use the 'IsUwp' and 'IsWinAppSdk' properties below to tell them apart)
However, under Uno-powered platforms, both WinUI 2 and 3 can share the same TargetFramework.

MSBuild doesn't play nicely with this out of the box, so we've made it easy for you.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@
<ItemGroup>
<PackageReference Include="CommunityToolkit.Common" Version="8.2.1" />

<PackageReference Include="PolySharp" Version="1.13.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>

<!-- TODO: We should figure out a better way to share internal helpers without duplication -->
<!-- e.g. Animations is using ThrowIfNull helper... -->
<InternalsVisibleTo Include="CommunityToolkit.WinUI.Animations" />
Expand Down
4 changes: 2 additions & 2 deletions components/Extensions/src/Dependencies.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!--
WinUI 2 under UWP uses TargetFramework uap10.0.*
WinUI 3 under WinAppSdk uses TargetFramework net6.0-windows10.*
WinUI 2 under UWP and WinUI 3 under WinAppSdk both use TargetFramework net*-windows10.*
(use the 'IsUwp' and 'IsWinAppSdk' properties below to tell them apart)
However, under Uno-powered platforms, both WinUI 2 and 3 can share the same TargetFramework.

MSBuild doesn't play nicely with this out of the box, so we've made it easy for you.
Expand Down
2 changes: 0 additions & 2 deletions components/Extensions/src/Markup/EnumValuesExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ 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 partial class EnumValuesExtension : MarkupExtension
{
/// <summary>
Expand Down
Loading
Loading