├── .github └── workflows │ └── SignClientFileList.txt ├── .vscode ├── extensions.json ├── tasks.json └── settings.json ├── CommunityToolkitLabs-Header.png ├── .gitmodules ├── components ├── Ribbon │ ├── OpenSolution.bat │ ├── samples │ │ ├── Assets │ │ │ └── Ribbon.png │ │ ├── Ribbon.Samples.csproj │ │ └── RibbonCustomSample.xaml.cs │ ├── tests │ │ ├── RibbonTestPage.xaml.cs │ │ ├── RibbonTestPage.xaml │ │ ├── Ribbon.Tests.shproj │ │ └── Ribbon.Tests.projitems │ └── src │ │ ├── Themes │ │ └── Generic.xaml │ │ ├── MultiTarget.props │ │ └── CommunityToolkit.WinUI.Controls.Ribbon.csproj ├── Adorners │ ├── OpenSolution.bat │ ├── samples │ │ ├── Assets │ │ │ ├── icon.png │ │ │ ├── davis-vargas-2vSNlKHn9h0-unsplash.jpg │ │ │ └── sergey-zolkin-m9qMoh-scfE-unsplash.jpg │ │ ├── AdornersInfoBadgeSample.xaml.cs │ │ ├── InPlaceTextEditor │ │ │ └── InPlaceTextEditorAdorner.xaml.cs │ │ ├── InfoBadgeWithoutAdorner.xaml.cs │ │ ├── Adorners.Samples.csproj │ │ ├── ResizeElement │ │ │ └── ResizeElementAdornerCanvasSample.xaml.cs │ │ ├── ElementHighlightAdornerSample.xaml.cs │ │ ├── AdornersTabBadgeSample.xaml.cs │ │ └── Dependencies.props │ ├── src │ │ ├── MultiTarget.props │ │ ├── CommunityToolkit.WinUI.Adorners.csproj │ │ ├── InputValidation │ │ │ └── InputValidationAdorner.xaml.cs │ │ ├── Themes │ │ │ └── Generic.xaml │ │ ├── AdornerOfT.cs │ │ └── ResizeElement │ │ │ └── Thumb │ │ │ └── ResizePositionMode.cs │ └── tests │ │ ├── ExampleAdornersTestPage.xaml.cs │ │ ├── ExampleAdornersTestPage.xaml │ │ ├── Adorners.Tests.shproj │ │ └── Adorners.Tests.projitems ├── AppServices │ ├── OpenSolution.bat │ ├── CommunityToolkit.AppServices.SourceGenerators │ │ ├── AnalyzerReleases.Unshipped.md │ │ ├── Models │ │ │ └── AppServiceInfo.cs │ │ └── AnalyzerReleases.Shipped.md │ ├── src │ │ ├── MultiTarget.props │ │ ├── AppServiceAttribute.cs │ │ └── GeneratedAppServiceHostAttribute.cs │ ├── tests │ │ ├── AppServices.Tests.projitems │ │ └── AppServices.Tests.shproj │ └── AppServices.SourceGenerators.Tests │ │ └── AppServices.SourceGenerators.Tests.csproj ├── CanvasView │ ├── OpenSolution.bat │ ├── samples │ │ ├── Assets │ │ │ └── CanvasView.png │ │ ├── CanvasView.Samples.csproj │ │ └── CanvasView.md │ ├── tests │ │ ├── ExampleCanvasViewTestPage.xaml.cs │ │ ├── ExampleCanvasViewTestPage.xaml │ │ ├── CanvasView.Tests.shproj │ │ └── CanvasView.Tests.projitems │ └── src │ │ └── CommunityToolkit.WinUI.Controls.CanvasView.csproj ├── DataTable │ ├── OpenSolution.bat │ ├── samples │ │ ├── Assets │ │ │ └── DataTable.png │ │ └── DataTable.Samples.csproj │ ├── src │ │ ├── MultiTarget.props │ │ ├── Themes │ │ │ └── Generic.xaml │ │ ├── AdditionalAssemblyInfo.cs │ │ └── CommunityToolkit.WinUI.Controls.DataTable.csproj │ └── tests │ │ ├── DataTableColumnAutoSizeTestPage.xaml.cs │ │ ├── DataTable.Tests.shproj │ │ └── DataTable.Tests.projitems ├── Marquee │ ├── OpenSolution.bat │ ├── samples │ │ ├── Assets │ │ │ └── Marquee.png │ │ ├── MarqueeText.Samples.csproj │ │ └── MarqueeBehaviorSample.xaml.cs │ ├── src │ │ ├── Themes │ │ │ └── Generic.xaml │ │ ├── MarqueeDirection.cs │ │ ├── CommunityToolkit.WinUI.Controls.Marquee.csproj │ │ └── MarqueeBehavior.cs │ └── tests │ │ ├── ExampleMarqueeTestPage.xaml.cs │ │ ├── Marquee.Tests.shproj │ │ └── Marquee.Tests.projitems ├── RivePlayer │ ├── OpenSolution.bat │ ├── samples │ │ ├── Assets │ │ │ └── RivePlayer.png │ │ ├── animated-login-screen.riv │ │ ├── RivePlayer.Samples.csproj │ │ └── RivePlayerCustomSample.xaml.cs │ ├── src │ │ ├── MultiTarget.props │ │ ├── Themes │ │ │ └── Generic.xaml │ │ └── CommunityToolkit.WinUI.Rive.RivePlayer.csproj │ └── tests │ │ ├── ExampleRivePlayerTestPage.xaml.cs │ │ ├── ExampleRivePlayerTestPage.xaml │ │ ├── RivePlayer.Tests.shproj │ │ └── RivePlayer.Tests.projitems ├── Shimmer │ ├── OpenSolution.bat │ ├── samples │ │ ├── Assets │ │ │ ├── Owl.jpg │ │ │ └── Shimmer.png │ │ ├── MultiTarget.props │ │ ├── Shimmer.md │ │ ├── Shimmer.Samples.csproj │ │ └── ShimmerSample.xaml.cs │ ├── src │ │ ├── MultiTarget.props │ │ ├── Themes │ │ │ └── Generic.xaml │ │ └── CommunityToolkit.WinUI.Controls.Shimmer.csproj │ └── tests │ │ ├── ExampleShimmerTestPage.xaml.cs │ │ ├── ExampleShimmerTestPage.xaml │ │ ├── Shimmer.Tests.shproj │ │ └── Shimmer.Tests.projitems ├── TitleBar │ ├── OpenSolution.bat │ ├── samples │ │ ├── Assets │ │ │ ├── icon.png │ │ │ ├── Avatar.png │ │ │ └── AppTitleBarIcon.png │ │ ├── SamplePages │ │ │ ├── FirstPage.xaml.cs │ │ │ ├── SecondPage.xaml.cs │ │ │ ├── FirstPage.xaml │ │ │ └── SecondPage.xaml │ │ └── TitleBar.Samples.csproj │ ├── src │ │ ├── MultiTarget.props │ │ ├── Themes │ │ │ └── Generic.xaml │ │ ├── AdditionalAssemblyInfo.cs │ │ └── CommunityToolkit.WinUI.Controls.TitleBar.csproj │ └── tests │ │ ├── ExampleTitleBarTestPage.xaml.cs │ │ ├── ExampleTitleBarTestPage.xaml │ │ ├── TitleBar.Tests.shproj │ │ └── TitleBar.Tests.projitems ├── TokenView │ ├── OpenSolution.bat │ ├── samples │ │ ├── Assets │ │ │ └── TokenView.png │ │ └── TokenViewRemoveSample.cs │ ├── tests │ │ ├── ExampleTokenViewTestPage.xaml.cs │ │ ├── ExampleTokenViewTestPage.xaml │ │ ├── TokenView.Tests.shproj │ │ └── TokenView.Tests.projitems │ └── src │ │ ├── Helpers │ │ └── ControlHelpers.cs │ │ ├── Themes │ │ └── Generic.xaml │ │ ├── CommunityToolkit.WinUI.Controls.TokenView.csproj │ │ └── TokenItem │ │ └── TokenItemRemovingEventArgs.cs ├── CanvasLayout │ ├── OpenSolution.bat │ ├── samples │ │ ├── Assets │ │ │ └── CanvasLayout.png │ │ ├── CanvasLayout.md │ │ └── CanvasLayout.Samples.csproj │ ├── tests │ │ ├── ExampleCanvasLayoutTestPage.xaml.cs │ │ ├── ExampleCanvasLayoutTestPage.xaml │ │ ├── CanvasLayout.Tests.shproj │ │ └── CanvasLayout.Tests.projitems │ └── src │ │ └── CommunityToolkit.WinUI.Controls.CanvasLayout.csproj ├── ColorAnalyzer │ ├── OpenSolution.bat │ ├── samples │ │ ├── Assets │ │ │ ├── icon.png │ │ │ └── StockImages │ │ │ │ ├── Paint.jpg │ │ │ │ ├── Flowers.jpg │ │ │ │ └── Headphones.jpg │ │ ├── ColorPaletteSampler │ │ │ ├── BaseColorSample.xaml.cs │ │ │ ├── AccentColorSample.xaml.cs │ │ │ ├── ColorWeightSample.xaml.cs │ │ │ ├── MultiplePaletteSelectorSample.xaml.cs │ │ │ └── ColorPaletteSamplerToolkitSample.cs │ │ ├── ContrastHelper │ │ │ ├── TextBlockContrastSample.xaml.cs │ │ │ └── SolidColorBrushContrastSample.xaml.cs │ │ └── ColorAnalyzer.Samples.csproj │ ├── src │ │ ├── MultiTarget.props │ │ ├── CommunityToolkit.WinUI.ColorAnalyzer.csproj │ │ ├── ColorPaletteSampler │ │ │ └── PaletteSelectors │ │ │ │ ├── BaseColorPaletteSelector.cs │ │ │ │ ├── AccentColorPaletteSelector.cs │ │ │ │ └── ColorWeightPaletteSelector.cs │ │ └── PaletteColor.cs │ └── tests │ │ ├── ColorAnalyzer.Tests.projitems │ │ ├── ExampleAccentAnalyzerTestClass.cs │ │ └── ColorAnalyzer.Tests.shproj ├── Notifications │ ├── OpenSolution.bat │ ├── src │ │ ├── MultiTarget.props │ │ ├── Adaptive │ │ │ ├── Elements │ │ │ │ ├── Element_AdaptiveImageEnums.cs │ │ │ │ └── Element_AdaptiveProgressBar.cs │ │ │ ├── IAdaptiveChild.cs │ │ │ ├── IAdaptiveSubgroupChild.cs │ │ │ ├── BaseTextHelper.cs │ │ │ ├── AdaptiveSubgroupEnums.cs │ │ │ └── IBaseText.cs │ │ ├── Toasts │ │ │ ├── IToastInput.cs │ │ │ ├── Elements │ │ │ │ └── IElement_ToastActivatable.cs │ │ │ ├── IToastBindingGenericChild.cs │ │ │ ├── ToastGenericAppLogoEnums.cs │ │ │ ├── IToastActions.cs │ │ │ └── IToastButton.cs │ │ ├── Tiles │ │ │ ├── Elements │ │ │ │ ├── TileElementsCommon.cs │ │ │ │ └── Element_Tile.cs │ │ │ ├── ITileBindingContentAdaptiveChild.cs │ │ │ ├── TileTextStacking.cs │ │ │ ├── TileCommon.cs │ │ │ └── TileSizeToAdaptiveTemplateConverter.cs │ │ └── Common │ │ │ ├── Serialization │ │ │ ├── IHaveXmlName.cs │ │ │ ├── IHaveXmlText.cs │ │ │ ├── IHaveXmlChildren.cs │ │ │ ├── IHaveXmlAdditionalProperties.cs │ │ │ └── IHaveXmlNamedProperties.cs │ │ │ ├── NotificationContentValidationException.cs │ │ │ ├── ArgumentValidator.cs │ │ │ └── INotificationContent.cs │ └── tests │ │ └── Notifications.Tests.shproj ├── OpacityMaskView │ ├── OpenSolution.bat │ ├── samples │ │ ├── Assets │ │ │ ├── Owl3.jpg │ │ │ └── icon.png │ │ ├── OpacityMaskView.md │ │ ├── OpacityMaskView.Samples.csproj │ │ └── OpacityMaskViewSample.xaml.cs │ ├── src │ │ ├── MultiTarget.props │ │ ├── Themes │ │ │ └── Generic.xaml │ │ └── CommunityToolkit.WinUI.Controls.OpacityMaskView.csproj │ └── tests │ │ ├── OpacityMaskView.Tests.projitems │ │ └── OpacityMaskView.Tests.shproj ├── TransitionHelper │ ├── OpenSolution.bat │ ├── samples │ │ ├── Assets │ │ │ ├── Owl2.jpg │ │ │ └── TransitionHelper.png │ │ ├── MultiTarget.props │ │ ├── TransitionHelper.md │ │ ├── TransitionHelperFullExample.xaml.cs │ │ ├── TransitionHelper.Samples.csproj │ │ └── CustomTextScalingCalculator.cs │ ├── src │ │ ├── MultiTarget.props │ │ ├── Properties │ │ │ └── IsExternalInit.cs │ │ ├── Enums │ │ │ └── VisualStateToggleMethod.cs │ │ ├── IScalingCalculator.cs │ │ └── CommunityToolkit.WinUI.TransitionHelper.csproj │ └── tests │ │ ├── TransitionHelper.Tests.projitems │ │ └── TransitionHelper.Tests.shproj ├── MarkdownTextBlock │ ├── OpenSolution.bat │ ├── samples │ │ ├── Assets │ │ │ └── MarkdownTextBlock.png │ │ └── MarkdownTextBlock.Samples.csproj │ ├── src │ │ ├── ISVGRenderer.cs │ │ ├── TextElements │ │ │ ├── HtmlElementType.cs │ │ │ ├── IAddChild.cs │ │ │ ├── BulletType.cs │ │ │ ├── MyLineBreak.cs │ │ │ └── MyInlineText.cs │ │ ├── ImageProvider.cs │ │ ├── MultiTarget.props │ │ ├── Renderers │ │ │ ├── UWPObjectRenderer.cs │ │ │ └── ObjectRenderers │ │ │ │ ├── Inlines │ │ │ │ ├── ContainerInlineRenderer.cs │ │ │ │ ├── CodeInlineRenderer.cs │ │ │ │ ├── LiteralInlineRenderer.cs │ │ │ │ ├── HtmlEntityInlineRenderer.cs │ │ │ │ ├── HtmlInlineRenderer.cs │ │ │ │ ├── DelimiterInlineRenderer.cs │ │ │ │ └── LineBreakInlineRenderer.cs │ │ │ │ ├── CodeBlockRenderer.cs │ │ │ │ ├── ListItemRenderer.cs │ │ │ │ ├── Extensions │ │ │ │ └── TaskListRenderer.cs │ │ │ │ ├── ThematicBreakRenderer.cs │ │ │ │ ├── HeadingRenderer.cs │ │ │ │ ├── QuoteBlockRenderer.cs │ │ │ │ └── ParagraphRenderer.cs │ │ ├── Themes │ │ │ └── Generic.xaml │ │ ├── MarkdownConfig.cs │ │ └── LinkClickedEventArgs.cs │ └── tests │ │ ├── ExampleMarkdownTextBlockTestPage.xaml.cs │ │ ├── ExampleMarkdownTextBlockTestPage.xaml │ │ └── MarkdownTextBlock.Tests.shproj ├── DependencyPropertyGenerator │ ├── OpenSolution.bat │ ├── samples │ │ ├── Assets │ │ │ └── icon.png │ │ ├── DependencyPropertyGenerator.Samples.csproj │ │ └── Dependencies.props │ ├── CommunityToolkit.DependencyPropertyGenerator.SourceGenerators │ │ ├── AnalyzerReleases.Unshipped.md │ │ ├── Constants │ │ │ ├── WellKnownTrackingNames.cs │ │ │ └── WellKnownPropertyNames.cs │ │ └── Extensions │ │ │ └── SyntaxTokenExtensions.cs │ ├── .gitattributes │ ├── src │ │ └── MultiTarget.props │ ├── tests │ │ ├── DependencyPropertyGenerator.Tests.projitems │ │ └── DependencyPropertyGenerator.Tests.shproj │ └── CommunityToolkit.DependencyPropertyGenerator.CodeFixers │ │ └── CommunityToolkit.DependencyPropertyGenerator.CodeFixers.csproj └── Extensions.DependencyInjection │ ├── OpenSolution.bat │ ├── CommunityToolkit.Extensions.DependencyInjection.SourceGenerators │ ├── AnalyzerReleases.Unshipped.md │ ├── Models │ │ ├── ServiceRegistrationKind.cs │ │ └── ServiceCollectionInfo.cs │ ├── AnalyzerReleases.Shipped.md │ └── Extensions │ │ └── ISymbolExtensions.cs │ ├── src │ └── MultiTarget.props │ └── tests │ └── Extensions.DependencyInjection.Tests.projitems ├── GenerateAllSolution.bat ├── global.json ├── nuget.config ├── .config └── dotnet-tools.json └── .devcontainer └── default.code-workspace /.github/workflows/SignClientFileList.txt: -------------------------------------------------------------------------------- 1 | **/CommunityToolkit.* -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "ms-dotnettools.csdevkit", 4 | ] 5 | } -------------------------------------------------------------------------------- /CommunityToolkitLabs-Header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CommunityToolkit/Labs-Windows/HEAD/CommunityToolkitLabs-Header.png -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "tooling"] 2 | path = tooling 3 | url = https://github.com/CommunityToolkit/Tooling-Windows-Submodule.git 4 | -------------------------------------------------------------------------------- /components/Ribbon/OpenSolution.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | powershell ..\..\tooling\ProjectHeads\GenerateSingleSampleHeads.ps1 -componentPath %CD% %* -------------------------------------------------------------------------------- /components/Adorners/OpenSolution.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | powershell ..\..\tooling\ProjectHeads\GenerateSingleSampleHeads.ps1 -componentPath %CD% %* -------------------------------------------------------------------------------- /components/AppServices/OpenSolution.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | powershell ..\..\tooling\ProjectHeads\GenerateSingleSampleHeads.ps1 -componentPath %CD% %* -------------------------------------------------------------------------------- /components/CanvasView/OpenSolution.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | powershell ..\..\tooling\ProjectHeads\GenerateSingleSampleHeads.ps1 -componentPath %CD% %* -------------------------------------------------------------------------------- /components/DataTable/OpenSolution.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | powershell ..\..\tooling\ProjectHeads\GenerateSingleSampleHeads.ps1 -componentPath %CD% %* -------------------------------------------------------------------------------- /components/Marquee/OpenSolution.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | powershell ..\..\tooling\ProjectHeads\GenerateSingleSampleHeads.ps1 -componentPath %CD% %* -------------------------------------------------------------------------------- /components/RivePlayer/OpenSolution.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | powershell ..\..\tooling\ProjectHeads\GenerateSingleSampleHeads.ps1 -componentPath %CD% %* -------------------------------------------------------------------------------- /components/Shimmer/OpenSolution.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | powershell ..\..\tooling\ProjectHeads\GenerateSingleSampleHeads.ps1 -componentPath %CD% %* -------------------------------------------------------------------------------- /components/Shimmer/samples/Assets/Owl.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CommunityToolkit/Labs-Windows/HEAD/components/Shimmer/samples/Assets/Owl.jpg -------------------------------------------------------------------------------- /components/TitleBar/OpenSolution.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | powershell ..\..\tooling\ProjectHeads\GenerateSingleSampleHeads.ps1 -componentPath %CD% %* -------------------------------------------------------------------------------- /components/TokenView/OpenSolution.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | powershell ..\..\tooling\ProjectHeads\GenerateSingleSampleHeads.ps1 -componentPath %CD% %* -------------------------------------------------------------------------------- /components/Adorners/samples/Assets/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CommunityToolkit/Labs-Windows/HEAD/components/Adorners/samples/Assets/icon.png -------------------------------------------------------------------------------- /components/CanvasLayout/OpenSolution.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | powershell ..\..\tooling\ProjectHeads\GenerateSingleSampleHeads.ps1 -componentPath %CD% %* -------------------------------------------------------------------------------- /components/ColorAnalyzer/OpenSolution.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | powershell ..\..\tooling\ProjectHeads\GenerateSingleSampleHeads.ps1 -componentPath %CD% %* -------------------------------------------------------------------------------- /components/Notifications/OpenSolution.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | powershell ..\..\tooling\ProjectHeads\GenerateSingleSampleHeads.ps1 -componentPath %CD% %* -------------------------------------------------------------------------------- /components/OpacityMaskView/OpenSolution.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | powershell ..\..\tooling\ProjectHeads\GenerateSingleSampleHeads.ps1 -componentPath %CD% %* -------------------------------------------------------------------------------- /components/Ribbon/samples/Assets/Ribbon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CommunityToolkit/Labs-Windows/HEAD/components/Ribbon/samples/Assets/Ribbon.png -------------------------------------------------------------------------------- /components/TitleBar/samples/Assets/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CommunityToolkit/Labs-Windows/HEAD/components/TitleBar/samples/Assets/icon.png -------------------------------------------------------------------------------- /components/TransitionHelper/OpenSolution.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | powershell ..\..\tooling\ProjectHeads\GenerateSingleSampleHeads.ps1 -componentPath %CD% %* -------------------------------------------------------------------------------- /components/MarkdownTextBlock/OpenSolution.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | powershell ..\..\tooling\ProjectHeads\GenerateSingleSampleHeads.ps1 -componentPath %CD% %* -------------------------------------------------------------------------------- /components/Marquee/samples/Assets/Marquee.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CommunityToolkit/Labs-Windows/HEAD/components/Marquee/samples/Assets/Marquee.png -------------------------------------------------------------------------------- /components/Shimmer/samples/Assets/Shimmer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CommunityToolkit/Labs-Windows/HEAD/components/Shimmer/samples/Assets/Shimmer.png -------------------------------------------------------------------------------- /components/TitleBar/samples/Assets/Avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CommunityToolkit/Labs-Windows/HEAD/components/TitleBar/samples/Assets/Avatar.png -------------------------------------------------------------------------------- /components/ColorAnalyzer/samples/Assets/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CommunityToolkit/Labs-Windows/HEAD/components/ColorAnalyzer/samples/Assets/icon.png -------------------------------------------------------------------------------- /components/DataTable/samples/Assets/DataTable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CommunityToolkit/Labs-Windows/HEAD/components/DataTable/samples/Assets/DataTable.png -------------------------------------------------------------------------------- /components/TokenView/samples/Assets/TokenView.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CommunityToolkit/Labs-Windows/HEAD/components/TokenView/samples/Assets/TokenView.png -------------------------------------------------------------------------------- /components/CanvasView/samples/Assets/CanvasView.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CommunityToolkit/Labs-Windows/HEAD/components/CanvasView/samples/Assets/CanvasView.png -------------------------------------------------------------------------------- /components/DependencyPropertyGenerator/OpenSolution.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | powershell ..\..\tooling\ProjectHeads\GenerateSingleSampleHeads.ps1 -componentPath %CD% %* -------------------------------------------------------------------------------- /components/Extensions.DependencyInjection/OpenSolution.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | powershell ..\..\tooling\ProjectHeads\GenerateSingleSampleHeads.ps1 -componentPath %CD% %* -------------------------------------------------------------------------------- /components/OpacityMaskView/samples/Assets/Owl3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CommunityToolkit/Labs-Windows/HEAD/components/OpacityMaskView/samples/Assets/Owl3.jpg -------------------------------------------------------------------------------- /components/OpacityMaskView/samples/Assets/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CommunityToolkit/Labs-Windows/HEAD/components/OpacityMaskView/samples/Assets/icon.png -------------------------------------------------------------------------------- /components/RivePlayer/samples/Assets/RivePlayer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CommunityToolkit/Labs-Windows/HEAD/components/RivePlayer/samples/Assets/RivePlayer.png -------------------------------------------------------------------------------- /components/TransitionHelper/samples/Assets/Owl2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CommunityToolkit/Labs-Windows/HEAD/components/TransitionHelper/samples/Assets/Owl2.jpg -------------------------------------------------------------------------------- /components/TitleBar/samples/Assets/AppTitleBarIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CommunityToolkit/Labs-Windows/HEAD/components/TitleBar/samples/Assets/AppTitleBarIcon.png -------------------------------------------------------------------------------- /components/CanvasLayout/samples/Assets/CanvasLayout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CommunityToolkit/Labs-Windows/HEAD/components/CanvasLayout/samples/Assets/CanvasLayout.png -------------------------------------------------------------------------------- /components/RivePlayer/samples/animated-login-screen.riv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CommunityToolkit/Labs-Windows/HEAD/components/RivePlayer/samples/animated-login-screen.riv -------------------------------------------------------------------------------- /components/ColorAnalyzer/samples/Assets/StockImages/Paint.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CommunityToolkit/Labs-Windows/HEAD/components/ColorAnalyzer/samples/Assets/StockImages/Paint.jpg -------------------------------------------------------------------------------- /GenerateAllSolution.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | SET "MultiTargets=%1" 3 | IF "%MultiTargets%"=="" SET "MultiTargets=all" 4 | 5 | powershell .\tooling\GenerateAllSolution.ps1 -MultiTargets %MultiTargets% -------------------------------------------------------------------------------- /components/ColorAnalyzer/samples/Assets/StockImages/Flowers.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CommunityToolkit/Labs-Windows/HEAD/components/ColorAnalyzer/samples/Assets/StockImages/Flowers.jpg -------------------------------------------------------------------------------- /components/DependencyPropertyGenerator/samples/Assets/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CommunityToolkit/Labs-Windows/HEAD/components/DependencyPropertyGenerator/samples/Assets/icon.png -------------------------------------------------------------------------------- /components/TransitionHelper/samples/Assets/TransitionHelper.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CommunityToolkit/Labs-Windows/HEAD/components/TransitionHelper/samples/Assets/TransitionHelper.png -------------------------------------------------------------------------------- /components/ColorAnalyzer/samples/Assets/StockImages/Headphones.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CommunityToolkit/Labs-Windows/HEAD/components/ColorAnalyzer/samples/Assets/StockImages/Headphones.jpg -------------------------------------------------------------------------------- /components/MarkdownTextBlock/samples/Assets/MarkdownTextBlock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CommunityToolkit/Labs-Windows/HEAD/components/MarkdownTextBlock/samples/Assets/MarkdownTextBlock.png -------------------------------------------------------------------------------- /global.json: -------------------------------------------------------------------------------- 1 | { 2 | "sdk": { 3 | "version": "9.0.101", 4 | "rollForward": "latestFeature" 5 | }, 6 | "msbuild-sdks": 7 | { 8 | "MSBuild.Sdk.Extras":"3.0.23" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /components/Adorners/samples/Assets/davis-vargas-2vSNlKHn9h0-unsplash.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CommunityToolkit/Labs-Windows/HEAD/components/Adorners/samples/Assets/davis-vargas-2vSNlKHn9h0-unsplash.jpg -------------------------------------------------------------------------------- /components/Adorners/samples/Assets/sergey-zolkin-m9qMoh-scfE-unsplash.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CommunityToolkit/Labs-Windows/HEAD/components/Adorners/samples/Assets/sergey-zolkin-m9qMoh-scfE-unsplash.jpg -------------------------------------------------------------------------------- /components/AppServices/CommunityToolkit.AppServices.SourceGenerators/AnalyzerReleases.Unshipped.md: -------------------------------------------------------------------------------- 1 | ; Unshipped analyzer release 2 | ; https://github.com/dotnet/roslyn-analyzers/blob/main/src/Microsoft.CodeAnalysis.Analyzers/ReleaseTrackingAnalyzers.Help.md 3 | -------------------------------------------------------------------------------- /nuget.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /components/DependencyPropertyGenerator/CommunityToolkit.DependencyPropertyGenerator.SourceGenerators/AnalyzerReleases.Unshipped.md: -------------------------------------------------------------------------------- 1 | ; Unshipped analyzer release 2 | ; https://github.com/dotnet/roslyn-analyzers/blob/master/src/Microsoft.CodeAnalysis.Analyzers/ReleaseTrackingAnalyzers.Help.md 3 | -------------------------------------------------------------------------------- /components/Extensions.DependencyInjection/CommunityToolkit.Extensions.DependencyInjection.SourceGenerators/AnalyzerReleases.Unshipped.md: -------------------------------------------------------------------------------- 1 | ; Unshipped analyzer release 2 | ; https://github.com/dotnet/roslyn-analyzers/blob/main/src/Microsoft.CodeAnalysis.Analyzers/ReleaseTrackingAnalyzers.Help.md 3 | -------------------------------------------------------------------------------- /components/DependencyPropertyGenerator/.gitattributes: -------------------------------------------------------------------------------- 1 | # All file types: 2 | # - Treat as text 3 | # - Normalize to LF line endings 4 | * text=auto eol=lf 5 | 6 | # Explicit settings for well known types 7 | *.cs text eol=lf 8 | *.csproj text eol=lf 9 | *.projitems text eol=lf 10 | *.shprroj text eol=lf -------------------------------------------------------------------------------- /components/MarkdownTextBlock/src/ISVGRenderer.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace CommunityToolkit.WinUI.Controls; 6 | 7 | public interface ISVGRenderer 8 | { 9 | Task SvgToImage(string svgString); 10 | } 11 | -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | // See https://go.microsoft.com/fwlink/?LinkId=733558 3 | // for the documentation about the tasks.json format 4 | "version": "2.0.0", 5 | "tasks": [ 6 | { 7 | "label": "generateAllSolution", 8 | "type": "shell", 9 | "command": "pwsh ./tooling/GenerateAllSolution.ps1", 10 | "group": "build" 11 | } 12 | ] 13 | } -------------------------------------------------------------------------------- /components/Ribbon/tests/RibbonTestPage.xaml.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace RibbonTests; 6 | 7 | public sealed partial class RibbonTestPage : Page 8 | { 9 | public RibbonTestPage() => InitializeComponent(); 10 | } 11 | -------------------------------------------------------------------------------- /components/MarkdownTextBlock/src/TextElements/HtmlElementType.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace CommunityToolkit.WinUI.Controls.TextElements; 6 | 7 | public enum HtmlElementType 8 | { 9 | Block, 10 | Inline, 11 | } 12 | -------------------------------------------------------------------------------- /components/RivePlayer/src/MultiTarget.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | uwp;wasdk;wasm; 8 | 9 | -------------------------------------------------------------------------------- /components/Notifications/src/MultiTarget.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | uwp; 8 | 9 | -------------------------------------------------------------------------------- /components/TitleBar/src/MultiTarget.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | uwp;wasdk; 8 | 9 | -------------------------------------------------------------------------------- /components/Ribbon/src/Themes/Generic.xaml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /components/Shimmer/samples/MultiTarget.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | uwp;wasdk; 8 | 9 | 10 | -------------------------------------------------------------------------------- /components/Shimmer/src/MultiTarget.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | uwp;wasdk; 8 | 9 | 10 | -------------------------------------------------------------------------------- /components/DataTable/src/MultiTarget.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | uwp;wasdk; 8 | 9 | 10 | -------------------------------------------------------------------------------- /components/DependencyPropertyGenerator/src/MultiTarget.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | uwp;wasdk; 8 | 9 | -------------------------------------------------------------------------------- /components/MarkdownTextBlock/src/ImageProvider.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace CommunityToolkit.WinUI.Controls; 6 | 7 | public interface IImageProvider 8 | { 9 | Task GetImage(string url); 10 | bool ShouldUseThisProvider(string url); 11 | } 12 | -------------------------------------------------------------------------------- /components/AppServices/src/MultiTarget.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | uwp;netstandard; 8 | 9 | 10 | -------------------------------------------------------------------------------- /components/Extensions.DependencyInjection/src/MultiTarget.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | netstandard; 8 | 9 | -------------------------------------------------------------------------------- /components/MarkdownTextBlock/src/MultiTarget.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | uwp;wasdk; 8 | 9 | 10 | -------------------------------------------------------------------------------- /components/OpacityMaskView/src/MultiTarget.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | uwp;wasdk; 8 | 9 | 10 | -------------------------------------------------------------------------------- /components/TransitionHelper/src/MultiTarget.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | uwp;wasdk 8 | 9 | 10 | -------------------------------------------------------------------------------- /components/MarkdownTextBlock/src/TextElements/IAddChild.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace CommunityToolkit.WinUI.Controls.TextElements; 6 | 7 | public interface IAddChild 8 | { 9 | TextElement TextElement { get; } 10 | void AddChild(IAddChild child); 11 | } 12 | -------------------------------------------------------------------------------- /components/TransitionHelper/samples/MultiTarget.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | uwp;wasdk 8 | 9 | 10 | -------------------------------------------------------------------------------- /components/Ribbon/src/MultiTarget.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | uwp;wasdk;wpf;wasm;linuxgtk;macos;ios;android; 8 | 9 | -------------------------------------------------------------------------------- /components/Adorners/src/MultiTarget.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | uwp;wasdk;wpf;wasm;linuxgtk;macos;ios;android; 8 | 9 | -------------------------------------------------------------------------------- /components/MarkdownTextBlock/src/TextElements/BulletType.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace CommunityToolkit.WinUI.Controls.TextElements; 6 | 7 | internal enum BulletType 8 | { 9 | Circle, 10 | Number, 11 | LowerAlpha, 12 | UpperAlpha, 13 | LowerRoman, 14 | UpperRoman 15 | } 16 | -------------------------------------------------------------------------------- /components/Notifications/src/Adaptive/Elements/Element_AdaptiveImageEnums.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace CommunityToolkit.Notifications.Adaptive.Elements; 6 | 7 | internal enum AdaptiveImagePlacement 8 | { 9 | Inline, 10 | Background, 11 | Peek, 12 | Hero, 13 | AppLogoOverride 14 | } -------------------------------------------------------------------------------- /components/Marquee/samples/MarqueeText.Samples.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Marquee 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /components/Notifications/src/Toasts/IToastInput.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace CommunityToolkit.Notifications; 6 | 7 | /// 8 | /// An input element on a Toast notification. One of or . 9 | /// 10 | public interface IToastInput 11 | { 12 | } -------------------------------------------------------------------------------- /.config/dotnet-tools.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "isRoot": true, 4 | "tools": { 5 | "uno.check": { 6 | "version": "1.33.1", 7 | "commands": [ 8 | "uno-check" 9 | ] 10 | }, 11 | "xamlstyler.console": { 12 | "version": "3.2501.8", 13 | "commands": [ 14 | "xstyler" 15 | ] 16 | }, 17 | "microsoft.visualstudio.slngen.tool": { 18 | "version": "12.0.13", 19 | "commands": [ 20 | "slngen" 21 | ] 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /components/Shimmer/src/Themes/Generic.xaml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /components/Marquee/src/Themes/Generic.xaml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /components/Notifications/src/Tiles/Elements/TileElementsCommon.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace CommunityToolkit.Notifications; 6 | 7 | internal enum TilePresentation 8 | { 9 | People, 10 | Photos, 11 | Contact 12 | } 13 | 14 | internal enum TileImagePlacement 15 | { 16 | Inline, 17 | Background, 18 | Peek 19 | } -------------------------------------------------------------------------------- /components/TitleBar/src/Themes/Generic.xaml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /components/DataTable/src/Themes/Generic.xaml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /components/OpacityMaskView/src/Themes/Generic.xaml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /components/MarkdownTextBlock/src/Renderers/UWPObjectRenderer.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using Markdig.Renderers; 6 | using Markdig.Syntax; 7 | 8 | namespace CommunityToolkit.WinUI.Controls.Renderers; 9 | 10 | public abstract class UWPObjectRenderer : MarkdownObjectRenderer 11 | where TObject : MarkdownObject 12 | { 13 | } 14 | -------------------------------------------------------------------------------- /components/MarkdownTextBlock/src/Themes/Generic.xaml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /components/ColorAnalyzer/src/MultiTarget.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | uwp;wasdk; 9 | 10 | 11 | -------------------------------------------------------------------------------- /components/DependencyPropertyGenerator/samples/DependencyPropertyGenerator.Samples.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | DependencyPropertyGenerator 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /components/TitleBar/samples/SamplePages/FirstPage.xaml.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace TitleBarExperiment.Samples; 6 | /// 7 | /// An empty page that can be used on its own or navigated to within a Frame. 8 | /// 9 | public sealed partial class FirstPage : Page 10 | { 11 | public FirstPage() 12 | { 13 | this.InitializeComponent(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /components/TitleBar/samples/SamplePages/SecondPage.xaml.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace TitleBarExperiment.Samples; 6 | /// 7 | /// An empty page that can be used on its own or navigated to within a Frame. 8 | /// 9 | public sealed partial class SecondPage : Page 10 | { 11 | public SecondPage() 12 | { 13 | this.InitializeComponent(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /components/Marquee/tests/ExampleMarqueeTestPage.xaml.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace MarqueeTests; 6 | 7 | /// 8 | /// An empty page that can be used on its own or navigated to within a Frame. 9 | /// 10 | public sealed partial class ExampleMarqueeTestPage : Page 11 | { 12 | public ExampleMarqueeTestPage() 13 | { 14 | this.InitializeComponent(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /components/Shimmer/tests/ExampleShimmerTestPage.xaml.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace ShimmerTests; 6 | 7 | /// 8 | /// An empty page that can be used on its own or navigated to within a Frame. 9 | /// 10 | public sealed partial class ExampleShimmerTestPage : Page 11 | { 12 | public ExampleShimmerTestPage() 13 | { 14 | this.InitializeComponent(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "omnisharp.disableMSBuildDiagnosticWarning": true, 3 | "omnisharp.enableRoslynAnalyzers": true, 4 | "omnisharp.useGlobalMono": "never", 5 | "csharp.suppressBuildAssetsNotification": true, 6 | "csharp.suppressDotnetInstallWarning": true, 7 | "csharp.suppressDotnetRestoreNotification": true, 8 | "csharp.semanticHighlighting.enabled": true, 9 | "omnisharp.enableMsBuildLoadProjectsOnDemand": true, 10 | "dotnet.completion.showCompletionItemsFromUnimportedNamespaces": true, 11 | "dotnet.defaultSolution": "CommunityToolkit.AllComponents.sln" 12 | } -------------------------------------------------------------------------------- /components/Adorners/tests/ExampleAdornersTestPage.xaml.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace AdornersTests; 6 | 7 | /// 8 | /// An empty page that can be used on its own or navigated to within a Frame. 9 | /// 10 | public sealed partial class ExampleAdornersTestPage : Page 11 | { 12 | public ExampleAdornersTestPage() 13 | { 14 | this.InitializeComponent(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /components/TitleBar/tests/ExampleTitleBarTestPage.xaml.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace TitleBarTests; 6 | 7 | /// 8 | /// An empty page that can be used on its own or navigated to within a Frame. 9 | /// 10 | public sealed partial class ExampleTitleBarTestPage : Page 11 | { 12 | public ExampleTitleBarTestPage() 13 | { 14 | this.InitializeComponent(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /components/Notifications/src/Common/Serialization/IHaveXmlName.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace CommunityToolkit.Notifications; 6 | 7 | /// 8 | /// An interface for a notification XML element with a name. 9 | /// 10 | internal interface IHaveXmlName 11 | { 12 | /// 13 | /// Gets the name of the current element. 14 | /// 15 | string Name { get; } 16 | } 17 | -------------------------------------------------------------------------------- /components/TokenView/tests/ExampleTokenViewTestPage.xaml.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace TokenViewTests; 6 | 7 | /// 8 | /// An empty page that can be used on its own or navigated to within a Frame. 9 | /// 10 | public sealed partial class ExampleTokenViewTestPage : Page 11 | { 12 | public ExampleTokenViewTestPage() 13 | { 14 | this.InitializeComponent(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /components/CanvasView/tests/ExampleCanvasViewTestPage.xaml.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace CanvasViewTests; 6 | 7 | /// 8 | /// An empty page that can be used on its own or navigated to within a Frame. 9 | /// 10 | public sealed partial class ExampleCanvasViewTestPage : Page 11 | { 12 | public ExampleCanvasViewTestPage() 13 | { 14 | this.InitializeComponent(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /components/Notifications/src/Toasts/Elements/IElement_ToastActivatable.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace CommunityToolkit.Notifications; 6 | 7 | internal interface IElement_ToastActivatable 8 | { 9 | Element_ToastActivationType ActivationType { get; set; } 10 | 11 | string ProtocolActivationTargetApplicationPfn { get; set; } 12 | 13 | ToastAfterActivationBehavior AfterActivationBehavior { get; set; } 14 | } -------------------------------------------------------------------------------- /components/RivePlayer/tests/ExampleRivePlayerTestPage.xaml.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace RivePlayerTests; 6 | 7 | /// 8 | /// An empty page that can be used on its own or navigated to within a Frame. 9 | /// 10 | public sealed partial class ExampleRivePlayerTestPage : Page 11 | { 12 | public ExampleRivePlayerTestPage() 13 | { 14 | this.InitializeComponent(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /components/Shimmer/samples/Shimmer.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Shimmer 3 | author: JustinXinLiu 4 | description: An easy to use Shimmer control to indicate something is loading. 5 | keywords: Shimmer, Loading, Control, Layout 6 | dev_langs: 7 | - csharp 8 | category: Controls 9 | subcategory: Layout 10 | experimental: true 11 | discussion-id: 381 12 | issue-id: 390 13 | icon: Assets/Shimmer.png 14 | --- 15 | 16 | The Shimmer control can be used to communicate to the user a certain UI element is fetching data or is loading. `Duration` can be set to set the length of the animation. 17 | 18 | > [!SAMPLE ShimmerSample] 19 | -------------------------------------------------------------------------------- /components/CanvasLayout/samples/CanvasLayout.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: CanvasLayout 3 | author: mhawker 4 | description: A canvas-like VirtualizingLayout for use in an ItemsRepeater 5 | keywords: CanvasLayout, ItemsRepeater, VirtualizingLayout, Canvas, Layout, Panel, Arrange 6 | dev_langs: 7 | - csharp 8 | category: Controls 9 | subcategory: Layout 10 | experimental: true 11 | discussion-id: 311 12 | issue-id: 213 13 | icon: Assets/CanvasLayout.png 14 | --- 15 | 16 | The `CanvasLayout` is an early prototype for a custom Layout for ItemsRepeater which provides a virtualized canvas. 17 | 18 | > [!SAMPLE CanvasLayoutSample] 19 | -------------------------------------------------------------------------------- /components/CanvasLayout/tests/ExampleCanvasLayoutTestPage.xaml.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace CanvasLayoutTests; 6 | 7 | /// 8 | /// An empty page that can be used on its own or navigated to within a Frame. 9 | /// 10 | public sealed partial class ExampleCanvasLayoutTestPage : Page 11 | { 12 | public ExampleCanvasLayoutTestPage() 13 | { 14 | this.InitializeComponent(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /components/Marquee/samples/MarqueeBehaviorSample.xaml.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace MarqueeExperiment.Samples; 6 | 7 | [ToolkitSample(id: nameof(MarqueeBehaviorSample), "Marquee", description: "A control for scrolling content in a marquee fashion.")] 8 | public sealed partial class MarqueeBehaviorSample : Page 9 | { 10 | public MarqueeBehaviorSample() 11 | { 12 | this.InitializeComponent(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /components/TokenView/src/Helpers/ControlHelpers.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Text; 8 | 9 | namespace CommunityToolkit.WinUI.Controls; 10 | 11 | internal static partial class ControlHelpers 12 | { 13 | internal static bool IsXamlRootAvailable { get; } = Windows.Foundation.Metadata.ApiInformation.IsPropertyPresent("Windows.UI.Xaml.UIElement", "XamlRoot"); 14 | } 15 | -------------------------------------------------------------------------------- /components/DataTable/tests/DataTableColumnAutoSizeTestPage.xaml.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace DataTableTests; 6 | 7 | /// 8 | /// An empty page that can be used on its own or navigated to within a Frame. 9 | /// 10 | public sealed partial class DataTableColumnAutoSizeTestPage : Page 11 | { 12 | public DataTableColumnAutoSizeTestPage() 13 | { 14 | this.InitializeComponent(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /components/Notifications/src/Common/Serialization/IHaveXmlText.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace CommunityToolkit.Notifications; 6 | 7 | /// 8 | /// An interface for a notification XML element with an explicit XML text content. 9 | /// 10 | internal interface IHaveXmlText 11 | { 12 | /// 13 | /// Gets the text content of the current element. 14 | /// 15 | string Text { get; } 16 | } 17 | -------------------------------------------------------------------------------- /components/AppServices/tests/AppServices.Tests.projitems: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 5 | true 6 | A3106AE5-5AA9-4307-9041-E9C4232AA7F2 7 | 8 | 9 | AppServicesTests 10 | 11 | -------------------------------------------------------------------------------- /components/RivePlayer/src/Themes/Generic.xaml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /components/TransitionHelper/src/Properties/IsExternalInit.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System.ComponentModel; 6 | 7 | namespace System.Runtime.CompilerServices; 8 | 9 | /// 10 | /// Reserved to be used by the compiler for tracking metadata. 11 | /// This class should not be used by developers in source code. 12 | /// 13 | [EditorBrowsable(EditorBrowsableState.Never)] 14 | internal static class IsExternalInit 15 | { 16 | } 17 | -------------------------------------------------------------------------------- /components/MarkdownTextBlock/tests/ExampleMarkdownTextBlockTestPage.xaml.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace MarkdownTextBlockTests; 6 | 7 | /// 8 | /// An empty page that can be used on its own or navigated to within a Frame. 9 | /// 10 | public sealed partial class ExampleMarkdownTextBlockTestPage : Page 11 | { 12 | public ExampleMarkdownTextBlockTestPage() 13 | { 14 | this.InitializeComponent(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /components/Notifications/src/Adaptive/IAdaptiveChild.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace CommunityToolkit.Notifications; 6 | 7 | /// 8 | /// Elements that can be direct children of adaptive content, including (, , and ). 9 | /// 10 | public interface IAdaptiveChild 11 | { 12 | // Blank interface simply for compile-enforcing the child types in the list. 13 | } -------------------------------------------------------------------------------- /components/MarkdownTextBlock/src/MarkdownConfig.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace CommunityToolkit.WinUI.Controls; 6 | 7 | public record MarkdownConfig 8 | { 9 | public string? BaseUrl { get; set; } 10 | public IImageProvider? ImageProvider { get; set; } 11 | public ISVGRenderer? SVGRenderer { get; set; } 12 | public MarkdownThemes Themes { get; set; } = MarkdownThemes.Default; 13 | 14 | public static MarkdownConfig Default = new(); 15 | } 16 | -------------------------------------------------------------------------------- /components/Notifications/src/Adaptive/IAdaptiveSubgroupChild.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace CommunityToolkit.Notifications; 6 | 7 | /// 8 | /// Elements that can be direct children of an , including ( and ). 9 | /// 10 | public interface IAdaptiveSubgroupChild 11 | { 12 | // Blank interface simply for compile-enforcing the child types in the list. 13 | } -------------------------------------------------------------------------------- /components/OpacityMaskView/tests/OpacityMaskView.Tests.projitems: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 5 | true 6 | 04511143-C2A3-4893-810D-3C1EA2877430 7 | 8 | 9 | OpacityMaskViewTests 10 | 11 | -------------------------------------------------------------------------------- /components/TokenView/src/Themes/Generic.xaml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.devcontainer/default.code-workspace: -------------------------------------------------------------------------------- 1 | { 2 | "folders": [ 3 | { 4 | "path": ".." 5 | } 6 | ], 7 | "settings": { 8 | "omnisharp.defaultLaunchSolution": "CommunityToolkit.AllComponents.sln", 9 | "omnisharp.disableMSBuildDiagnosticWarning": true, 10 | "omnisharp.enableRoslynAnalyzers": true, 11 | "omnisharp.useGlobalMono": "never", 12 | "csharp.suppressBuildAssetsNotification": true, 13 | "csharp.suppressDotnetInstallWarning": true, 14 | "csharp.suppressDotnetRestoreNotification": true, 15 | "csharp.semanticHighlighting.enabled": true, 16 | "omnisharp.enableImportCompletion": true, 17 | "omnisharp.enableMsBuildLoadProjectsOnDemand": true 18 | } 19 | } -------------------------------------------------------------------------------- /components/MarkdownTextBlock/src/TextElements/MyLineBreak.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace CommunityToolkit.WinUI.Controls.TextElements; 6 | 7 | internal class MyLineBreak : IAddChild 8 | { 9 | private LineBreak _lineBreak; 10 | 11 | public TextElement TextElement 12 | { 13 | get => _lineBreak; 14 | } 15 | 16 | public MyLineBreak() 17 | { 18 | _lineBreak = new LineBreak(); 19 | } 20 | 21 | public void AddChild(IAddChild child) {} 22 | } 23 | -------------------------------------------------------------------------------- /components/Notifications/src/Adaptive/BaseTextHelper.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using CommunityToolkit.Notifications.Adaptive.Elements; 6 | 7 | namespace CommunityToolkit.Notifications; 8 | 9 | internal class BaseTextHelper 10 | { 11 | internal static Element_AdaptiveText CreateBaseElement(IBaseText current) 12 | { 13 | return new Element_AdaptiveText() 14 | { 15 | Text = current.Text, 16 | Lang = current.Language 17 | }; 18 | } 19 | } -------------------------------------------------------------------------------- /components/Notifications/src/Common/NotificationContentValidationException.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System; 6 | 7 | namespace CommunityToolkit.Notifications; 8 | 9 | /// 10 | /// Exception returned when invalid notification content is provided. 11 | /// 12 | internal sealed class NotificationContentValidationException : Exception 13 | { 14 | public NotificationContentValidationException(string message) 15 | : base(message) 16 | { 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /components/ColorAnalyzer/src/CommunityToolkit.WinUI.ColorAnalyzer.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ColorAnalyzer 6 | This package contains the ColorAnalyzer. 7 | 8 | CommunityToolkit.WinUI.ColorAnalyzerRns 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /components/DependencyPropertyGenerator/tests/DependencyPropertyGenerator.Tests.projitems: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 5 | true 6 | 22BE50B3-9810-4304-899E-6D7AF9D3147A 7 | 8 | 9 | DependencyPropertyGeneratorTests 10 | 11 | -------------------------------------------------------------------------------- /components/Notifications/src/Toasts/IToastBindingGenericChild.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace CommunityToolkit.Notifications; 6 | 7 | /// 8 | /// Elements that can be direct children of , including (, , and ). 9 | /// 10 | public interface IToastBindingGenericChild 11 | { 12 | // Blank interface simply for compile-enforcing the child types in the list. 13 | } -------------------------------------------------------------------------------- /components/Extensions.DependencyInjection/tests/Extensions.DependencyInjection.Tests.projitems: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 5 | true 6 | 47BFA618-6EF6-426A-B7CB-D8F2CEA68302 7 | 8 | 9 | Extensions.DependencyInjection.Tests 10 | 11 | -------------------------------------------------------------------------------- /components/Notifications/src/Tiles/Elements/Element_Tile.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System.Collections.Generic; 6 | 7 | namespace CommunityToolkit.Notifications; 8 | 9 | internal sealed class Element_Tile : BaseElement, IHaveXmlName, IHaveXmlChildren 10 | { 11 | public Element_TileVisual Visual { get; set; } 12 | 13 | /// 14 | string IHaveXmlName.Name => "tile"; 15 | 16 | /// 17 | IEnumerable IHaveXmlChildren.Children => new[] { Visual }; 18 | } -------------------------------------------------------------------------------- /components/OpacityMaskView/samples/OpacityMaskView.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: OpacityMaskView 3 | author: h82258652 4 | description: A control that applies an opacity mask to its content. 5 | keywords: OpacityMaskView, Control, Layout 6 | dev_langs: 7 | - csharp 8 | category: Controls 9 | subcategory: Layout 10 | experimental: true 11 | discussion-id: 490 12 | issue-id: 0 13 | icon: assets/icon.png 14 | --- 15 | 16 | The `OpacityMaskView` control applies an opacity mask to its content. The mask is defined by the `OpacityMask` property, which can contain a `Brush` object. The `OpacityMask` property is typically set to a `LinearGradientBrush` or `ImageBrush` object. 17 | 18 | > [!Sample OpacityMaskViewSample] 19 | -------------------------------------------------------------------------------- /components/Notifications/src/Tiles/ITileBindingContentAdaptiveChild.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace CommunityToolkit.Notifications; 6 | 7 | /// 8 | /// Elements that can be direct children of , including (, , and ). 9 | /// 10 | public interface ITileBindingContentAdaptiveChild 11 | { 12 | // Blank interface simply for compile-enforcing the child types in the list. 13 | } -------------------------------------------------------------------------------- /components/Notifications/src/Common/Serialization/IHaveXmlChildren.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System.Collections.Generic; 6 | 7 | #nullable enable 8 | 9 | namespace CommunityToolkit.Notifications; 10 | 11 | /// 12 | /// An interface for a notification XML element with additional children. 13 | /// 14 | internal interface IHaveXmlChildren 15 | { 16 | /// 17 | /// Gets the children of the current element. 18 | /// 19 | IEnumerable Children { get; } 20 | } -------------------------------------------------------------------------------- /components/MarkdownTextBlock/src/LinkClickedEventArgs.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace CommunityToolkit.WinUI.Controls; 6 | 7 | public class LinkClickedEventArgs : EventArgs 8 | { 9 | public Uri Uri { get; } 10 | /// 11 | /// Set to true in your handler to indicate the link click was handled and default navigation should be suppressed. 12 | /// 13 | public bool Handled { get; set; } 14 | 15 | public LinkClickedEventArgs(Uri uri) 16 | { 17 | this.Uri = uri; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /components/MarkdownTextBlock/src/TextElements/MyInlineText.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace CommunityToolkit.WinUI.Controls.TextElements; 6 | 7 | internal class MyInlineText : IAddChild 8 | { 9 | private Run _run; 10 | 11 | public TextElement TextElement 12 | { 13 | get => _run; 14 | } 15 | 16 | public MyInlineText(string text) 17 | { 18 | _run = new Run() 19 | { 20 | Text = text 21 | }; 22 | } 23 | 24 | public void AddChild(IAddChild child) {} 25 | } 26 | -------------------------------------------------------------------------------- /components/DataTable/samples/DataTable.Samples.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | DataTable 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | PreserveNewest 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /components/MarkdownTextBlock/src/Renderers/ObjectRenderers/Inlines/ContainerInlineRenderer.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using Markdig.Syntax.Inlines; 6 | 7 | namespace CommunityToolkit.WinUI.Controls.Renderers.ObjectRenderers.Inlines; 8 | 9 | internal class ContainerInlineRenderer : UWPObjectRenderer 10 | { 11 | protected override void Write(WinUIRenderer renderer, ContainerInline obj) 12 | { 13 | foreach (var inline in obj) 14 | { 15 | renderer.Write(inline); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /components/CanvasView/samples/CanvasView.Samples.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CanvasView 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | PreserveNewest 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /components/CanvasLayout/samples/CanvasLayout.Samples.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CanvasLayout 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | PreserveNewest 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /components/Adorners/samples/AdornersInfoBadgeSample.xaml.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace AdornersExperiment.Samples; 6 | 7 | [ToolkitSampleBoolOption("IsAdornerVisible", true, Title = "Is Adorner Visible")] 8 | 9 | [ToolkitSample(id: nameof(AdornersInfoBadgeSample), "InfoBadge w/ Adorner", description: "A sample for showing how add an infobadge to a component via an Adorner.")] 10 | public sealed partial class AdornersInfoBadgeSample : Page 11 | { 12 | public AdornersInfoBadgeSample() 13 | { 14 | this.InitializeComponent(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /components/Adorners/samples/InPlaceTextEditor/InPlaceTextEditorAdorner.xaml.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace AdornersExperiment.Samples.InPlaceTextEditor; 6 | 7 | public sealed partial class InPlaceTextEditorAdornerResources : ResourceDictionary 8 | { 9 | // NOTICE 10 | // This file only exists to enable x:Bind in the resource dictionary. 11 | // Do not add code here. 12 | // Instead, add code-behind to your templated control. 13 | public InPlaceTextEditorAdornerResources() 14 | { 15 | this.InitializeComponent(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /components/MarkdownTextBlock/src/Renderers/ObjectRenderers/CodeBlockRenderer.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using Markdig.Syntax; 6 | using CommunityToolkit.WinUI.Controls.TextElements; 7 | 8 | namespace CommunityToolkit.WinUI.Controls.Renderers.ObjectRenderers; 9 | 10 | internal class CodeBlockRenderer : UWPObjectRenderer 11 | { 12 | protected override void Write(WinUIRenderer renderer, CodeBlock obj) 13 | { 14 | var code = new MyCodeBlock(obj, renderer.Config); 15 | renderer.Push(code); 16 | renderer.Pop(); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /components/Ribbon/samples/Ribbon.Samples.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Ribbon 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | PreserveNewest 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /components/Ribbon/samples/RibbonCustomSample.xaml.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using CommunityToolkit.WinUI.Controls; 6 | 7 | namespace RibbonExperiment.Samples; 8 | 9 | /// 10 | /// An example of the control. 11 | /// 12 | [ToolkitSample(id: nameof(RibbonCustomSample), "Ribbon control sample", description: $"A sample for showing how to create and use a {nameof(Ribbon)} custom control.")] 13 | public sealed partial class RibbonCustomSample : Page 14 | { 15 | public RibbonCustomSample() => InitializeComponent(); 16 | } 17 | -------------------------------------------------------------------------------- /components/TitleBar/src/AdditionalAssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System.Runtime.CompilerServices; 6 | 7 | // These `InternalsVisibleTo` calls are intended to make it easier for 8 | // for any internal code to be testable in all the different test projects 9 | // used with the Labs infrastructure. 10 | [assembly: InternalsVisibleTo("TitleBar.Tests.Uwp")] 11 | [assembly: InternalsVisibleTo("TitleBar.Tests.WinAppSdk")] 12 | [assembly: InternalsVisibleTo("CommunityToolkit.Tests.Uwp")] 13 | [assembly: InternalsVisibleTo("CommunityToolkit.Tests.WinAppSdk")] 14 | -------------------------------------------------------------------------------- /components/DataTable/src/AdditionalAssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System.Runtime.CompilerServices; 6 | 7 | // These `InternalsVisibleTo` calls are intended to make it easier for 8 | // for any internal code to be testable in all the different test projects 9 | // used with the Labs infrastructure. 10 | [assembly: InternalsVisibleTo("DataTable.Tests.Uwp")] 11 | [assembly: InternalsVisibleTo("DataTable.Tests.WinAppSdk")] 12 | [assembly: InternalsVisibleTo("CommunityToolkit.Tests.Uwp")] 13 | [assembly: InternalsVisibleTo("CommunityToolkit.Tests.WinAppSdk")] 14 | -------------------------------------------------------------------------------- /components/Notifications/src/Common/Serialization/IHaveXmlAdditionalProperties.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System.Collections.Generic; 6 | 7 | #nullable enable 8 | 9 | namespace CommunityToolkit.Notifications; 10 | 11 | /// 12 | /// An interface for a notification XML element with additional properties. 13 | /// 14 | internal interface IHaveXmlAdditionalProperties 15 | { 16 | /// 17 | /// Gets the mapping of additional properties. 18 | /// 19 | IReadOnlyDictionary AdditionalProperties { get; } 20 | } 21 | -------------------------------------------------------------------------------- /components/TransitionHelper/samples/TransitionHelper.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: TransitionHelper 3 | author: githubaccount 4 | description: An animation helper that morphs between two controls. 5 | keywords: TransitionHelper, Control, Layout 6 | dev_langs: 7 | - csharp 8 | category: Controls 9 | subcategory: Layout 10 | experimental: true 11 | discussion-id: 353 12 | issue-id: 0 13 | icon: Assets/TransitionHelper.png 14 | --- 15 | 16 | The TransitionHelper is a set of attached properties and APIs which allow for smooth animations between two sets of components on a single page. This is helpful for providing smooth experiences when morphing or expanding content based on scrolling or other user input. 17 | 18 | ## Example 19 | 20 | > [!SAMPLE TransitionHelperFullExample] 21 | 22 | -------------------------------------------------------------------------------- /components/ColorAnalyzer/tests/ColorAnalyzer.Tests.projitems: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 5 | true 6 | FA8C1D4D-4CEF-490E-A369-0CCCFBAA8909 7 | 8 | 9 | ColorAnalyzerTests 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /components/OpacityMaskView/samples/OpacityMaskView.Samples.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | OpacityMaskView 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | PreserveNewest 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /components/Notifications/src/Tiles/TileTextStacking.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace CommunityToolkit.Notifications; 6 | 7 | /// 8 | /// TextStacking specifies the vertical alignment of content. 9 | /// 10 | public enum TileTextStacking 11 | { 12 | /// 13 | /// Vertical align to the top. 14 | /// 15 | Top, 16 | 17 | /// 18 | /// Vertical align to the center. 19 | /// 20 | Center, 21 | 22 | /// 23 | /// Vertical align to the bottom. 24 | /// 25 | Bottom 26 | } -------------------------------------------------------------------------------- /components/TransitionHelper/tests/TransitionHelper.Tests.projitems: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 5 | true 6 | F2D39FE2-BDFC-4E8C-9948-272F5272F936 7 | 8 | 9 | TransitionHelperTests 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /components/ColorAnalyzer/samples/ColorPaletteSampler/BaseColorSample.xaml.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace ColorAnalyzerExperiment.Samples; 6 | 7 | /// 8 | /// An example sample page of a custom control inheriting from Panel. 9 | /// 10 | [ToolkitSample(id: nameof(BaseColorSample), "AccentAnalyzer helper", description: $"A sample for showing how the accent analyzer can be used.")] 11 | public sealed partial class BaseColorSample : ColorPaletteSamplerToolkitSampleBase 12 | { 13 | public BaseColorSample() 14 | { 15 | this.InitializeComponent(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /components/Adorners/samples/InfoBadgeWithoutAdorner.xaml.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace AdornersExperiment.Samples; 6 | 7 | [ToolkitSampleBoolOption("IsNotificationVisible", true, Title = "Is Notification Visible")] 8 | 9 | [ToolkitSample(id: nameof(InfoBadgeWithoutAdorner), "InfoBadge w/o Adorner", description: "A sample for showing how one adds an infobadge to a component without an Adorner (from WinUI Gallery app).")] 10 | public sealed partial class InfoBadgeWithoutAdorner : Page 11 | { 12 | public InfoBadgeWithoutAdorner() 13 | { 14 | this.InitializeComponent(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /components/ColorAnalyzer/samples/ColorPaletteSampler/AccentColorSample.xaml.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace ColorAnalyzerExperiment.Samples; 6 | 7 | /// 8 | /// An example sample page of a custom control inheriting from Panel. 9 | /// 10 | [ToolkitSample(id: nameof(AccentColorSample), "AccentAnalyzer helper", description: $"A sample for showing how the accent analyzer can be used.")] 11 | public sealed partial class AccentColorSample : ColorPaletteSamplerToolkitSampleBase 12 | { 13 | public AccentColorSample() 14 | { 15 | this.InitializeComponent(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /components/ColorAnalyzer/samples/ColorPaletteSampler/ColorWeightSample.xaml.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace ColorAnalyzerExperiment.Samples; 6 | 7 | /// 8 | /// An example sample page of a custom control inheriting from Panel. 9 | /// 10 | [ToolkitSample(id: nameof(ColorWeightSample), "AccentAnalyzer helper", description: $"A sample for showing how the accent analyzer can be used.")] 11 | public sealed partial class ColorWeightSample : ColorPaletteSamplerToolkitSampleBase 12 | { 13 | public ColorWeightSample() 14 | { 15 | this.InitializeComponent(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /components/Extensions.DependencyInjection/CommunityToolkit.Extensions.DependencyInjection.SourceGenerators/Models/ServiceRegistrationKind.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace CommunityToolkit.Extensions.DependencyInjection.SourceGenerators.Models; 6 | 7 | /// 8 | /// Indicates the kind of service registration being used. 9 | /// 10 | internal enum ServiceRegistrationKind 11 | { 12 | /// 13 | /// A singleton service. 14 | /// 15 | Singleton, 16 | 17 | /// 18 | /// A transient service. 19 | /// 20 | Transient 21 | } 22 | -------------------------------------------------------------------------------- /components/MarkdownTextBlock/samples/MarkdownTextBlock.Samples.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | MarkdownTextBlock 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | PreserveNewest 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /components/Notifications/src/Toasts/ToastGenericAppLogoEnums.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace CommunityToolkit.Notifications; 6 | 7 | /// 8 | /// Specify the desired cropping of the image. 9 | /// 10 | public enum ToastGenericAppLogoCrop 11 | { 12 | /// 13 | /// Cropping uses the default behavior of the renderer. 14 | /// 15 | Default, 16 | 17 | /// 18 | /// Image is not cropped. 19 | /// 20 | None, 21 | 22 | /// 23 | /// Image is cropped to a circle shape. 24 | /// 25 | Circle 26 | } -------------------------------------------------------------------------------- /components/TitleBar/tests/ExampleTitleBarTestPage.xaml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /components/Adorners/samples/Adorners.Samples.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Adorners 6 | preview 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /components/ColorAnalyzer/samples/ContrastHelper/TextBlockContrastSample.xaml.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace ColorAnalyzerExperiment.Samples; 6 | 7 | /// 8 | /// An example sample page of a custom control inheriting from Panel. 9 | /// 10 | [ToolkitSample(id: nameof(TextBlockContrastSample), "ContrastAnalyzer helper", description: $"A sample for showing how the contrast analyzer can be used.")] 11 | public sealed partial class TextBlockContrastSample : ContrastHelperSampleBase 12 | { 13 | public TextBlockContrastSample() 14 | { 15 | this.InitializeComponent(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /components/MarkdownTextBlock/src/Renderers/ObjectRenderers/ListItemRenderer.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using Markdig.Syntax; 6 | 7 | namespace CommunityToolkit.WinUI.Controls.Renderers.ObjectRenderers; 8 | 9 | internal class ListItemRenderer : UWPObjectRenderer 10 | { 11 | protected override void Write(WinUIRenderer renderer, ListItemBlock listItem) 12 | { 13 | if (renderer == null) throw new ArgumentNullException(nameof(renderer)); 14 | if (listItem == null) throw new ArgumentNullException(nameof(listItem)); 15 | 16 | renderer.WriteChildren(listItem); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /components/TransitionHelper/src/Enums/VisualStateToggleMethod.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace CommunityToolkit.WinUI; 6 | 7 | /// 8 | /// Indicates the method of changing the visibility of UI elements. 9 | /// 10 | public enum VisualStateToggleMethod 11 | { 12 | /// 13 | /// Change the visibility of UI elements by modifying the Visibility property. 14 | /// 15 | ByVisibility, 16 | 17 | /// 18 | /// Change the visibility of UI elements by modifying the IsVisible property of it's Visual. 19 | /// 20 | ByIsVisible 21 | } 22 | -------------------------------------------------------------------------------- /components/CanvasView/samples/CanvasView.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: CanvasView 3 | author: michael-hawker 4 | description: CanvasView is an ItemsControl which uses a Canvas for layout of items. 5 | keywords: CanvasView, ItemsControl, Canvas, Control, Layout 6 | dev_langs: 7 | - csharp 8 | category: Controls 9 | subcategory: Layout 10 | experimental: true 11 | discussion-id: 310 12 | issue-id: 212 13 | icon: Assets/CanvasView.png 14 | --- 15 | 16 | It which provides built-in support for presenting a collection of items bound to specific coordinates and drag-and-drop support of those items. 17 | 18 | **Note:** This control isn't working on Web Assembly at the moment. 19 | 20 | The following example shows how the CanvasView can be used to display and drag a collection of rectangles: 21 | 22 | > [!SAMPLE CanvasViewDragSample] 23 | -------------------------------------------------------------------------------- /components/Adorners/samples/ResizeElement/ResizeElementAdornerCanvasSample.xaml.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace AdornersExperiment.Samples.ResizeElement; 6 | 7 | [ToolkitSampleBoolOption("IsAdornerVisible", false, Title = "Is Adorner Visible")] 8 | [ToolkitSample(id: nameof(ResizeElementAdornerCanvasSample), "Resize Element Adorner on Canvas", description: "A sample for showing how to use an Adorner for resizing an element within a Canvas.")] 9 | public sealed partial class ResizeElementAdornerCanvasSample : Page 10 | { 11 | public ResizeElementAdornerCanvasSample() 12 | { 13 | this.InitializeComponent(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /components/ColorAnalyzer/samples/ContrastHelper/SolidColorBrushContrastSample.xaml.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace ColorAnalyzerExperiment.Samples; 6 | 7 | /// 8 | /// An example sample page of a custom control inheriting from Panel. 9 | /// 10 | [ToolkitSample(id: nameof(SolidColorBrushContrastSample), "ContrastAnalyzer helper", description: $"A sample for showing how the contrast analyzer can be used.")] 11 | public sealed partial class SolidColorBrushContrastSample : ContrastHelperSampleBase 12 | { 13 | public SolidColorBrushContrastSample() 14 | { 15 | this.InitializeComponent(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /components/Notifications/src/Toasts/IToastActions.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System.Collections.Generic; 6 | 7 | namespace CommunityToolkit.Notifications; 8 | 9 | /// 10 | /// Actions to display on a Toast notification. One of or . 11 | /// 12 | public interface IToastActions 13 | { 14 | /// 15 | /// Gets custom context menu items, providing additional actions when the user right clicks the Toast notification. New in Anniversary Update 16 | /// 17 | IList ContextMenuItems { get; } 18 | } 19 | -------------------------------------------------------------------------------- /components/OpacityMaskView/samples/OpacityMaskViewSample.xaml.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using CommunityToolkit.WinUI.Controls; 6 | 7 | namespace OpacityMaskViewExperiment.Samples; 8 | 9 | /// 10 | /// An example sample page of a custom control inheriting from Panel. 11 | /// 12 | [ToolkitSample(id: nameof(OpacityMaskViewSample), "OpacityMaskView sample", description: $"A sample for showing how to create and use a {nameof(OpacityMaskView)} control.")] 13 | public sealed partial class OpacityMaskViewSample : Page 14 | { 15 | public OpacityMaskViewSample() 16 | { 17 | this.InitializeComponent(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /components/TitleBar/src/CommunityToolkit.WinUI.Controls.TitleBar.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | TitleBar 4 | This package contains TitleBar. 5 | 6 | 7 | CommunityToolkit.WinUI.Controls.TitleBarRns 8 | 9 | 10 | 11 | 12 | 13 | 14 | $(PackageIdPrefix).$(PackageIdVariant).Controls.$(ToolkitComponentName) 15 | 16 | 17 | -------------------------------------------------------------------------------- /components/ColorAnalyzer/samples/ColorPaletteSampler/MultiplePaletteSelectorSample.xaml.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace ColorAnalyzerExperiment.Samples; 6 | 7 | /// 8 | /// An example sample page of a custom control inheriting from Panel. 9 | /// 10 | [ToolkitSample(id: nameof(MultiplePaletteSelectorSample), "AccentAnalyzer helper", description: $"A sample for showing how the accent analyzer can be used.")] 11 | public sealed partial class MultiplePaletteSelectorSample : ColorPaletteSamplerToolkitSampleBase 12 | { 13 | public MultiplePaletteSelectorSample() 14 | { 15 | this.InitializeComponent(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /components/TransitionHelper/samples/TransitionHelperFullExample.xaml.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace TransitionHelperExperiment.Samples; 6 | 7 | /// 8 | /// An empty page that can be used on its own or navigated to within a Frame. 9 | /// 10 | [ToolkitSample(id: nameof(TransitionHelperFullExample), "TransitionHelper Detailed Example", description: "A detailed example of how to use the TransitionHelper with multiple elements to transition between.")] 11 | public sealed partial class TransitionHelperFullExample : Page 12 | { 13 | public TransitionHelperFullExample() 14 | { 15 | this.InitializeComponent(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /components/Adorners/tests/ExampleAdornersTestPage.xaml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /components/Ribbon/tests/RibbonTestPage.xaml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /components/Shimmer/tests/ExampleShimmerTestPage.xaml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /components/TitleBar/samples/SamplePages/FirstPage.xaml: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /components/TitleBar/samples/SamplePages/SecondPage.xaml: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /components/Notifications/src/Tiles/TileCommon.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System; 6 | 7 | namespace CommunityToolkit.Notifications; 8 | 9 | /// 10 | /// Represent the all tile sizes that are available. 11 | /// 12 | [Flags] 13 | public enum TileSize 14 | { 15 | /// 16 | /// Small Square Tile 17 | /// 18 | Small = 1, 19 | 20 | /// 21 | /// Medium Square Tile 22 | /// 23 | Medium = 2, 24 | 25 | /// 26 | /// Wide Rectangle Tile 27 | /// 28 | Wide = 4, 29 | 30 | /// 31 | /// Large Square Tile 32 | /// 33 | Large = 8 34 | } -------------------------------------------------------------------------------- /components/RivePlayer/tests/ExampleRivePlayerTestPage.xaml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /components/TokenView/tests/ExampleTokenViewTestPage.xaml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /components/CanvasView/tests/ExampleCanvasViewTestPage.xaml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /components/Marquee/src/MarqueeDirection.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace CommunityToolkit.WinUI.Controls; 6 | 7 | /// 8 | /// The direction a Marquee moves. 9 | /// 10 | public enum MarqueeDirection 11 | { 12 | /// 13 | /// The text will flow from left to right. 14 | /// 15 | Left, 16 | 17 | /// 18 | /// The text will flow from right to left. 19 | /// 20 | Right, 21 | 22 | /// 23 | /// The text will flow from bottom to top. 24 | /// 25 | Up, 26 | 27 | /// 28 | /// The text will flow from top to bottom. 29 | /// 30 | Down, 31 | } 32 | -------------------------------------------------------------------------------- /components/Adorners/src/CommunityToolkit.WinUI.Adorners.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Adorners 6 | This package contains Adorners. A Modern WinUI XAML based take on WPF Adorners. 7 | 8 | 9 | CommunityToolkit.WinUI.Controls.AdornersRns 10 | preview 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /components/MarkdownTextBlock/src/Renderers/ObjectRenderers/Inlines/CodeInlineRenderer.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using Markdig.Syntax.Inlines; 6 | using CommunityToolkit.WinUI.Controls.TextElements; 7 | 8 | namespace CommunityToolkit.WinUI.Controls.Renderers.ObjectRenderers.Inlines; 9 | 10 | internal class CodeInlineRenderer : UWPObjectRenderer 11 | { 12 | protected override void Write(WinUIRenderer renderer, CodeInline obj) 13 | { 14 | if (renderer == null) throw new ArgumentNullException(nameof(renderer)); 15 | if (obj == null) throw new ArgumentNullException(nameof(obj)); 16 | 17 | renderer.WriteInline(new MyInlineCode(obj, renderer.Config)); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /components/MarkdownTextBlock/src/Renderers/ObjectRenderers/Inlines/LiteralInlineRenderer.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using Markdig.Syntax.Inlines; 6 | 7 | namespace CommunityToolkit.WinUI.Controls.Renderers.ObjectRenderers.Inlines; 8 | 9 | internal class LiteralInlineRenderer : UWPObjectRenderer 10 | { 11 | protected override void Write(WinUIRenderer renderer, LiteralInline obj) 12 | { 13 | if (renderer == null) throw new ArgumentNullException(nameof(renderer)); 14 | if (obj == null) throw new ArgumentNullException(nameof(obj)); 15 | 16 | if (obj.Content.IsEmpty) 17 | return; 18 | 19 | renderer.WriteText(ref obj.Content); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /components/Notifications/src/Common/ArgumentValidator.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System; 6 | 7 | namespace CommunityToolkit.Notifications; 8 | 9 | internal static class ArgumentValidator 10 | { 11 | public static void SetProperty(ref T property, T value, string propertyName, ArgumentValidatorOptions options) 12 | { 13 | if (options.HasFlag(ArgumentValidatorOptions.NotNull)) 14 | { 15 | if (value == null) 16 | { 17 | throw new ArgumentNullException(propertyName); 18 | } 19 | } 20 | 21 | property = value; 22 | } 23 | } 24 | 25 | [Flags] 26 | internal enum ArgumentValidatorOptions 27 | { 28 | NotNull 29 | } -------------------------------------------------------------------------------- /components/Adorners/samples/ElementHighlightAdornerSample.xaml.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace AdornersExperiment.Samples; 6 | 7 | /// 8 | /// An empty page that can be used on its own or navigated to within a Frame. 9 | /// 10 | [ToolkitSampleBoolOption("IsAdornerVisible", false, Title = "Is Adorner Visible")] 11 | 12 | [ToolkitSample(id: nameof(ElementHighlightAdornerSample), "Highlighting an Element w/ Adorner", description: "A sample for showing how to highlight an element's bounds with an Adorner.")] 13 | public sealed partial class ElementHighlightAdornerSample : Page 14 | { 15 | public ElementHighlightAdornerSample() 16 | { 17 | this.InitializeComponent(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /components/TokenView/samples/TokenViewRemoveSample.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using CommunityToolkit.WinUI.Controls; 6 | 7 | namespace TokenViewExperiment.Samples; 8 | 9 | /// 10 | /// An example sample page of a custom control inheriting from Panel. 11 | /// 12 | [ToolkitSampleBoolOption("CanRemoveTokens", false, Title = "Can tokens be removed")] 13 | 14 | [ToolkitSample(id: nameof(TokenViewRemoveSample), "Remove sample", description: $"A sample for showing how to create and use a {nameof(TokenView)} control.")] 15 | public sealed partial class TokenViewRemoveSample : Page 16 | { 17 | 18 | public TokenViewRemoveSample() 19 | { 20 | this.InitializeComponent(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /components/ColorAnalyzer/src/ColorPaletteSampler/PaletteSelectors/BaseColorPaletteSelector.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace CommunityToolkit.WinUI.Helpers; 6 | 7 | /// 8 | /// A based on the least "colorful" color. 9 | /// 10 | public class BaseColorPaletteSelector : ColorPaletteSelector 11 | { 12 | /// 13 | public override void SelectColors(IEnumerable palettes) 14 | { 15 | // Get base color 16 | SelectedColors = palettes 17 | .Select(x => x.Color) 18 | .OrderBy(ColorExtensions.FindColorfulness) 19 | .ToList() 20 | .EnsureMinColorCount(MinColorCount); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /components/MarkdownTextBlock/src/Renderers/ObjectRenderers/Inlines/HtmlEntityInlineRenderer.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using Markdig.Syntax.Inlines; 6 | 7 | namespace CommunityToolkit.WinUI.Controls.Renderers.ObjectRenderers.Inlines; 8 | 9 | internal class HtmlEntityInlineRenderer : UWPObjectRenderer 10 | { 11 | protected override void Write(WinUIRenderer renderer, HtmlEntityInline obj) 12 | { 13 | if (renderer == null) throw new ArgumentNullException(nameof(renderer)); 14 | if (obj == null) throw new ArgumentNullException(nameof(obj)); 15 | 16 | var transcoded = obj.Transcoded; 17 | renderer.WriteText(ref transcoded); 18 | // todo: wtf is this? 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /components/Shimmer/samples/Shimmer.Samples.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Shimmer 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | PreserveNewest 16 | 17 | 18 | PreserveNewest 19 | 20 | 21 | -------------------------------------------------------------------------------- /components/Extensions.DependencyInjection/CommunityToolkit.Extensions.DependencyInjection.SourceGenerators/AnalyzerReleases.Shipped.md: -------------------------------------------------------------------------------- 1 | ; Shipped analyzer releases 2 | ; https://github.com/dotnet/roslyn-analyzers/blob/main/src/Microsoft.CodeAnalysis.Analyzers/ReleaseTrackingAnalyzers.Help.md 3 | 4 | ## Release 1.0 5 | 6 | ### New Rules 7 | 8 | Rule ID | Category | Severity | Notes 9 | --------|----------|----------|------- 10 | TKEXDI0001 | CommunityToolkit.Extensions.DependencyInjection.SourceGenerators.InvalidServiceRegistrationAnalyzer | Error | 11 | TKEXDI0002 | CommunityToolkit.Extensions.DependencyInjection.SourceGenerators.InvalidServiceRegistrationAnalyzer | Error | 12 | TKEXDI0003 | CommunityToolkit.Extensions.DependencyInjection.SourceGenerators.InvalidServiceRegistrationAnalyzer | Error | 13 | TKEXDI0004 | CommunityToolkit.Extensions.DependencyInjection.SourceGenerators.InvalidServiceRegistrationAnalyzer | Warning | 14 | -------------------------------------------------------------------------------- /components/MarkdownTextBlock/tests/ExampleMarkdownTextBlockTestPage.xaml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /components/RivePlayer/src/CommunityToolkit.WinUI.Rive.RivePlayer.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | RivePlayer 5 | This package contains RivePlayer. 6 | 7 | 8 | CommunityToolkit.WinUI.RivePlayerRns 9 | true 10 | uap10.0.17763; 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /components/Notifications/src/Adaptive/AdaptiveSubgroupEnums.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace CommunityToolkit.Notifications; 6 | 7 | /// 8 | /// TextStacking specifies the vertical alignment of content. 9 | /// 10 | public enum AdaptiveSubgroupTextStacking 11 | { 12 | /// 13 | /// Renderer automatically selects the default vertical alignment. 14 | /// 15 | Default, 16 | 17 | /// 18 | /// Vertical align to the top. 19 | /// 20 | Top, 21 | 22 | /// 23 | /// Vertical align to the center. 24 | /// 25 | Center, 26 | 27 | /// 28 | /// Vertical align to the bottom. 29 | /// 30 | Bottom 31 | } -------------------------------------------------------------------------------- /components/ColorAnalyzer/samples/ColorPaletteSampler/ColorPaletteSamplerToolkitSample.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace ColorAnalyzerExperiment.Samples; 6 | 7 | public abstract partial class ColorPaletteSamplerToolkitSampleBase : Page 8 | { 9 | public static readonly DependencyProperty SelectedImageProperty = 10 | DependencyProperty.Register(nameof(SelectedImage), typeof(ImageSource), typeof(ColorPaletteSamplerToolkitSampleBase), new PropertyMetadata(null)); 11 | 12 | public ColorPaletteSamplerToolkitSampleBase() 13 | { 14 | } 15 | 16 | public ImageSource SelectedImage 17 | { 18 | get => (ImageSource)GetValue(SelectedImageProperty); 19 | set => SetValue(SelectedImageProperty, value); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /components/ColorAnalyzer/src/ColorPaletteSampler/PaletteSelectors/AccentColorPaletteSelector.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace CommunityToolkit.WinUI.Helpers; 6 | 7 | /// 8 | /// A based on the three most "colorful" colors. 9 | /// 10 | public class AccentColorPaletteSelector : ColorPaletteSelector 11 | { 12 | /// 13 | public override void SelectColors(IEnumerable palette) 14 | { 15 | // Select accent colors 16 | SelectedColors = palette 17 | .Select(x => x.Color) 18 | .OrderByDescending(ColorExtensions.FindColorfulness) 19 | .ToList() 20 | .EnsureMinColorCount(MinColorCount); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /components/TransitionHelper/samples/TransitionHelper.Samples.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | TransitionHelper 5 | 6 | 7 | 8 | 9 | PreserveNewest 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | PreserveNewest 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /components/MarkdownTextBlock/src/Renderers/ObjectRenderers/Extensions/TaskListRenderer.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using Markdig.Extensions.TaskLists; 6 | using CommunityToolkit.WinUI.Controls.TextElements; 7 | 8 | namespace CommunityToolkit.WinUI.Controls.Renderers.ObjectRenderers.Extensions; 9 | 10 | internal class TaskListRenderer : UWPObjectRenderer 11 | { 12 | protected override void Write(WinUIRenderer renderer, TaskList taskList) 13 | { 14 | if (renderer == null) throw new ArgumentNullException(nameof(renderer)); 15 | if (taskList == null) throw new ArgumentNullException(nameof(taskList)); 16 | 17 | var checkBox = new MyTaskListCheckBox(taskList); 18 | renderer.WriteInline(checkBox); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /components/AppServices/CommunityToolkit.AppServices.SourceGenerators/Models/AppServiceInfo.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using CommunityToolkit.AppServices.SourceGenerators.Helpers; 6 | 7 | namespace CommunityToolkit.AppServices.SourceGenerators.Models; 8 | 9 | /// 10 | /// A model with gathered info on a given app service (either host or component). 11 | /// 12 | /// The methods in this app service. 13 | /// The name of the app service. 14 | /// The fully qualified name of the AppService interface. 15 | internal sealed record AppServiceInfo(EquatableArray Methods, string AppServiceName, string InterfaceFullyQualifiedName); -------------------------------------------------------------------------------- /components/MarkdownTextBlock/src/Renderers/ObjectRenderers/ThematicBreakRenderer.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using Markdig.Syntax; 6 | using CommunityToolkit.WinUI.Controls.TextElements; 7 | 8 | namespace CommunityToolkit.WinUI.Controls.Renderers.ObjectRenderers; 9 | 10 | internal class ThematicBreakRenderer : UWPObjectRenderer 11 | { 12 | protected override void Write(WinUIRenderer renderer, ThematicBreakBlock obj) 13 | { 14 | if (renderer == null) throw new ArgumentNullException(nameof(renderer)); 15 | if (obj == null) throw new ArgumentNullException(nameof(obj)); 16 | 17 | var thematicBreak = new MyThematicBreak(obj, renderer.Config.Themes); 18 | 19 | renderer.WriteBlock(thematicBreak); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /components/ColorAnalyzer/src/ColorPaletteSampler/PaletteSelectors/ColorWeightPaletteSelector.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace CommunityToolkit.WinUI.Helpers; 6 | 7 | /// 8 | /// A based on the three most prominent colors. 9 | /// 10 | public class ColorWeightPaletteSelector : ColorPaletteSelector 11 | { 12 | /// 13 | public override void SelectColors(IEnumerable colors) 14 | { 15 | // Order by weight and ensure we have at least MinColorCount colors 16 | SelectedColors = colors 17 | .OrderByDescending(x => x.Weight) 18 | .Select(x => x.Color) 19 | .ToList() 20 | .EnsureMinColorCount(MinColorCount); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /components/Marquee/src/CommunityToolkit.WinUI.Controls.Marquee.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Marquee 5 | This package contains Marquee. 6 | 7 | 8 | CommunityToolkit.WinUI.Controls.MarqueeRns 9 | 10 | 11 | 12 | 13 | 14 | 15 | $(PackageIdPrefix).$(PackageIdVariant).Controls.$(ToolkitComponentName) 16 | 17 | 18 | -------------------------------------------------------------------------------- /components/Shimmer/samples/ShimmerSample.xaml.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace ShimmerExperiment.Samples; 6 | 7 | [ToolkitSampleBoolOption("HasLoaded", false, Title = "Content loaded")] 8 | 9 | [ToolkitSample(id: nameof(ShimmerSample), "Basic Shimmer", description: "A sample that shows how to use a shimmer loading indicator.")] 10 | public sealed partial class ShimmerSample : Page 11 | { 12 | public ShimmerSample() 13 | { 14 | this.InitializeComponent(); 15 | } 16 | 17 | private static Visibility ReverseVisibility(Visibility vis) => vis switch 18 | { 19 | Visibility.Collapsed => Visibility.Visible, 20 | Visibility.Visible => Visibility.Collapsed, 21 | _ => throw new System.NotImplementedException(), 22 | 23 | }; 24 | } 25 | -------------------------------------------------------------------------------- /components/Extensions.DependencyInjection/CommunityToolkit.Extensions.DependencyInjection.SourceGenerators/Models/ServiceCollectionInfo.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using CommunityToolkit.Extensions.DependencyInjection.SourceGenerators.Helpers; 6 | 7 | namespace CommunityToolkit.Extensions.DependencyInjection.SourceGenerators.Models; 8 | 9 | /// 10 | /// A model for a service collection method. 11 | /// 12 | /// The instance for the method. 13 | /// The sequence of instances for services to register. 14 | internal sealed record ServiceCollectionInfo(ServiceProviderMethodInfo Method, EquatableArray Services); 15 | -------------------------------------------------------------------------------- /components/MarkdownTextBlock/src/Renderers/ObjectRenderers/HeadingRenderer.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using Markdig.Syntax; 6 | using CommunityToolkit.WinUI.Controls.TextElements; 7 | 8 | namespace CommunityToolkit.WinUI.Controls.Renderers.ObjectRenderers; 9 | 10 | internal class HeadingRenderer : UWPObjectRenderer 11 | { 12 | protected override void Write(WinUIRenderer renderer, HeadingBlock obj) 13 | { 14 | if (renderer == null) throw new ArgumentNullException(nameof(renderer)); 15 | if (obj == null) throw new ArgumentNullException(nameof(obj)); 16 | 17 | var paragraph = new MyHeading(obj, renderer.Config); 18 | renderer.Push(paragraph); 19 | renderer.WriteLeafInline(obj); 20 | renderer.Pop(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /components/MarkdownTextBlock/src/Renderers/ObjectRenderers/Inlines/HtmlInlineRenderer.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using HtmlAgilityPack; 6 | using Markdig.Syntax.Inlines; 7 | 8 | namespace CommunityToolkit.WinUI.Controls.Renderers.ObjectRenderers.Inlines; 9 | 10 | internal class HtmlInlineRenderer : UWPObjectRenderer 11 | { 12 | protected override void Write(WinUIRenderer renderer, HtmlInline obj) 13 | { 14 | if (renderer == null) throw new ArgumentNullException(nameof(renderer)); 15 | if (obj == null) throw new ArgumentNullException(nameof(obj)); 16 | 17 | var html = obj.Tag; 18 | var doc = new HtmlDocument(); 19 | doc.LoadHtml(html); 20 | HtmlWriter.WriteHtml(renderer, doc.DocumentNode.ChildNodes); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /components/MarkdownTextBlock/src/Renderers/ObjectRenderers/QuoteBlockRenderer.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using Markdig.Syntax; 6 | using CommunityToolkit.WinUI.Controls.TextElements; 7 | 8 | namespace CommunityToolkit.WinUI.Controls.Renderers.ObjectRenderers; 9 | 10 | internal class QuoteBlockRenderer : UWPObjectRenderer 11 | { 12 | protected override void Write(WinUIRenderer renderer, QuoteBlock obj) 13 | { 14 | if (renderer == null) throw new ArgumentNullException(nameof(renderer)); 15 | if (obj == null) throw new ArgumentNullException(nameof(obj)); 16 | 17 | var quote = new MyQuote(obj, renderer.Config.Themes); 18 | 19 | renderer.Push(quote); 20 | renderer.WriteChildren(obj); 21 | renderer.Pop(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /components/CanvasView/src/CommunityToolkit.WinUI.Controls.CanvasView.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CanvasView 5 | This package contains CanvasView. 6 | 7 | 8 | CommunityToolkit.WinUI.Controls.CanvasViewRns 9 | 10 | 11 | 12 | 13 | 14 | 15 | $(PackageIdPrefix).$(PackageIdVariant).Controls.$(ToolkitComponentName) 16 | 17 | 18 | -------------------------------------------------------------------------------- /components/RivePlayer/samples/RivePlayer.Samples.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | RivePlayer 5 | uap10.0.17763; 6 | 7 | 8 | 9 | 10 | Always 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | PreserveNewest 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /components/TransitionHelper/src/IScalingCalculator.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System.Numerics; 6 | 7 | namespace CommunityToolkit.WinUI; 8 | 9 | /// 10 | /// Defines methods to support calculating scaling changes. 11 | /// 12 | public interface IScalingCalculator 13 | { 14 | /// 15 | /// Gets the scaling changes when the source element transitions to the target element. 16 | /// 17 | /// The source element. 18 | /// The target element. 19 | /// A whose X value represents the horizontal scaling change and whose Y represents the vertical scaling change. 20 | Vector2 GetScaling(UIElement source, UIElement target); 21 | } 22 | -------------------------------------------------------------------------------- /components/Notifications/src/Common/Serialization/IHaveXmlNamedProperties.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System.Collections.Generic; 6 | 7 | #nullable enable 8 | 9 | namespace CommunityToolkit.Notifications; 10 | 11 | /// 12 | /// An interface for a notification XML element with named properties. 13 | /// 14 | internal interface IHaveXmlNamedProperties 15 | { 16 | /// 17 | /// Enumerates the available named properties for the element. 18 | /// 19 | /// A sequence of named properties for the element. 20 | /// The returned values must be valid XML values when is called on them. 21 | IEnumerable> EnumerateNamedProperties(); 22 | } 23 | -------------------------------------------------------------------------------- /components/Notifications/src/Common/INotificationContent.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using Windows.Data.Xml.Dom; 6 | 7 | namespace CommunityToolkit.Notifications; 8 | 9 | /// 10 | /// Base notification content interface to retrieve notification Xml as a string. 11 | /// 12 | public interface INotificationContent 13 | { 14 | /// 15 | /// Retrieves the notification Xml content as a string. 16 | /// 17 | /// The notification Xml content as a string. 18 | string GetContent(); 19 | 20 | /// 21 | /// Retrieves the notification Xml content as a WinRT Xml document. 22 | /// 23 | /// The notification Xml content as a WinRT Xml document. 24 | XmlDocument GetXml(); 25 | } 26 | -------------------------------------------------------------------------------- /components/DependencyPropertyGenerator/CommunityToolkit.DependencyPropertyGenerator.SourceGenerators/Constants/WellKnownTrackingNames.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace CommunityToolkit.GeneratedDependencyProperty.Constants; 6 | 7 | /// 8 | /// The well known names for tracking steps, to test the incremental generators. 9 | /// 10 | internal static class WellKnownTrackingNames 11 | { 12 | /// 13 | /// The initial transform node. 14 | /// 15 | public const string Execute = nameof(Execute); 16 | 17 | /// 18 | /// The filtered transform with just output sources. 19 | /// 20 | public const string Output = nameof(Output); 21 | } 22 | -------------------------------------------------------------------------------- /components/Adorners/src/InputValidation/InputValidationAdorner.xaml.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace CommunityToolkit.WinUI.Adorners.Resources; 6 | 7 | /// 8 | /// XAML resource dictionary for . 9 | /// 10 | public sealed partial class InputValidationAdornerResources : ResourceDictionary 11 | { 12 | // NOTICE 13 | // This file only exists to enable x:Bind in the resource dictionary. 14 | // Do not add code here. 15 | // Instead, add code-behind to your templated control. 16 | 17 | /// 18 | /// Initializes a new instance of the class. 19 | /// 20 | public InputValidationAdornerResources() 21 | { 22 | this.InitializeComponent(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /components/ColorAnalyzer/samples/ColorAnalyzer.Samples.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ColorAnalyzer 6 | 7 | 8 | 9 | 10 | 11 | 12 | PreserveNewest 13 | 14 | 15 | PreserveNewest 16 | 17 | 18 | PreserveNewest 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /components/MarkdownTextBlock/src/Renderers/ObjectRenderers/ParagraphRenderer.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using Markdig.Syntax; 6 | using CommunityToolkit.WinUI.Controls.TextElements; 7 | 8 | namespace CommunityToolkit.WinUI.Controls.Renderers.ObjectRenderers; 9 | 10 | internal class ParagraphRenderer : UWPObjectRenderer 11 | { 12 | protected override void Write(WinUIRenderer renderer, ParagraphBlock obj) 13 | { 14 | if (renderer == null) throw new ArgumentNullException(nameof(renderer)); 15 | if (obj == null) throw new ArgumentNullException(nameof(obj)); 16 | 17 | var paragraph = new MyParagraph(obj, renderer); 18 | // set style 19 | renderer.Push(paragraph); 20 | renderer.WriteLeafInline(obj); 21 | renderer.Pop(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /components/OpacityMaskView/src/CommunityToolkit.WinUI.Controls.OpacityMaskView.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | OpacityMaskView 6 | This package contains OpacityMaskView. 7 | 8 | 9 | CommunityToolkit.WinUI.Controls.OpacityMaskViewRns 10 | 11 | 12 | 13 | 14 | 15 | 16 | $(PackageIdPrefix).$(PackageIdVariant).Controls.$(ToolkitComponentName) 17 | 18 | 19 | -------------------------------------------------------------------------------- /components/TitleBar/samples/TitleBar.Samples.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | TitleBar 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | PreserveNewest 16 | 17 | 18 | PreserveNewest 19 | 20 | 21 | PreserveNewest 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /components/CanvasLayout/src/CommunityToolkit.WinUI.Controls.CanvasLayout.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CanvasLayout 5 | This package contains a CanvasLayout Layout for ItemsRepeater. 6 | 7 | 8 | CommunityToolkit.WinUI.Controls.CanvasLayoutRns 9 | 10 | 11 | 12 | 13 | 14 | 15 | $(PackageIdPrefix).$(PackageIdVariant).Controls.$(ToolkitComponentName) 16 | 17 | 18 | -------------------------------------------------------------------------------- /components/Adorners/src/Themes/Generic.xaml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /components/DataTable/src/CommunityToolkit.WinUI.Controls.DataTable.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | DataTable 5 | This package contains DataTable. 6 | 7 | 8 | CommunityToolkit.WinUI.Controls.DataTableRns 9 | true 10 | 11 | 12 | 13 | 14 | 15 | 16 | $(PackageIdPrefix).$(PackageIdVariant).Controls.$(ToolkitComponentName) 17 | 18 | 19 | -------------------------------------------------------------------------------- /components/TokenView/src/CommunityToolkit.WinUI.Controls.TokenView.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | TokenView 5 | This package contains TokenView. 6 | 7 | 8 | CommunityToolkit.WinUI.Controls.TokenViewRns 9 | true 10 | 11 | 12 | 13 | 14 | 15 | 16 | $(PackageIdPrefix).$(PackageIdVariant).Controls.$(ToolkitComponentName) 17 | 18 | 19 | -------------------------------------------------------------------------------- /components/Adorners/samples/AdornersTabBadgeSample.xaml.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace AdornersExperiment.Samples; 6 | 7 | [ToolkitSampleBoolOption("IsAdornerVisible", true, Title = "Is Adorner Visible")] 8 | [ToolkitSampleNumericOption("BadgeValue", 3, 1, 5, 1, true, Title = "Badge Value")] 9 | 10 | [ToolkitSample(id: nameof(AdornersTabBadgeSample), "InfoBadge w/ Adorner in TabView", description: "A sample for showing how add an InfoBadge to a TabViewItem via an Adorner.")] 11 | public sealed partial class AdornersTabBadgeSample : Page 12 | { 13 | public AdornersTabBadgeSample() 14 | { 15 | this.InitializeComponent(); 16 | } 17 | 18 | private void TabView_TabCloseRequested(MUXC.TabView sender, MUXC.TabViewTabCloseRequestedEventArgs args) 19 | { 20 | sender.TabItems.Remove(args.Tab); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /components/DependencyPropertyGenerator/CommunityToolkit.DependencyPropertyGenerator.SourceGenerators/Constants/WellKnownPropertyNames.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace CommunityToolkit.GeneratedDependencyProperty.Constants; 6 | 7 | /// 8 | /// The well known names for properties used by source generators and analyzers. 9 | /// 10 | internal static class WellKnownPropertyNames 11 | { 12 | /// 13 | /// The MSBuild property to control the XAML mode. 14 | /// 15 | public const string DependencyPropertyGeneratorUseWindowsUIXaml = nameof(DependencyPropertyGeneratorUseWindowsUIXaml); 16 | 17 | /// 18 | /// The MSBuild property to control whether the project is a WinRT component. 19 | /// 20 | public const string CsWinRTComponent = nameof(CsWinRTComponent); 21 | } 22 | -------------------------------------------------------------------------------- /components/Marquee/src/MarqueeBehavior.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace CommunityToolkit.WinUI.Controls; 6 | 7 | /// 8 | /// How the Marquee moves. 9 | /// 10 | public enum MarqueeBehavior 11 | { 12 | /// 13 | /// The text flows across the screen from start to finish. 14 | /// 15 | Ticker, 16 | 17 | /// 18 | /// As the text flows across the screen a duplicate follows. 19 | /// 20 | /// 21 | /// Looping text won't move if all the text already fits on the screen. 22 | /// 23 | Looping, 24 | 25 | // Waiting on AutoReverse implementation for Uno storyboards 26 | #if !HAS_UNO 27 | /// 28 | /// The text bounces back and forth across the screen. 29 | /// 30 | Bouncing, 31 | #endif 32 | } 33 | -------------------------------------------------------------------------------- /components/TransitionHelper/samples/CustomTextScalingCalculator.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System.Numerics; 6 | using CommunityToolkit.WinUI; 7 | 8 | namespace TransitionHelperExperiment.Samples; 9 | 10 | public sealed class CustomTextScalingCalculator : IScalingCalculator 11 | { 12 | /// 13 | public Vector2 GetScaling(UIElement source, UIElement target) 14 | { 15 | var sourceTextElement = source?.FindDescendantOrSelf(); 16 | var targetTextElement = target?.FindDescendantOrSelf(); 17 | if (sourceTextElement is not null && targetTextElement is not null) 18 | { 19 | var scale = targetTextElement.FontSize / sourceTextElement.FontSize; 20 | return new Vector2((float)scale); 21 | } 22 | 23 | return new Vector2(1); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /components/Notifications/src/Tiles/TileSizeToAdaptiveTemplateConverter.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System; 6 | 7 | namespace CommunityToolkit.Notifications; 8 | 9 | internal static class TileSizeToAdaptiveTemplateConverter 10 | { 11 | public static TileTemplateNameV3 Convert(TileSize size) 12 | { 13 | switch (size) 14 | { 15 | case TileSize.Small: 16 | return TileTemplateNameV3.TileSmall; 17 | 18 | case TileSize.Medium: 19 | return TileTemplateNameV3.TileMedium; 20 | 21 | case TileSize.Wide: 22 | return TileTemplateNameV3.TileWide; 23 | 24 | case TileSize.Large: 25 | return TileTemplateNameV3.TileLarge; 26 | 27 | default: 28 | throw new NotImplementedException(); 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /components/ColorAnalyzer/tests/ExampleAccentAnalyzerTestClass.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using CommunityToolkit.Tests; 6 | using CommunityToolkit.WinUI.Helpers; 7 | 8 | namespace AccentAnalyzerTests; 9 | 10 | [TestClass] 11 | public partial class ExampleAccentAnalyzerTestClass : VisualUITestBase 12 | { 13 | // If you don't need access to UI objects directly or async code, use this pattern. 14 | [TestMethod] 15 | public void SimpleSynchronousExampleTest() 16 | { 17 | var assembly = typeof(ColorPaletteSampler).Assembly; 18 | var type = assembly.GetType(typeof(ColorPaletteSampler).FullName ?? string.Empty); 19 | 20 | Assert.IsNotNull(type, "Could not find ColorPaletteSampler type."); 21 | Assert.AreEqual(typeof(ColorPaletteSampler), type, "Type of ColorPaletteSampler does not match expected type."); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /components/MarkdownTextBlock/src/Renderers/ObjectRenderers/Inlines/DelimiterInlineRenderer.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using Markdig.Syntax.Inlines; 6 | 7 | namespace CommunityToolkit.WinUI.Controls.Renderers.ObjectRenderers.Inlines; 8 | 9 | internal class DelimiterInlineRenderer : UWPObjectRenderer 10 | { 11 | protected override void Write(WinUIRenderer renderer, DelimiterInline obj) 12 | { 13 | if (renderer == null) throw new ArgumentNullException(nameof(renderer)); 14 | if (obj == null) throw new ArgumentNullException(nameof(obj)); 15 | 16 | // delimiter's children are emphasized text, we don't need to explicitly render them 17 | // Just need to render the children of the delimiter, I think.. 18 | //renderer.WriteText(obj.ToLiteral()); 19 | renderer.WriteChildren(obj); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /components/Adorners/src/AdornerOfT.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace CommunityToolkit.WinUI; 6 | 7 | /// 8 | /// A base class for s allowing for explicit types. 9 | /// 10 | /// The object type to attach to 11 | public abstract partial class Adorner : Adorner where T : UIElement 12 | { 13 | /// 14 | public new T? AdornedElement 15 | { 16 | get { return base.AdornedElement as T; } 17 | } 18 | 19 | /// 20 | protected override void OnAttached() 21 | { 22 | base.OnAttached(); 23 | 24 | if (this.AdornedElement is null) 25 | { 26 | throw new InvalidOperationException($"AdornedElement {base.AdornedElement?.GetType().FullName} is not of type {typeof(T).FullName}"); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /components/ColorAnalyzer/src/PaletteColor.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using Windows.UI; 6 | 7 | namespace CommunityToolkit.WinUI.Helpers; 8 | 9 | /// 10 | /// A struct containing palettized color info. 11 | /// 12 | public readonly struct PaletteColor 13 | { 14 | internal PaletteColor(Color color, float sampleFraction) 15 | { 16 | Color = color; 17 | Weight = sampleFraction; 18 | } 19 | 20 | /// 21 | /// Gets the color of the . 22 | /// 23 | public Color Color { get; } 24 | 25 | /// 26 | /// Gets the fraction of the image the color covers. 27 | /// 28 | /// 29 | /// Multiply by 100 to get the percentage of the image the color represents. 30 | /// 31 | public float Weight { get; } 32 | } 33 | -------------------------------------------------------------------------------- /components/Shimmer/src/CommunityToolkit.WinUI.Controls.Shimmer.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Shimmer 5 | This package contains Shimmer. 6 | 7 | 8 | CommunityToolkit.WinUI.Controls.ShimmerRns 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | $(PackageIdPrefix).$(PackageIdVariant).Controls.$(ToolkitComponentName) 19 | 20 | 21 | -------------------------------------------------------------------------------- /components/RivePlayer/samples/RivePlayerCustomSample.xaml.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using CommunityToolkit.WinUI.Rive; 6 | 7 | namespace RivePlayerExperiment.Samples; 8 | 9 | /// 10 | /// An example sample page of a custom control inheriting from Panel. 11 | /// 12 | [ToolkitSample(id: nameof(RivePlayerCustomSample), "Rive Player Sample", description: $"A sample for showing how to create and use a {nameof(RivePlayer)} custom control.")] 13 | public sealed partial class RivePlayerCustomSample : Page 14 | { 15 | public RivePlayerCustomSample() 16 | { 17 | this.InitializeComponent(); 18 | #if HAS_UNO 19 | // The Uno WASM platform seems to have trouble with our "ms-appx://" URI. Give it an http. 20 | this.RivePlayer.Source = "https://public.rive.app/community/runtime-files/2244-4463-animated-login-screen.riv"; 21 | #endif 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /components/MarkdownTextBlock/src/Renderers/ObjectRenderers/Inlines/LineBreakInlineRenderer.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using Markdig.Syntax.Inlines; 6 | using CommunityToolkit.WinUI.Controls.TextElements; 7 | 8 | namespace CommunityToolkit.WinUI.Controls.Renderers.ObjectRenderers.Inlines; 9 | 10 | internal class LineBreakInlineRenderer : UWPObjectRenderer 11 | { 12 | protected override void Write(WinUIRenderer renderer, LineBreakInline obj) 13 | { 14 | if (renderer == null) throw new ArgumentNullException(nameof(renderer)); 15 | if (obj == null) throw new ArgumentNullException(nameof(obj)); 16 | 17 | if (obj.IsHard) 18 | { 19 | renderer.WriteInline(new MyLineBreak()); 20 | } 21 | else 22 | { 23 | // Soft line break. 24 | renderer.WriteText(" "); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /components/DependencyPropertyGenerator/CommunityToolkit.DependencyPropertyGenerator.CodeFixers/CommunityToolkit.DependencyPropertyGenerator.CodeFixers.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | netstandard2.0 4 | enable 5 | true 6 | true 7 | 8 | 9 | $(NoWarn);IDE0130 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /components/Extensions.DependencyInjection/CommunityToolkit.Extensions.DependencyInjection.SourceGenerators/Extensions/ISymbolExtensions.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using Microsoft.CodeAnalysis; 6 | 7 | namespace CommunityToolkit.Extensions.DependencyInjection.SourceGenerators.Extensions; 8 | 9 | /// 10 | /// Extension methods for the type. 11 | /// 12 | internal static class ISymbolExtensions 13 | { 14 | /// 15 | /// Gets the fully qualified name for a given symbol. 16 | /// 17 | /// The input instance. 18 | /// The fully qualified name for . 19 | public static string GetFullyQualifiedName(this ISymbol symbol) 20 | { 21 | return symbol.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat); 22 | } 23 | } -------------------------------------------------------------------------------- /components/Adorners/src/ResizeElement/Thumb/ResizePositionMode.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace CommunityToolkit.WinUI.Controls; 6 | 7 | /// 8 | /// Specifies how the will adjust the position of its target element. 9 | /// 10 | public enum ResizePositionMode 11 | { 12 | /// 13 | /// Resize using Canvas.Left and Canvas.Top properties. 14 | /// 15 | Canvas, 16 | 17 | /// 18 | /// Resize using 's Top and Left values. 19 | /// 20 | MarginTopLeft, 21 | 22 | // TODO: MarginBottomRight could be added in the future. Not sure of alternate anchor points are useful? e.g. TopRight, BottomLeft 23 | // Alternate anchor points would require more complex calculations during resize to determine when to change the Width/Height of the element. 24 | } 25 | -------------------------------------------------------------------------------- /components/Notifications/src/Adaptive/IBaseText.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace CommunityToolkit.Notifications; 6 | 7 | /// 8 | /// Defines the basic properties of a text element. 9 | /// 10 | public interface IBaseText 11 | { 12 | /// 13 | /// Gets or sets the text to display. 14 | /// 15 | string Text { get; set; } 16 | 17 | /// 18 | /// Gets or sets the target locale of the XML payload, specified as a BCP-47 language tags such as "en-US" or "fr-FR". The locale specified here overrides any other specified locale, such as that in binding or visual. If this value is a literal string, this attribute defaults to the user's UI language. If this value is a string reference, this attribute defaults to the locale chosen by Windows Runtime in resolving the string. 19 | /// 20 | string Language { get; set; } 21 | } -------------------------------------------------------------------------------- /components/Ribbon/tests/Ribbon.Tests.shproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | C18B1738-4AFB-42D9-AC10-298B8F45B71C 5 | 14.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /components/Adorners/samples/Dependencies.props: -------------------------------------------------------------------------------- 1 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /components/Adorners/tests/Adorners.Tests.shproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 95E1FE34-BF6D-4E5C-8F44-51C8B9348212 5 | 14.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /components/CanvasLayout/tests/ExampleCanvasLayoutTestPage.xaml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /components/Marquee/tests/Marquee.Tests.shproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | C5CF2EF7-F605-4D62-95DB-B8C05C8799E0 5 | 14.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /components/Ribbon/src/CommunityToolkit.WinUI.Controls.Ribbon.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Ribbon 6 | This package contains Ribbon. 7 | 8 | 9 | CommunityToolkit.WinUI.Controls.RibbonRns 10 | true 11 | 12 | 13 | 14 | 15 | 16 | 17 | $(PackageIdPrefix).$(PackageIdVariant).Controls.$(ToolkitComponentName) 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /components/Shimmer/tests/Shimmer.Tests.shproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 02EDA7A2-0AD0-449E-AD75-E9B363620679 5 | 14.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /components/TitleBar/tests/TitleBar.Tests.shproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 3BA0AB2F-24A8-4E53-BEFE-2796E3E82421 5 | 14.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /components/CanvasView/tests/CanvasView.Tests.shproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 33D731BA-A745-418B-BF4A-BD8FB9880918 5 | 14.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /components/DataTable/tests/DataTable.Tests.shproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 758CD4BC-2E2C-4FAD-8C96-BD73E0EF128B 5 | 14.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /components/Notifications/src/Toasts/IToastButton.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace CommunityToolkit.Notifications; 6 | 7 | /// 8 | /// One of , , or . 9 | /// 10 | public interface IToastButton 11 | { 12 | /// 13 | /// Gets or sets an optional image icon for the button to display (required for buttons adjacent to inputs like quick reply). 14 | /// 15 | string ImageUri { get; set; } 16 | 17 | /// 18 | /// Gets or sets an identifier used in telemetry to identify your category of action. This should be something 19 | /// like "Delete", "Reply", or "Archive". In the upcoming toast telemetry dashboard in Dev Center, you will 20 | /// be able to view how frequently your actions are being clicked. 21 | /// 22 | string HintActionId { get; set; } 23 | } -------------------------------------------------------------------------------- /components/RivePlayer/tests/RivePlayer.Tests.shproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CE024C8F-3AB7-409E-B3D6-684B88C6054B 5 | 14.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /components/TokenView/tests/TokenView.Tests.shproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7E8E1DC7-8A48-4270-A926-1A8C4D17DBD0 5 | 14.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /components/AppServices/src/AppServiceAttribute.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System; 6 | 7 | namespace CommunityToolkit.AppServices; 8 | 9 | /// 10 | /// An attribute that can be used to annotate an interface to generate app service connection points. 11 | /// 12 | [AttributeUsage(AttributeTargets.Interface, AllowMultiple = false, Inherited = false)] 13 | public sealed class AppServiceAttribute : Attribute 14 | { 15 | /// 16 | /// Creates a new instance with the specified parameters. 17 | /// 18 | /// The name of the app service. 19 | public AppServiceAttribute(string appServiceName) 20 | { 21 | AppServiceName = appServiceName; 22 | } 23 | 24 | /// 25 | /// Gets the name of the app service. 26 | /// 27 | public string AppServiceName { get; } 28 | } 29 | -------------------------------------------------------------------------------- /components/AppServices/tests/AppServices.Tests.shproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | A3106AE5-5AA9-4307-9041-E9C4232AA7F2 5 | 14.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /components/CanvasLayout/tests/CanvasLayout.Tests.shproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | A09DC4AC-4111-440E-A188-E787CAE8C0B1 5 | 14.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /components/DependencyPropertyGenerator/samples/Dependencies.props: -------------------------------------------------------------------------------- 1 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /components/Notifications/tests/Notifications.Tests.shproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 695EB17B-60C6-4D00-9D3F-1BC54B6A9500 5 | 14.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /components/Ribbon/tests/Ribbon.Tests.projitems: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 5 | true 6 | C18B1738-4AFB-42D9-AC10-298B8F45B71C 7 | 8 | 9 | RibbonTests 10 | 11 | 12 | 13 | 14 | RibbonTestPage.xaml 15 | 16 | 17 | 18 | 19 | Designer 20 | MSBuild:Compile 21 | 22 | 23 | -------------------------------------------------------------------------------- /components/TokenView/src/TokenItem/TokenItemRemovingEventArgs.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | namespace CommunityToolkit.WinUI.Controls; 6 | 7 | public class TokenItemRemovingEventArgs : EventArgs 8 | { 9 | /// 10 | /// Initializes a new instance of the class. 11 | /// 12 | /// Item being removed. 13 | /// container being closed. 14 | public TokenItemRemovingEventArgs(object item, TokenItem tokenItem) 15 | { 16 | Item = item; 17 | TokenItem = tokenItem; 18 | } 19 | 20 | /// 21 | /// Gets the Item being closed. 22 | /// 23 | public object Item { get; private set; } 24 | 25 | /// 26 | /// Gets the Tab being closed. 27 | /// 28 | public TokenItem TokenItem { get; private set; } 29 | } 30 | -------------------------------------------------------------------------------- /components/OpacityMaskView/tests/OpacityMaskView.Tests.shproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 04511143-C2A3-4893-810D-3C1EA2877430 5 | 14.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /components/Marquee/tests/Marquee.Tests.projitems: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 5 | true 6 | C5CF2EF7-F605-4D62-95DB-B8C05C8799E0 7 | 8 | 9 | MarqueeTests 10 | 11 | 12 | 13 | 14 | ExampleMarqueeTestPage.xaml 15 | 16 | 17 | 18 | 19 | Designer 20 | MSBuild:Compile 21 | 22 | 23 | -------------------------------------------------------------------------------- /components/Shimmer/tests/Shimmer.Tests.projitems: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 5 | true 6 | 02EDA7A2-0AD0-449E-AD75-E9B363620679 7 | 8 | 9 | ShimmerTests 10 | 11 | 12 | 13 | 14 | ExampleShimmerTestPage.xaml 15 | 16 | 17 | 18 | 19 | Designer 20 | MSBuild:Compile 21 | 22 | 23 | -------------------------------------------------------------------------------- /components/TransitionHelper/tests/TransitionHelper.Tests.shproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | F2D39FE2-BDFC-4E8C-9948-272F5272F936 5 | 14.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /components/AppServices/AppServices.SourceGenerators.Tests/AppServices.SourceGenerators.Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net472 4 | enable 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /components/ColorAnalyzer/tests/ColorAnalyzer.Tests.shproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | FA8C1D4D-4CEF-490E-A369-0CCCFBAA8909 5 | 14.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /components/MarkdownTextBlock/tests/MarkdownTextBlock.Tests.shproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6F0FA793-7CF0-41F9-B7D9-260039B62C8A 5 | 14.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /components/TransitionHelper/src/CommunityToolkit.WinUI.TransitionHelper.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | TransitionHelper 5 | This package contains a TransitionHelper. 6 | 7 | 8 | CommunityToolkit.WinUI.TransitionHelperRns 9 | 10 | 11 | 12 | $(NoWarn);CA1001 13 | true 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /components/Adorners/tests/Adorners.Tests.projitems: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 5 | true 6 | 95E1FE34-BF6D-4E5C-8F44-51C8B9348212 7 | 8 | 9 | AdornersTests 10 | 11 | 12 | 13 | 14 | ExampleAdornersTestPage.xaml 15 | 16 | 17 | 18 | 19 | Designer 20 | MSBuild:Compile 21 | 22 | 23 | -------------------------------------------------------------------------------- /components/AppServices/CommunityToolkit.AppServices.SourceGenerators/AnalyzerReleases.Shipped.md: -------------------------------------------------------------------------------- 1 | ; Shipped analyzer releases 2 | ; https://github.com/dotnet/roslyn-analyzers/blob/main/src/Microsoft.CodeAnalysis.Analyzers/ReleaseTrackingAnalyzers.Help.md 3 | 4 | ## Release 1.0 5 | 6 | ### New Rules 7 | 8 | Rule ID | Category | Severity | Notes 9 | --------|----------|----------|------- 10 | APPSRVSPR0001 | CommunityToolkit.AppServices.SourceGenerators.InvalidAppServicesMemberAnalyzer | Error | 11 | APPSRVSPR0002 | CommunityToolkit.AppServices.SourceGenerators.InvalidAppServicesMemberAnalyzer | Error | 12 | APPSRVSPR0003 | CommunityToolkit.AppServices.SourceGenerators.InvalidAppServicesMemberAnalyzer | Error | 13 | APPSRVSPR0004 | CommunityToolkit.AppServices.SourceGenerators.InvalidAppServicesMemberAnalyzer | Error | 14 | APPSRVSPR0005 | CommunityToolkit.AppServices.SourceGenerators.InvalidAppServicesMemberAnalyzer | Error | 15 | APPSRVSPR0006 | CommunityToolkit.AppServices.SourceGenerators.InvalidValueSetSerializerUseAnalyzer | Error | 16 | APPSRVSPR0007 | CommunityToolkit.AppServices.SourceGenerators.InvalidValueSetSerializerUseAnalyzer | Warning | 17 | -------------------------------------------------------------------------------- /components/TitleBar/tests/TitleBar.Tests.projitems: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 5 | true 6 | 3BA0AB2F-24A8-4E53-BEFE-2796E3E82421 7 | 8 | 9 | TitleBarTests 10 | 11 | 12 | 13 | 14 | ExampleTitleBarTestPage.xaml 15 | 16 | 17 | 18 | 19 | Designer 20 | MSBuild:Compile 21 | 22 | 23 | -------------------------------------------------------------------------------- /components/TokenView/tests/TokenView.Tests.projitems: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 5 | true 6 | 7E8E1DC7-8A48-4270-A926-1A8C4D17DBD0 7 | 8 | 9 | TokenViewTests 10 | 11 | 12 | 13 | 14 | ExampleTokenViewTestPage.xaml 15 | 16 | 17 | 18 | 19 | Designer 20 | MSBuild:Compile 21 | 22 | 23 | -------------------------------------------------------------------------------- /components/CanvasView/tests/CanvasView.Tests.projitems: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 5 | true 6 | 33D731BA-A745-418B-BF4A-BD8FB9880918 7 | 8 | 9 | CanvasViewTests 10 | 11 | 12 | 13 | 14 | ExampleCanvasViewTestPage.xaml 15 | 16 | 17 | 18 | 19 | Designer 20 | MSBuild:Compile 21 | 22 | 23 | -------------------------------------------------------------------------------- /components/RivePlayer/tests/RivePlayer.Tests.projitems: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 5 | true 6 | CE024C8F-3AB7-409E-B3D6-684B88C6054B 7 | 8 | 9 | RivePlayerTests 10 | 11 | 12 | 13 | 14 | ExampleRivePlayerTestPage.xaml 15 | 16 | 17 | 18 | 19 | Designer 20 | MSBuild:Compile 21 | 22 | 23 | -------------------------------------------------------------------------------- /components/CanvasLayout/tests/CanvasLayout.Tests.projitems: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 5 | true 6 | A09DC4AC-4111-440E-A188-E787CAE8C0B1 7 | 8 | 9 | CanvasLayoutTests 10 | 11 | 12 | 13 | 14 | ExampleCanvasLayoutTestPage.xaml 15 | 16 | 17 | 18 | 19 | Designer 20 | MSBuild:Compile 21 | 22 | 23 | -------------------------------------------------------------------------------- /components/DataTable/tests/DataTable.Tests.projitems: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 5 | true 6 | 758CD4BC-2E2C-4FAD-8C96-BD73E0EF128B 7 | 8 | 9 | DataTableTests 10 | 11 | 12 | 13 | 14 | DataTableColumnAutoSizeTestPage.xaml 15 | 16 | 17 | 18 | 19 | Designer 20 | MSBuild:Compile 21 | 22 | 23 | -------------------------------------------------------------------------------- /components/DependencyPropertyGenerator/tests/DependencyPropertyGenerator.Tests.shproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22BE50B3-9810-4304-899E-6D7AF9D3147A 5 | 14.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /components/Notifications/src/Adaptive/Elements/Element_AdaptiveProgressBar.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System.Collections.Generic; 6 | 7 | namespace CommunityToolkit.Notifications.Adaptive.Elements; 8 | 9 | internal sealed class Element_AdaptiveProgressBar : IElement_ToastBindingChild, IHaveXmlName, IHaveXmlNamedProperties 10 | { 11 | public string Value { get; set; } 12 | 13 | public string Title { get; set; } 14 | 15 | public string ValueStringOverride { get; set; } 16 | 17 | public string Status { get; set; } 18 | 19 | /// 20 | string IHaveXmlName.Name => "progress"; 21 | 22 | /// 23 | IEnumerable> IHaveXmlNamedProperties.EnumerateNamedProperties() 24 | { 25 | yield return new("value", Value); 26 | yield return new("title", Title); 27 | yield return new("valueStringOverride", ValueStringOverride); 28 | yield return new("status", Status); 29 | } 30 | } -------------------------------------------------------------------------------- /components/AppServices/src/GeneratedAppServiceHostAttribute.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using System; 6 | 7 | namespace CommunityToolkit.AppServices; 8 | 9 | /// 10 | /// An attribute that can be used to request the generator to emit a host implementation of a given app service. 11 | /// 12 | [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = false, Inherited = false)] 13 | public sealed class GeneratedAppServiceHostAttribute : Attribute 14 | { 15 | /// 16 | /// Creates a new instance with the specified parameters. 17 | /// 18 | /// The type of the app service. 19 | public GeneratedAppServiceHostAttribute(Type appServiceType) 20 | { 21 | AppServiceType = appServiceType; 22 | } 23 | 24 | /// 25 | /// Gets the type of the app service. 26 | /// 27 | public Type AppServiceType { get; } 28 | } 29 | -------------------------------------------------------------------------------- /components/DependencyPropertyGenerator/CommunityToolkit.DependencyPropertyGenerator.SourceGenerators/Extensions/SyntaxTokenExtensions.cs: -------------------------------------------------------------------------------- 1 | // Licensed to the .NET Foundation under one or more agreements. 2 | // The .NET Foundation licenses this file to you under the MIT license. 3 | // See the LICENSE file in the project root for more information. 4 | 5 | using Microsoft.CodeAnalysis; 6 | using Microsoft.CodeAnalysis.CSharp; 7 | 8 | namespace CommunityToolkit.GeneratedDependencyProperty.Extensions; 9 | 10 | /// 11 | /// Extension methods for the type. 12 | /// 13 | internal static class SyntaxTokenExtensions 14 | { 15 | /// 16 | /// Deconstructs a into its value. 17 | /// 18 | /// The input value. 19 | /// The resulting value for . 20 | public static void Deconstruct(this SyntaxToken syntaxToken, out SyntaxKind syntaxKind) 21 | { 22 | syntaxKind = syntaxToken.Kind(); 23 | } 24 | } 25 | --------------------------------------------------------------------------------