Skip to content

Commit

Permalink
Merge branch 'main' into chore/fix.typos.properties.info
Browse files Browse the repository at this point in the history
  • Loading branch information
niels9001 authored Aug 27, 2024
2 parents f5da9fc + 0b81fca commit 75f1fb6
Show file tree
Hide file tree
Showing 66 changed files with 123 additions and 82 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ jobs:
uses: actions/upload-artifact@v4
if: ${{ env.IS_RELEASE == 'true' }}
with:
name: signed-nuget-packages-${{ matrix.platform }}
name: signed-nuget-packages-${{ matrix.winui }}
if-no-files-found: error
path: |
${{ github.workspace }}/packages/**/*.nupkg
Expand All @@ -375,18 +375,18 @@ jobs:
strategy:
fail-fast: false # prevent one matrix pipeline from being cancelled if one fails, we want them both to run to completion.
matrix:
platform: [WinUI2, WinUI3]
winui: [2, 3]

steps:
- name: Install .NET SDK v${{ env.DOTNET_VERSION }}
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Download signed packages for ${{ matrix.platform }}
- name: Download signed packages for WinUI ${{ matrix.winui }}
uses: actions/download-artifact@v4
with:
name: signed-nuget-packages-${{ matrix.platform }}
name: signed-nuget-packages-${{ matrix.winui }}
path: ./packages

- name: Push to NuGet.org
Expand Down
4 changes: 2 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"omnisharp.defaultLaunchSolution": "CommunityToolkit.AllComponents.sln",
"omnisharp.disableMSBuildDiagnosticWarning": true,
"omnisharp.enableRoslynAnalyzers": true,
"omnisharp.useGlobalMono": "never",
Expand All @@ -8,5 +7,6 @@
"csharp.suppressDotnetRestoreNotification": true,
"csharp.semanticHighlighting.enabled": true,
"omnisharp.enableMsBuildLoadProjectsOnDemand": true,
"dotnet.completion.showCompletionItemsFromUnimportedNamespaces": true
"dotnet.completion.showCompletionItemsFromUnimportedNamespaces": true,
"dotnet.defaultSolution": "CommunityToolkit.AllComponents.sln"
}
4 changes: 2 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>
<PropertyGroup>
<MajorVersion>8</MajorVersion>
<MinorVersion>1</MinorVersion>
<MinorVersion>2</MinorVersion>

<PackageIdPrefix>CommunityToolkit</PackageIdPrefix>
<RepositoryDirectory>$([MSBuild]::EnsureTrailingSlash('$(MSBuildThisFileDirectory)'))</RepositoryDirectory>
Expand All @@ -26,7 +26,7 @@
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<NoWarn>$(NoWarn);Uno0001</NoWarn>
<!-- TODO: Turn off sample pages needing samples for now, for initial commit -->
<NoWarn>$(NoWarn);TKSMPL0014</NoWarn>
<NoWarn>$(NoWarn);TKSMPL0014;</NoWarn>
</PropertyGroup>

<Import Project="Windows.Toolkit.Common.props" />
Expand Down
12 changes: 8 additions & 4 deletions ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ _Building something cool? Want to engage with other developers? Want to contribu

### [Try out our Sample Gallery from the Microsoft Store](https://aka.ms/windowstoolkitapp)

Want to see the toolkit in action before jumping into the code? Download and play with the [Windows Community Toolkit Gallery](https://www.microsoft.com/store/apps/9nblggh4tlcq) from the Store.
Want to see the toolkit in action before jumping into the code? Download and play with the [Windows Community Toolkit Gallery](https://aka.ms/windowstoolkitapp) from the Store.

Please read the [Getting Started with the Windows Community Toolkit](https://docs.microsoft.com/dotnet/communitytoolkit/windows/getting-started) page for more detailed information about using the toolkit.

If you're updating from a pre-8.x version of the Windows Community Toolkit, see [our migration notes here](https://aka.ms/toolkit/windows/migration).

### Windows Community Toolkit Labs

Have an idea for a new feature? Want to checkout the latest things being built. _[Then head over to Windows Community Toolkit Labs](https://aka.ms/toolkit/labs/windows)_.
Expand All @@ -34,9 +36,11 @@ git clone --recurse-submodules https://github.com/CommunityToolkit/Windows.git
## Build Requirements

- Visual Studio 2022 (UWP & Desktop Workloads for .NET)
- .NET 6 SDK
- Windows App SDK
- Windows SDK 19041
- .NET 8 SDK
- Windows 10 SDK, version 2004 (10.0.19041.0)
- Windows 10 21H1 (Build 19043) or greater
- Run `dotnet tool restore` from the project root to install SlnGen
- Run build scripts from the [Developer Command Prompt for Visual Studio](https://learn.microsoft.com/visualstudio/ide/reference/command-prompt-powershell) or from elsewhere after adding `MSBuild.exe` to your PATH

## 🚀 Contribution

Expand Down
2 changes: 1 addition & 1 deletion components/Animations/src/Xaml/AnimationScope.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace CommunityToolkit.WinUI.Animations;
/// A container of <see cref="ITimeline"/> elements that can be used to conceptually group animations
/// together and to assign shared properties to be applied to all the contained items automatically.
/// </summary>
public sealed class AnimationScope : DependencyObjectCollection, ITimeline
public sealed partial class AnimationScope : DependencyObjectCollection, ITimeline
{
/// <summary>
/// Gets or sets the optional initial delay for the animation.
Expand Down
2 changes: 1 addition & 1 deletion components/Animations/src/Xaml/AnimationSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace CommunityToolkit.WinUI.Animations;
/// A collection of animations that can be grouped together. This type represents a composite animation
/// (such as <see cref="Storyboard"/>) that can be executed on a given element.
/// </summary>
public sealed class AnimationSet : DependencyObjectCollection
public sealed partial class AnimationSet : DependencyObjectCollection
{
/// <summary>
/// A conditional weak table storing <see cref="CancellationTokenSource"/> instances associated with animations
Expand Down
2 changes: 1 addition & 1 deletion components/Animations/src/Xaml/ImplicitAnimationSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ namespace CommunityToolkit.WinUI.Animations;
/// one <see cref="ImplicitAnimationSet"/> to another, and doing so will add unnecessary runtime overhead over time. If you want to apply the same animations
/// to multiple elements, simply create another <see cref="ImplicitAnimationSet"/> instance and another set of animations with the same properties within it.
/// </remarks>
public sealed class ImplicitAnimationSet : DependencyObjectCollection
public sealed partial class ImplicitAnimationSet : DependencyObjectCollection
{
/// <summary>
/// Raised whenever any configuration change occurrs within the current <see cref="ImplicitAnimationSet"/> instance.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace CommunityToolkit.WinUI.Collections;
/// <summary>
/// Vector changed EventArgs
/// </summary>
internal class VectorChangedEventArgs : IVectorChangedEventArgs
internal partial class VectorChangedEventArgs : IVectorChangedEventArgs
{
/// <summary>
/// Initializes a new instance of the <see cref="VectorChangedEventArgs"/> class.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace CommunityToolkit.WinUI.Controls;
/// <summary>
/// Creates an accent color for a base color value.
/// </summary>
public class AccentColorConverter : IValueConverter
public partial class AccentColorConverter : IValueConverter
{
/// <summary>
/// The amount to change the Value channel for each accent color step.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace CommunityToolkit.WinUI.Controls;
/// <summary>
/// Converts a color to a hex string and vice versa.
/// </summary>
public class ColorToHexConverter : IValueConverter
public partial class ColorToHexConverter : IValueConverter
{
/// <inheritdoc/>
public object Convert(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace CommunityToolkit.WinUI.Controls;
/// <summary>
/// Gets a color, either black or white, depending on the brightness of the supplied color.
/// </summary>
public class ContrastBrushConverter : IValueConverter
public partial class ContrastBrushConverter : IValueConverter
{
/// <summary>
/// Gets or sets the alpha channel threshold below which a default color is used instead of black/white.
Expand Down
2 changes: 1 addition & 1 deletion components/Converters/src/BoolNegationConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace CommunityToolkit.WinUI.Converters;
/// <summary>
/// Value converter that applies NOT operator to a <see cref="bool"/> value.
/// </summary>
public class BoolNegationConverter : IValueConverter
public partial class BoolNegationConverter : IValueConverter
{
/// <summary>
/// Convert a boolean value to its negation.
Expand Down
2 changes: 1 addition & 1 deletion components/Converters/src/BoolToVisibilityConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace CommunityToolkit.WinUI.Converters;
/// <summary>
/// This class converts a boolean value into a Visibility enumeration.
/// </summary>
public class BoolToVisibilityConverter : BoolToObjectConverter
public partial class BoolToVisibilityConverter : BoolToObjectConverter
{
/// <summary>
/// Initializes a new instance of the <see cref="BoolToVisibilityConverter"/> class.
Expand Down
2 changes: 1 addition & 1 deletion components/Converters/src/CollectionVisibilityConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace CommunityToolkit.WinUI.Converters;
/// <summary>
/// This class converts a collection size to visibility.
/// </summary>
public class CollectionVisibilityConverter : EmptyCollectionToObjectConverter
public partial class CollectionVisibilityConverter : EmptyCollectionToObjectConverter
{
/// <summary>
/// Initializes a new instance of the <see cref="CollectionVisibilityConverter"/> class.
Expand Down
14 changes: 8 additions & 6 deletions components/Converters/src/ColorToDisplayNameConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace CommunityToolkit.WinUI.Converters;
/// <summary>
/// Gets the approximated display name for the color.
/// </summary>
public class ColorToDisplayNameConverter : IValueConverter
public partial class ColorToDisplayNameConverter : IValueConverter
{
/// <inheritdoc/>
public object Convert(
Expand All @@ -33,12 +33,14 @@ public object Convert(
// Invalid color value provided
return DependencyProperty.UnsetValue;
}

#if !WINAPPSDK && !HAS_UNO
return Windows.UI.ColorHelper.ToDisplayName(color);
#else
// ToDisplayName not yet supported on WASDK. See https://github.com/microsoft/microsoft-ui-xaml/issues/8287
#if HAS_UNO
// ColorHelper.ToDisplayName not yet supported on Uno Platform.
// Track https://github.com/unoplatform/uno/issues/18004
return "Not supported";
#elif WINUI2
return Windows.UI.ColorHelper.ToDisplayName(color);
#elif WINUI3
return Microsoft.UI.ColorHelper.ToDisplayName(color);
#endif
}

Expand Down
2 changes: 1 addition & 1 deletion components/Converters/src/DoubleToVisibilityConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace CommunityToolkit.WinUI.Converters;
/// <summary>
/// This class converts a double value into a Visibility enumeration.
/// </summary>
public class DoubleToVisibilityConverter : DoubleToObjectConverter
public partial class DoubleToVisibilityConverter : DoubleToObjectConverter
{
/// <summary>
/// Initializes a new instance of the <see cref="DoubleToVisibilityConverter"/> class.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace CommunityToolkit.WinUI.Converters;
/// This class converts a collection size into an other object.
/// Can be used to convert to bind a visibility, a color or an image to the size of the collection.
/// </summary>
public class EmptyCollectionToObjectConverter : EmptyObjectToObjectConverter
public partial class EmptyCollectionToObjectConverter : EmptyObjectToObjectConverter
{
/// <summary>
/// Checks collection for emptiness.
Expand Down
2 changes: 1 addition & 1 deletion components/Converters/src/EmptyStringToObjectConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace CommunityToolkit.WinUI.Converters;
/// This class converts a string value into a an object (if the value is null or empty returns the false value).
/// Can be used to bind a visibility, a color or an image to the value of a string.
/// </summary>
public class EmptyStringToObjectConverter : EmptyObjectToObjectConverter
public partial class EmptyStringToObjectConverter : EmptyObjectToObjectConverter
{
/// <summary>
/// Checks string for emptiness.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace CommunityToolkit.WinUI.Converters;
/// <summary>
/// Converts a file size in bytes to a more human-readable friendly format using <see cref="CommunityToolkit.Common.Converters.ToFileSizeString(long)"/>
/// </summary>
public class FileSizeToFriendlyStringConverter : IValueConverter
public partial class FileSizeToFriendlyStringConverter : IValueConverter
{
/// <inheritdoc/>
public object Convert(object value, Type targetType, object parameter, string language)
Expand Down
2 changes: 1 addition & 1 deletion components/Converters/src/IFormattableToStringConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace CommunityToolkit.WinUI.Converters;
/// Value converter that converts an <see cref="IFormattable"/> to a formatted <see cref="string"/>.
/// The string format needs to be passed as the converter parameter.
/// </summary>
public class IFormattableToStringConverter : IValueConverter
public partial class IFormattableToStringConverter : IValueConverter
{
// TODO: Provide property to set a IFormatProvider for the 2nd parameter to ToString

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace CommunityToolkit.WinUI.Converters;
/// <summary>
/// Value converter that look up for the source string in the App Resources strings and returns its value, if found.
/// </summary>
public sealed class ResourceNameToResourceStringConverter : IValueConverter
public sealed partial class ResourceNameToResourceStringConverter : IValueConverter
{
#if WINAPPSDK && !HAS_UNO
private readonly ResourceManager _resourceManager = new ResourceManager();
Expand Down
2 changes: 1 addition & 1 deletion components/Converters/src/StringFormatConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace CommunityToolkit.WinUI.Converters;
/// <summary>
/// This class provides a binding converter to display formatted strings
/// </summary>
public class StringFormatConverter : IValueConverter
public partial class StringFormatConverter : IValueConverter
{
/// <summary>
/// Return the formatted string version of the source object.
Expand Down
2 changes: 1 addition & 1 deletion components/Converters/src/StringVisibilityConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace CommunityToolkit.WinUI.Converters;
/// <summary>
/// This class converts a string value into a Visibility value (if the value is null or empty returns a collapsed value).
/// </summary>
public class StringVisibilityConverter : EmptyStringToObjectConverter
public partial class StringVisibilityConverter : EmptyStringToObjectConverter
{
/// <summary>
/// Initializes a new instance of the <see cref="StringVisibilityConverter"/> class.
Expand Down
2 changes: 1 addition & 1 deletion components/Converters/src/TaskResultConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace CommunityToolkit.WinUI.Converters;
#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
public sealed partial class TaskResultConverter : IValueConverter
{
/// <inheritdoc/>
public object Convert(object value, Type targetType, object parameter, string language)
Expand Down
2 changes: 1 addition & 1 deletion components/Converters/src/VisibilityToBoolConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace CommunityToolkit.WinUI.Converters;
/// <summary>
/// This class converts a Visibility enumeration to a boolean value.
/// </summary>
public class VisibilityToBoolConverter : IValueConverter
public partial class VisibilityToBoolConverter : IValueConverter
{
/// <summary>
/// Convert a <see cref="Visibility"/> value to boolean.
Expand Down
15 changes: 12 additions & 3 deletions components/Extensions/src/Markup/Abstract/TextIconExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@

#if WINAPPSDK
using Microsoft.UI.Text;
#endif
#else
using Windows.UI.Text;
#endif

namespace CommunityToolkit.WinUI;

Expand Down Expand Up @@ -33,12 +34,20 @@ protected static FontFamily SymbolThemeFontFamily
/// <summary>
/// Gets or sets the thickness of the icon glyph.
/// </summary>
public FontWeight FontWeight { get; set; } = FontWeights.Normal;
#if WINUI3
public Windows.UI.Text.FontWeight FontWeight { get; set; } = Microsoft.UI.Text.FontWeights.Normal;
#elif WINUI2
public Windows.UI.Text.FontWeight FontWeight { get; set; } = Windows.UI.Text.FontWeights.Normal;
#endif

/// <summary>
/// Gets or sets the font style for the icon glyph.
/// </summary>
public FontStyle FontStyle { get; set; } = FontStyle.Normal;
#if WINUI3
public Windows.UI.Text.FontStyle FontStyle { get; set; } = Windows.UI.Text.FontStyle.Normal;
#elif WINUI2
public Windows.UI.Text.FontStyle FontStyle { get; set; } = Windows.UI.Text.FontStyle.Normal;
#endif

/// <summary>
/// Gets or sets the foreground <see cref="Brush"/> for the icon.
Expand Down
2 changes: 1 addition & 1 deletion components/Extensions/src/Markup/BitmapIconExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace CommunityToolkit.WinUI;
/// Custom <see cref="MarkupExtension"/> which can provide <see cref="BitmapIcon"/> values.
/// </summary>
[MarkupExtensionReturnType(ReturnType = typeof(BitmapIcon))]
public sealed class BitmapIconExtension : MarkupExtension
public sealed partial class BitmapIconExtension : MarkupExtension
{
/// <summary>
/// Gets or sets the <see cref="Uri"/> representing the image to display.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace CommunityToolkit.WinUI;
/// Custom <see cref="MarkupExtension"/> which can provide <see cref="BitmapIconSource"/> values.
/// </summary>
[MarkupExtensionReturnType(ReturnType = typeof(BitmapIconSource))]
public sealed class BitmapIconSourceExtension : MarkupExtension
public sealed partial class BitmapIconSourceExtension : MarkupExtension
{
/// <summary>
/// Gets or sets the <see cref="Uri"/> representing the image to display.
Expand Down
2 changes: 1 addition & 1 deletion components/Extensions/src/Markup/EnumValuesExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace CommunityToolkit.WinUI;
#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
public sealed partial class EnumValuesExtension : MarkupExtension
{
/// <summary>
/// Gets or sets the <see cref="global::System.Type"/> of the target <see langword="enum"/>
Expand Down
2 changes: 1 addition & 1 deletion components/Extensions/src/Markup/FontIconExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace CommunityToolkit.WinUI;
/// Custom <see cref="MarkupExtension"/> which can provide <see cref="FontIcon"/> values.
/// </summary>
[MarkupExtensionReturnType(ReturnType = typeof(FontIcon))]
public class FontIconExtension : TextIconExtension
public partial class FontIconExtension : TextIconExtension
{
/// <summary>
/// Gets or sets the <see cref="string"/> value representing the icon to display.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace CommunityToolkit.WinUI;
/// Custom <see cref="MarkupExtension"/> which can provide <see cref="FontIconSource"/> values.
/// </summary>
[MarkupExtensionReturnType(ReturnType = typeof(FontIconSource))]
public class FontIconSourceExtension : TextIconExtension
public partial class FontIconSourceExtension : TextIconExtension
{
/// <summary>
/// Gets or sets the <see cref="string"/> value representing the icon to display.
Expand Down
2 changes: 1 addition & 1 deletion components/Extensions/src/Markup/NullableBoolExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace CommunityToolkit.WinUI;
/// See https://wpdev.uservoice.com/forums/110705-universal-windows-platform/suggestions/17767198-nullable-dependency-properties.
/// </summary>
[MarkupExtensionReturnType(ReturnType = typeof(bool?))]
public class NullableBoolExtension : MarkupExtension
public partial class NullableBoolExtension : MarkupExtension
{
/// <summary>
/// Gets or sets a value indicating whether the value of the Boolean is true. Ignored if <see cref="IsNull"/> is true.
Expand Down
2 changes: 1 addition & 1 deletion components/Extensions/src/Markup/OnDeviceExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace CommunityToolkit.WinUI;
/// xmlns:ui="using:CommunityToolkit.WinUI.UI" />
/// </code>
/// </example>
public class OnDeviceExtension : MarkupExtension
public partial class OnDeviceExtension : MarkupExtension
{
/// <summary>
/// Gets the current device family.
Expand Down
Loading

0 comments on commit 75f1fb6

Please sign in to comment.