├── .gitattributes ├── .github └── ISSUE_TEMPLATE │ └── customer-feedback.yml ├── .gitignore ├── .openpublishing.publish.config.json ├── .openpublishing.redirection.json ├── CONTRIBUTING.md ├── LICENSE ├── LICENSE-CODE ├── README.md ├── SECURITY.md ├── ThirdPartyNotices.md ├── contributing └── contributing-maui.md └── docs ├── TOC.yml ├── breadcrumb └── toc.yml ├── diagnostics ├── Guard.md ├── Introduction.md └── ThrowHelper.md ├── docfx.json ├── high-performance ├── Introduction.md ├── Memory2D.md ├── MemoryOwner.md ├── ParallelHelper.md ├── Ref.md ├── Span2D.md ├── SpanOwner.md └── StringPool.md ├── images ├── get-started │ └── manage-nuget-packages.png ├── mediaelement │ └── intro.png └── source-generator-visualization.png ├── index.yml ├── introduction.md ├── maui ├── .template.md ├── TOC.yml ├── alerts │ ├── index.md │ ├── snackbar.md │ └── toast.md ├── animations │ ├── fade-animation.md │ └── index.md ├── behaviors │ ├── animation-behavior.md │ ├── characters-validation-behavior.md │ ├── email-validation-behavior.md │ ├── event-to-command-behavior.md │ ├── icon-tint-color-behavior.md │ ├── image-touch-behavior.md │ ├── index.md │ ├── masked-behavior.md │ ├── maximum-length-reached-behavior.md │ ├── multi-validation-behavior.md │ ├── numeric-validation-behavior.md │ ├── progressbar-animation-behavior.md │ ├── required-string-validation-behavior.md │ ├── select-all-text-behavior.md │ ├── set-focus-when-entry-completed-behavior.md │ ├── statusbar-behavior.md │ ├── text-validation-behavior.md │ ├── touch-behavior.md │ ├── uri-validation-behavior.md │ └── user-stopped-typing-behavior.md ├── converters │ ├── bool-to-object-converter.md │ ├── byte-array-to-image-source-converter.md │ ├── color-to-black-or-white-converter.md │ ├── color-to-byte-alpha-converter.md │ ├── color-to-byte-blue-converter.md │ ├── color-to-byte-green-converter.md │ ├── color-to-byte-red-converter.md │ ├── color-to-cmyk-string-converter.md │ ├── color-to-cmyka-string-converter.md │ ├── color-to-color-for-text-converter.md │ ├── color-to-degree-hue-converter.md │ ├── color-to-gray-scale-color-converter.md │ ├── color-to-hex-argb-string-converter.md │ ├── color-to-hex-rgb-string-converter.md │ ├── color-to-hex-rgba-string-converter.md │ ├── color-to-hsl-string-converter.md │ ├── color-to-hsla-string-converter.md │ ├── color-to-inverse-color-converter.md │ ├── color-to-percent-black-key-converter.md │ ├── color-to-percent-cyan-converter.md │ ├── color-to-percent-magenta-converter.md │ ├── color-to-percent-yellow-converter.md │ ├── color-to-rgb-string-converter.md │ ├── color-to-rgba-string-converter.md │ ├── compare-converter.md │ ├── datetimeoffsetconverter.md │ ├── double-to-int-converter.md │ ├── enum-to-bool-converter.md │ ├── enum-to-int-converter.md │ ├── image-resource-converter.md │ ├── index-to-array-item-converter.md │ ├── index.md │ ├── int-to-bool-converter.md │ ├── inverted-bool-converter.md │ ├── is-equal-converter.md │ ├── is-in-range-converter.md │ ├── is-list-not-null-or-empty-converter.md │ ├── is-list-null-or-empty-converter.md │ ├── is-not-equal-converter.md │ ├── is-not-null-converter.md │ ├── is-null-converter.md │ ├── is-string-not-null-or-empty-converter.md │ ├── is-string-not-null-or-whitespace-converter.md │ ├── is-string-null-or-empty-converter.md │ ├── is-string-null-or-whitespace-converter.md │ ├── item-tapped-eventargs-converter.md │ ├── list-to-string-converter.md │ ├── math-expression-converter.md │ ├── multi-converter.md │ ├── multi-math-expression-converter.md │ ├── selected-item-eventargs-converter.md │ ├── state-to-bool-converter.md │ ├── string-to-list-converter.md │ ├── text-case-converter.md │ └── variable-multi-value-converter.md ├── essentials │ ├── apptheme-resources.md │ ├── badge.md │ ├── file-saver.md │ ├── folder-picker.md │ ├── index.md │ └── speech-to-text.md ├── extensions │ ├── color-animation-extensions.md │ ├── color-conversion-extensions.md │ ├── index.md │ ├── keyboard-extensions.md │ └── servicecollection-extensions.md ├── get-started.md ├── images │ ├── alerts │ │ ├── snackbar-android.gif │ │ ├── snackbar-ios.gif │ │ ├── toast-android.gif │ │ └── toast-ios.gif │ ├── behaviors │ │ ├── animation-behavior-android.gif │ │ ├── character-validation-behavior-android.gif │ │ ├── email-validation-behavior-android.gif │ │ ├── masked-behavior-android.gif │ │ ├── masked-behavior-unmasked-character.png │ │ ├── multi-validation-behavior-android.gif │ │ ├── required-string-validation-behavior-android.gif │ │ ├── text-validation-behavior-android.gif │ │ ├── uri-validation-behavior-android.gif │ │ └── user-stopped-typing-behavior-android.gif │ ├── essentials │ │ ├── badge-windows.gif │ │ ├── file-saver-mac.png │ │ └── speech-to-text-mac.gif │ ├── get-started │ │ └── manage-nuget.png │ ├── layouts │ │ ├── DockLayout.svg │ │ └── statecontainer.gif │ ├── native-library-interop │ │ ├── nativelibraryinterop-conceptual-overview-android.png │ │ ├── nativelibraryinterop-conceptual-overview-ios.png │ │ └── nativelibraryinterop-conceptual-overview.png │ ├── navigation-bar │ │ └── navigation-bar-sample.png │ └── views │ │ ├── Expander-ListView.gif │ │ ├── Expander.gif │ │ ├── RatingView.png │ │ ├── RatingView_CustomShape.png │ │ ├── RatingView_RatingFill.png │ │ ├── RatingView_Shape.png │ │ ├── drawingview-android.gif │ │ └── drawingview-multiline-android.gif ├── imagesources │ ├── GravatarImageSource.md │ └── index.md ├── includes │ ├── behavior-bindings.md │ ├── communitytoolkit-converter.md │ ├── math-expression-operations.md │ ├── toast-snackbar-setup.md │ ├── validation-behavior.md │ └── xaml-usage.md ├── index.md ├── layouts │ ├── DockLayout.md │ ├── StateContainer.md │ ├── UniformItemsLayout.md │ └── index.md ├── markup │ ├── converters │ │ ├── func-converter.md │ │ └── func-multi-converter.md │ ├── dotnet-hot-reload.gif │ ├── dotnet-hot-reload.md │ ├── extensions │ │ ├── absolute-layout-extensions.md │ │ ├── automation-properties.md │ │ ├── bindable-layout-extensions.md │ │ ├── bindable-object-extensions.md │ │ ├── dynamic-resource-handler-extensions.md │ │ ├── element-extensions.md │ │ ├── flex-layout-extensions.md │ │ ├── grid-extensions.md │ │ ├── image-extensions.md │ │ ├── itemsview-extensions.md │ │ ├── label-extensions.md │ │ ├── object-extensions.md │ │ ├── placeholder-extensions.md │ │ ├── semantic-properties.md │ │ ├── style.md │ │ ├── text-alignment-extensions.md │ │ ├── view-extensions.md │ │ └── visual-element-extensions.md │ ├── markup.md │ └── theming.md ├── native-library-interop │ ├── get-started.md │ └── index.md ├── options.md ├── platform-specific │ ├── DialogFragment-customization.md │ ├── index.md │ └── navigation-bar.md └── views │ ├── AvatarView.md │ ├── DrawingView.md │ ├── Expander.md │ ├── LazyView.md │ ├── Map.md │ ├── MediaElement.md │ ├── Popup.md │ ├── RatingView.md │ ├── camera-view.md │ ├── index.md │ ├── popup-service.md │ └── semantic-order-view.md ├── mvvm ├── AsyncRelayCommand.md ├── Ioc.md ├── Messenger.md ├── MigratingFromMvvmBasic.md ├── MigratingFromMvvmLight.md ├── ObservableGroupedCollections.md ├── ObservableObject.md ├── ObservableRecipient.md ├── ObservableValidator.md ├── PuttingThingsTogether.md ├── RelayCommand.md ├── TOC.yml ├── generators │ ├── INotifyPropertyChanged.md │ ├── ObservableProperty.md │ ├── Overview.md │ ├── RelayCommand.md │ └── errors │ │ ├── MVVMTK0001.md │ │ ├── MVVMTK0002.md │ │ ├── MVVMTK0003.md │ │ ├── MVVMTK0004.md │ │ ├── MVVMTK0005.md │ │ ├── MVVMTK0006.md │ │ ├── MVVMTK0007.md │ │ ├── MVVMTK0008.md │ │ ├── MVVMTK0009.md │ │ ├── MVVMTK0010.md │ │ ├── MVVMTK0011.md │ │ ├── MVVMTK0012.md │ │ ├── MVVMTK0013.md │ │ ├── MVVMTK0014.md │ │ ├── MVVMTK0015.md │ │ ├── MVVMTK0016.md │ │ ├── MVVMTK0017.md │ │ ├── MVVMTK0018.md │ │ ├── MVVMTK0019.md │ │ ├── MVVMTK0020.md │ │ ├── MVVMTK0021.md │ │ ├── MVVMTK0022.md │ │ ├── MVVMTK0023.md │ │ ├── MVVMTK0024.md │ │ ├── MVVMTK0025.md │ │ ├── MVVMTK0026.md │ │ ├── MVVMTK0027.md │ │ ├── MVVMTK0028.md │ │ ├── MVVMTK0029.md │ │ ├── MVVMTK0030.md │ │ ├── MVVMTK0031.md │ │ ├── MVVMTK0032.md │ │ ├── MVVMTK0033.md │ │ ├── MVVMTK0034.md │ │ ├── MVVMTK0035.md │ │ ├── MVVMTK0036.md │ │ ├── MVVMTK0039.md │ │ ├── MVVMTK0040.md │ │ ├── MVVMTK0041.md │ │ ├── MVVMTK0042.md │ │ ├── MVVMTK0043.md │ │ ├── MVVMTK0044.md │ │ ├── MVVMTK0045.md │ │ ├── MVVMTK0046.md │ │ ├── MVVMTK0047.md │ │ ├── MVVMTK0048.md │ │ ├── MVVMTK0049.md │ │ ├── MVVMTK0050.md │ │ ├── MVVMTK0051.md │ │ ├── MVVMTK0052.md │ │ ├── MVVMTK0053.md │ │ ├── MVVMTK0054.md │ │ ├── MVVMTK0055.md │ │ ├── MVVMTK0056.md │ │ ├── MVVMTKCFG0001.md │ │ ├── MVVMTKCFG0002.md │ │ └── TOC.yml └── index.md └── windows ├── Animations ├── ConnectedAnimations.md └── index.md ├── Behaviors ├── AnimationSet.md ├── HeaderBehaviors.md ├── StackedNotificationsBehavior.md └── index.md ├── CameraPreview └── index.md ├── Collections ├── AdvancedCollectionView.md └── IncrementalLoadingCollection.md ├── ColorPicker └── index.md ├── Converters └── index.md ├── DeveloperTools └── index.md ├── Extensions ├── ArrayExtensions.md ├── AttachedDropShadow.md ├── AttachedShadows.md ├── DependencyObjectExtensions.md ├── DispatcherQueueExtensions.md ├── DispatcherQueueTimerExtensions.md ├── EnumValuesExtension.md ├── FrameworkElementExtensions.md ├── HyperlinkExtensions.md ├── IconMarkupExtensions.md ├── ListViewExtensions.md ├── MatrixExtensions.md ├── NullableBoolExtension.md ├── OnDeviceExtension.md ├── ScrollViewerExtensions.md ├── ShadowAnimations.md ├── StringExtensions.md ├── TextBoxExtensions.md ├── TransformExtensions.md ├── UIElementExtensions.md └── VisualExtensions.md ├── HeaderedControls ├── HeaderedContentControl.md ├── HeaderedItemsControl.md └── HeaderedTreeView.md ├── Helpers ├── CameraHelper.md ├── ColorHelper.md ├── DesignTimeHelper.md ├── NetworkHelper.md ├── ScreenUnitHelper.md ├── ThemeListener.md └── WeakEventListener.md ├── ImageCropper └── index.md ├── LayoutTransformControl └── index.md ├── Media ├── AttachedCardShadow.md ├── Brushes.md ├── EffectAnimations.md ├── PipelineBrush.md └── PipelineVisualFactory.md ├── MetadataControl └── index.md ├── Primitives ├── ConstrainedBox.md ├── DockPanel.md ├── StaggeredLayout.md ├── StaggeredPanel.md ├── SwitchPresenter.md ├── UniformGrid.md ├── WrapLayout.md └── WrapPanel.md ├── RadialGauge └── index.md ├── RangeSelector └── index.md ├── RichSuggestBox └── index.md ├── Segmented └── index.md ├── SettingsControls ├── SettingsCard.md └── SettingsExpander.md ├── Sizers ├── ContentSizer.md ├── GridSplitter.md ├── PropertySizer.md └── SizerControls.md ├── TOC.yml ├── TabbedCommandBar └── index.md ├── TokenizingTextBox └── index.md ├── Triggers └── index.md ├── getting-started.md └── index.md /.gitattributes: -------------------------------------------------------------------------------- 1 | # Set the default behavior, in case people don't have core.autocrlf set. 2 | * text=auto 3 | 4 | # Explicitly declare text files you want to always be normalized and converted 5 | # to native line endings on checkout. 6 | *.c text 7 | *.h text 8 | 9 | # Declare files that will always have CRLF line endings on checkout. 10 | *.sln text eol=crlf 11 | 12 | # Denote all files that are truly binary and should not be modified. 13 | *.png binary 14 | *.jpg binary -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/customer-feedback.yml: -------------------------------------------------------------------------------- 1 | name: Learn feedback control 2 | description: | 3 | ⛔ This template is hooked into the feedback control on the bottom of every page on the live site. It automatically fills in several fields for you. Don't use it for other purposes. ⛔ 4 | body: 5 | - type: markdown 6 | attributes: 7 | value: "## Issue information" 8 | - type: markdown 9 | attributes: 10 | value: Select the issue type, and describe the issue in the text box below. Add as much detail as needed to help us resolve the issue. 11 | - type: dropdown 12 | id: issue-type 13 | attributes: 14 | label: Type of issue 15 | options: 16 | - Typo 17 | - Code doesn't work 18 | - Missing information 19 | - Outdated article 20 | - Other (describe below) 21 | validations: 22 | required: true 23 | - type: textarea 24 | id: feedback 25 | validations: 26 | required: true 27 | attributes: 28 | label: Description 29 | - type: markdown 30 | attributes: 31 | value: "## 🚧 Article information 🚧" 32 | - type: markdown 33 | attributes: 34 | value: "*Don't modify the following fields*. They are automatically filled in for you. Doing so will disconnect your issue from the affected article. *Don't edit them*." 35 | - type: input 36 | id: pageUrl 37 | validations: 38 | required: true 39 | attributes: 40 | label: Page URL 41 | - type: input 42 | id: contentSourceUrl 43 | validations: 44 | required: true 45 | attributes: 46 | label: Content source URL 47 | - type: input 48 | id: documentVersionIndependentId 49 | validations: 50 | required: true 51 | attributes: 52 | label: Document Version Independent Id 53 | - type: input 54 | id: platformId 55 | validations: 56 | required: true 57 | attributes: 58 | label: Platform Id 59 | - type: input 60 | id: author 61 | validations: 62 | required: true 63 | attributes: 64 | label: Article author 65 | - type: textarea 66 | id: metadata 67 | validations: 68 | required: false 69 | attributes: 70 | label: Metadata 71 | description: Documentation metadata will be applied here for the PRMerger tool. 72 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | log/ 2 | obj/ 3 | _site/ 4 | .optemp/ 5 | _themes*/ 6 | _repo.*/ 7 | 8 | .openpublishing.buildcore.ps1 9 | .DS_Store 10 | -------------------------------------------------------------------------------- /.openpublishing.publish.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "docsets_to_publish": [ 3 | { 4 | "docset_name": "CommunityToolkit", 5 | "build_source_folder": "docs", 6 | "build_output_subfolder": "CommunityToolkit", 7 | "locale": "en-us", 8 | "monikers": [], 9 | "moniker_ranges": [], 10 | "xref_query_tags": [ 11 | "/dotnet", 12 | "/uwp/api", 13 | "/windows/winui/api" 14 | ], 15 | "open_to_public_contributors": true, 16 | "type_mapping": { 17 | "Conceptual": "Content" 18 | }, 19 | "build_entry_point": "docs", 20 | "template_folder": "_themes" 21 | } 22 | ], 23 | "notification_subscribers": [], 24 | "sync_notification_subscribers": [], 25 | "branches_to_filter": [], 26 | "git_repository_url_open_to_public_contributors": "https://github.com/MicrosoftDocs/CommunityToolkit", 27 | "git_repository_branch_open_to_public_contributors": "main", 28 | "need_preview_pull_request": true, 29 | "need_pr_comments": true, 30 | "dependent_repositories": [ 31 | { 32 | "path_to_root": "code-windows", 33 | "url": "https://github.com/CommunityToolkit/Windows", 34 | "branch": "main", 35 | "branch_mapping": {} 36 | }, 37 | { 38 | "path_to_root": "_themes", 39 | "url": "https://github.com/Microsoft/templates.docs.msft", 40 | "branch": "main", 41 | "branch_mapping": {} 42 | }, 43 | { 44 | "path_to_root": "_themes.pdf", 45 | "url": "https://github.com/Microsoft/templates.docs.msft.pdf", 46 | "branch": "main", 47 | "branch_mapping": {} 48 | } 49 | ], 50 | "branch_target_mapping": { 51 | "live": [ 52 | "Publish", 53 | "Pdf" 54 | ] 55 | }, 56 | "targets": { 57 | "pdf": { 58 | "template_folder": "_themes.pdf" 59 | } 60 | }, 61 | "docs_build_engine": {}, 62 | "skip_source_output_uploading": false, 63 | "contribution_branch_mappings": {}, 64 | "need_generate_pdf_url_template": true 65 | } 66 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contribute to the Community Toolkits documentation 2 | 3 | Thank you for your interest in contributing to one of the Community Toolkits documentation. 4 | 5 | This repository houses documentation for multiple toolkits so please choose the relevant contributing guideline to match your contribution: 6 | 7 | ## .NET MAUI Community Toolkit 8 | 9 | The contributing guidelines for the .NET MAUI Community Toolkit can be found at: 10 | - [Contributing guidelines](contributing/contributing-maui.md) 11 | -------------------------------------------------------------------------------- /LICENSE-CODE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | Copyright (c) Microsoft Corporation 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 5 | associated documentation files (the "Software"), to deal in the Software without restriction, 6 | including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 8 | subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all copies or substantial 11 | portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT 14 | NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 15 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 16 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 17 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Community Toolkit Docs 2 | 3 | This repo contains the [guidance documentation](https://aka.ms/toolkit/docs) for various [Community Toolkits](https://github.com/CommunityToolkit) that are part of the [.NET Foundation](https://dotnetfoundation.org/). 4 | 5 | This includes the following projects: 6 | 7 | - .NET Community Toolkit (and MVVM Toolkit) 8 | - .NET MAUI Community Toolkit 9 | - Windows Community Toolkit (though our docs are still migrating from [the old repo here](https://github.com/MicrosoftDocs/WindowsCommunityToolkitDocs)) 10 | 11 | More information to come... 12 | 13 | ## Microsoft Open Source Code of Conduct 14 | 15 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). 16 | For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. 17 | -------------------------------------------------------------------------------- /ThirdPartyNotices.md: -------------------------------------------------------------------------------- 1 | ## Legal Notices 2 | Microsoft and any contributors grant you a license to the Microsoft documentation and other content 3 | in this repository under the [Creative Commons Attribution 4.0 International Public License](https://creativecommons.org/licenses/by/4.0/legalcode), 4 | see the [LICENSE](LICENSE) file, and grant you a license to any code in the repository under the [MIT License](https://opensource.org/licenses/MIT), see the 5 | [LICENSE-CODE](LICENSE-CODE) file. 6 | 7 | Microsoft, Windows, Microsoft Azure and/or other Microsoft products and services referenced in the documentation 8 | may be either trademarks or registered trademarks of Microsoft in the United States and/or other countries. 9 | The licenses for this project do not grant you rights to use any Microsoft names, logos, or trademarks. 10 | Microsoft's general trademark guidelines can be found at http://go.microsoft.com/fwlink/?LinkID=254653. 11 | 12 | Privacy information can be found at https://privacy.microsoft.com/en-us/ 13 | 14 | Microsoft and any contributors reserve all others rights, whether under their respective copyrights, patents, 15 | or trademarks, whether by implication, estoppel or otherwise. -------------------------------------------------------------------------------- /docs/TOC.yml: -------------------------------------------------------------------------------- 1 | - name: Community Toolkits for .NET 2 | expanded: true 3 | items: 4 | - name: Overview 5 | href: index.yml 6 | - name: .NET Community Toolkit 7 | items: 8 | - name: Introduction 9 | href: introduction.md 10 | - name: Getting Started 11 | href: /windows/communitytoolkit/getting-started 12 | - name: MVVM Toolkit 13 | items: 14 | - name: Introduction 15 | href: mvvm/index.md 16 | - name: Samples 17 | href: https://aka.ms/mvvmtoolkit/samples 18 | - name: Diagnostics 19 | items: 20 | - name: Introduction 21 | href: diagnostics/Introduction.md 22 | - name: Guard 23 | href: diagnostics/Guard.md 24 | - name: ThrowHelper 25 | href: diagnostics/ThrowHelper.md 26 | - name: High Performance 27 | items: 28 | - name: Introduction 29 | href: high-performance/Introduction.md 30 | - name: Span2D 31 | href: high-performance/Span2D.md 32 | - name: Memory2D 33 | href: high-performance/Memory2D.md 34 | - name: SpanOwner 35 | href: high-performance/SpanOwner.md 36 | - name: MemoryOwner 37 | href: high-performance/MemoryOwner.md 38 | - name: StringPool 39 | href: high-performance/StringPool.md 40 | - name: ParallelHelper 41 | href: high-performance/ParallelHelper.md 42 | - name: Ref 43 | href: high-performance/Ref.md 44 | - name: .NET Aspire Community Toolkit 45 | href: /dotnet/aspire/community-toolkit/overview 46 | - name: Windows Community Toolkit 47 | items: 48 | - name: Introduction 49 | href: windows/index.md 50 | - name: Getting Started 51 | href: windows/getting-started.md 52 | - name: Labs 53 | href: https://aka.ms/toolkit/labs/windows 54 | - name: Sample Gallery 55 | href: https://aka.ms/windowstoolkitapp 56 | - name: .NET MAUI Community Toolkit 57 | href: maui/index.md 58 | -------------------------------------------------------------------------------- /docs/breadcrumb/toc.yml: -------------------------------------------------------------------------------- 1 | - name: Docs 2 | tocHref: / 3 | topicHref: / 4 | items: 5 | - name: .NET 6 | tocHref: /dotnet/ 7 | topicHref: /dotnet/index 8 | -------------------------------------------------------------------------------- /docs/diagnostics/Introduction.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Introduction to the Diagnostics package 3 | author: Sergio0694 4 | description: An overview of how to get started with the Diagnostics package and to the APIs it contains 5 | keywords: windows 10, uwp, windows community toolkit, uwp community toolkit, uwp toolkit, .net community toolkit, csharp, get started, visual studio, diagnostics, exceptions, contract, net core, net standard 6 | --- 7 | 8 | # Introduction to the Diagnostics package 9 | 10 | The `CommunityToolkit.Diagnostics` package contains APIs to efficiently validate method parameters and to throw exceptions in faulting code paths. It is meant to be used to help simplify all argument checks and to make them more expressive and easier to read, while at the same time improving codegen quality and performance. 11 | 12 | This package can be installed through NuGet, and it has the following multi-targets: 13 | 14 | - .NET Standard 2.0 15 | - .NET Standard 2.1 16 | - .NET 6 17 | 18 | This means the package can be used on any available runtime (including .NET Framework, .NET Core, UWP, Unity, Xamarin, Uno, Blazor, etc.). The API surface is almost identical in all cases, while the internal implementation can be optimized when newer APIs are available. The Diagnostics package as a whole is meant to be self-contained and extremely small in scope and binary size. 19 | 20 | ## Getting started 21 | 22 | To install the package from within Visual Studio: 23 | 24 | 1. In Solution Explorer, right-click on the project and select **Manage NuGet Packages**. Search for **CommunityToolkit.Diagnostics** and install it. 25 | 26 | ![NuGet Packages](../images/get-started/manage-nuget-packages.png "Manage NuGet Packages Image") 27 | 28 | 2. Add a using or Imports directive to use the new APIs: 29 | 30 | ```c# 31 | using CommunityToolkit.Diagnostics; 32 | ``` 33 | 34 | ```vb 35 | Imports CommunityToolkit.Diagnostics 36 | ``` 37 | 38 | ## Additional resources 39 | 40 | You can find more examples in the [unit tests](https://github.com/CommunityToolkit/dotnet/tree/main/tests/CommunityToolkit.Diagnostics.UnitTests). -------------------------------------------------------------------------------- /docs/images/get-started/manage-nuget-packages.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/CommunityToolkit/8d5872986998496d790f420c27b5c246592c6376/docs/images/get-started/manage-nuget-packages.png -------------------------------------------------------------------------------- /docs/images/mediaelement/intro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/CommunityToolkit/8d5872986998496d790f420c27b5c246592c6376/docs/images/mediaelement/intro.png -------------------------------------------------------------------------------- /docs/images/source-generator-visualization.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/CommunityToolkit/8d5872986998496d790f420c27b5c246592c6376/docs/images/source-generator-visualization.png -------------------------------------------------------------------------------- /docs/maui/.template.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: TITLE 3 | author: GITHUB_USERNAME 4 | description: DESCRIPTION 5 | ms.date: MM/dd/yyyy 6 | --- 7 | 8 | # TITLE 9 | 10 | DESCRIPTION 11 | 12 | ## Syntax 13 | 14 | 15 | 16 | ### XAML 17 | 18 | ### C# 19 | 20 | ### C# Markup 21 | 22 | ## Examples 23 | 24 | You can find an example of this converter in action in the [.NET MAUI Community Toolkit Sample Application](https://github.com/CommunityToolkit/Maui/blob/main/samples/CommunityToolkit.Maui.Sample/COMPLETE_THIS_PATH). 25 | 26 | ## API 27 | 28 | You can find the source code for `FEATURE` over on the [.NET MAUI Community Toolkit GitHub repository](https://github.com/CommunityToolkit/Maui/blob/main/src/COMPLETE_THIS_PATH). 29 | -------------------------------------------------------------------------------- /docs/maui/alerts/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Alerts - .NET MAUI Community Toolkit 3 | author: VladislavAntonyuk 4 | description: The .NET MAUI Community Toolkit extends .NET MAUI alerts with Toast and Snackbar. 5 | ms.date: 03/30/2022 6 | --- 7 | 8 | # Alerts 9 | 10 | Alerts provide a way of notifying users about information. Common use cases include providing a message when an operation succeeds or fails. 11 | 12 | ## .NET MAUI Community Toolkit Alerts 13 | 14 | The .NET MAUI Community Toolkit extends the list of .NET MAUI alerts. Here are the alerts provided by the toolkit: 15 | 16 | | Alert | Description | 17 | | --------- | ----------- | 18 | | [`Snackbar`](snackbar.md) | The `Snackbar` is a timed alert that appears at the bottom of the screen by default. It is dismissed after a configurable duration of time. `Snackbar` is fully customizable and can be anchored to any `IView`. | 19 | | [`Toast`](toast.md) | The `Toast` is a timed alert that appears at the bottom of the screen by default. It is dismissed after a configurable duration of time. | 20 | -------------------------------------------------------------------------------- /docs/maui/animations/fade-animation.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: FadeAnimation - .NET MAUI Community Toolkit 3 | author: bijington 4 | description: The FadeAnimation provides the ability to animate the opacity of a VisualElement from its original opacity to a specified new opacity and then back to the original. 5 | ms.date: 09/16/2022 6 | --- 7 | 8 | # FadeAnimation 9 | 10 | The `FadeAnimation` provides the ability to animate the opacity of a `VisualElement` from its original opacity to a specified new opacity and then back to the original. 11 | 12 | ## Syntax 13 | 14 | ### XAML 15 | 16 | For use within XAML the `FadeAnimation` must be used in conjunction with the [`AnimationBehavior`](../behaviors/animation-behavior.md). 17 | 18 | ### C# 19 | 20 | The `FadeAnimation` can be used as follows in C#: 21 | 22 | ```csharp 23 | public async void Animate() 24 | { 25 | var label = new Label(); 26 | 27 | var fadeAnimation = new FadeAnimation(); 28 | 29 | await fadeAnimation.Animate(label); 30 | } 31 | ``` 32 | 33 | ## Examples 34 | 35 | You can find an example of this animation in action in the [.NET MAUI Community Toolkit Sample Application](https://github.com/CommunityToolkit/Maui/blob/main/samples/CommunityToolkit.Maui.Sample/Pages/Behaviors/AnimationBehaviorPage.xaml). 36 | 37 | ## API 38 | 39 | You can find the source code for `FadeAnimation` over on the [.NET MAUI Community Toolkit GitHub repository](https://github.com/CommunityToolkit/Maui/blob/main/src/CommunityToolkit.Maui/Animations/FadeAnimation.shared.cs). 40 | -------------------------------------------------------------------------------- /docs/maui/animations/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Animations - .NET MAUI Community Toolkit 3 | author: bijington 4 | description: The .NET MAUI Community Toolkit provides a collection of pre-built, reusable animations to make developers lives easier. 5 | ms.date: 09/16/2022 6 | --- 7 | 8 | # Animations 9 | 10 | The .NET Multi-platform App UI (.NET MAUI) animation classes target different properties of visual elements, with a typical basic animation progressively changing a property from one value to another over a period of time. 11 | 12 | For further information on Animations please refer to the [.NET MAUI documentation](/dotnet/maui/user-interface/animation/basic). 13 | 14 | ## .NET MAUI Community Toolkit Animations 15 | 16 | The .NET MAUI Community Toolkit provides a collection of pre-built, reusable animations that can be used in both C# and XAML. Here are the animations provided by the toolkit: 17 | 18 | | Behavior | Description | 19 | | --------- | ----------- | 20 | | [`FadeAnimation`](../animations/fade-animation.md) | The `FadeAnimation` provides the ability to animate the opacity of a `VisualElement` from it's original opacity, to a specified new opacity and then back to the original. | 21 | 22 | ## Creating custom animations 23 | 24 | All animations provided by the .NET MAUI Community Toolkit inherit from our `BaseAnimation` class. In order to create any custom animation of your choosing you can do the same. 25 | 26 | The following example shows how to change the `BackgroundColor` of a `VisualElement` using our very own [`BackgroundColorTo`](../extensions/color-animation-extensions.md#backgroundcolorto) extension method. 27 | 28 | ```csharp 29 | using CommunityToolkit.Maui.Extensions; 30 | 31 | class PaintTheRainbowAnimation : BaseAnimation 32 | { 33 | public override async Task Animate(VisualElement view) 34 | { 35 | await view.BackgroundColorTo(Colors.Red); 36 | await view.BackgroundColorTo(Colors.Orange); 37 | await view.BackgroundColorTo(Colors.Yellow); 38 | await view.BackgroundColorTo(Colors.Green); 39 | await view.BackgroundColorTo(Colors.Blue); 40 | await view.BackgroundColorTo(Colors.Indigo); 41 | await view.BackgroundColorTo(Colors.Violet); 42 | } 43 | } 44 | ``` 45 | -------------------------------------------------------------------------------- /docs/maui/essentials/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Essentials - .NET MAUI Community Toolkit 3 | author: jfversluis 4 | description: The .NET MAUI Community Toolkit Essentials provides developers with cross-platform APIs for their applications. 5 | ms.date: 08/09/2023 6 | --- 7 | 8 | # Essentials 9 | 10 | Android, iOS, MacCatalyst, Windows, and Tizen offer unique operating system and platform APIs that developers have access to all in C# leveraging .NET. Essentials provides a single cross-platform API that works with any .NET MAUI application that can be accessed from shared code no matter how the user interface is created. 11 | 12 | ## .NET MAUI Community Toolkit Essentials 13 | 14 | The .NET MAUI Community Toolkit provides a collection of cross-platform APIs for their applications. Here are the APIs provided by the toolkit: 15 | 16 | | Essential | Description | 17 | | --------- | ----------- | 18 | | [`AppTheme Resources`](../essentials/apptheme-resources.md) | With `AppThemeObject` and `AppThemeColor` you can create theme aware resources for your application that automatically update when the device theme updates. | 19 | | [`Badge`](../essentials/badge.md) | The `Badge` allows developers to set the app icon badge number on the homescreen. | 20 | | [`FolderPicker`](../essentials/folder-picker.md) | The `FolderPicker` allows picking a folder from the file system. | 21 | | [`FileSaver`](../essentials/file-saver.md) | The `FileSaver` provides the ability to select target folder and save files to the file system. | 22 | | [`SpeechToText`](../essentials/speech-to-text.md) | The `SpeechToText` provides the ability to convert speech to text. | 23 | -------------------------------------------------------------------------------- /docs/maui/extensions/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Extensions - .NET MAUI Community Toolkit 3 | author: bijington 4 | description: The .NET MAUI Community Toolkit provides a set of extension methods to simplify common tasks. 5 | ms.date: 04/22/2022 6 | --- 7 | 8 | # Extensions 9 | 10 | The .NET MAUI Community Toolkit provides a set of extension methods to simplify common tasks such as animating the `BackgroundColor` change of a `VisualElement`. 11 | 12 | ## .NET MAUI Community Toolkit Extensions 13 | 14 | The .NET MAUI Community Toolkit provides a collection of extension methods to make developers lives easier. Here are the extension methods provided by the toolkit: 15 | 16 | | Extension | Description | 17 | | --------- | ----------- | 18 | | [`ColorAnimationExtensions`](color-animation-extensions.md) | The `ColorAnimationExtensions` provide a series of extension methods that support animating the `Color` related properties of a `VisualElement`. | 19 | | [`ColorConversionExtensions`](color-conversion-extensions.md) | The `ColorConversionExtensions` provide a series of extension methods that support converting, modifying or inspecting `Color`s. | 20 | | [`KeyboardExtensions`](keyboard-extensions.md) | The `KeyboardExtensions` provide a series of extension methods that support interacting with the Keyboard on controls that support text input. | 21 | | [`ServiceCollectionExtensions`](servicecollection-extensions.md) | The `ServiceCollectionExtensions` provide a series of extension methods that simplify registering Views and their associated ViewModels within the .NET MAUI `IServiceCollection`. | 22 | -------------------------------------------------------------------------------- /docs/maui/extensions/keyboard-extensions.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: KeyboardExtensions - .NET MAUI Community Toolkit 3 | author: PureWeen 4 | description: "The KeyboardExtensions provide a series of extension methods that support interacting with the Keyboard." 5 | ms.date: 04/12/2023 6 | --- 7 | 8 | # KeyboardExtensions 9 | 10 | The `KeyboardExtensions` provide a series of extension methods that support interacting with the Keyboard on controls that support text input. 11 | 12 | The `KeyboardExtensions` can be found under the `CommunityToolkit.Maui.Core.Platform` namespace so just add the following line to get started: 13 | 14 | ```csharp 15 | using CommunityToolkit.Maui.Core.Platform; 16 | ``` 17 | 18 | ## Soft Keyboard Methods 19 | 20 | The following methods allow you to close, show, and check if the keyboard is open. 21 | 22 | ### Hide Keyboard 23 | 24 | The `HideKeyboardAsync` method will hide the Soft Input Keyboard if it is currently visible 25 | 26 | The following example shows how to hide the keyboard for a given entry: 27 | 28 | ```csharp 29 | using CommunityToolkit.Maui.Core.Platform; 30 | 31 | entry.HideKeyboardAsync(CancellationToken.None); 32 | ``` 33 | 34 | ### Show Keyboard 35 | 36 | The `ShowKeyboardAsync` method will show the Soft Input Keyboard and indicates what control you are opening it for 37 | 38 | The following example shows how to show the keyboard for a given entry: 39 | ```csharp 40 | using CommunityToolkit.Maui.Core.Platform; 41 | 42 | entry.ShowKeyboardAsync(CancellationToken.None); 43 | ``` 44 | 45 | ### Is SoftKeyboard Showing 46 | 47 | The `IsSoftKeyboardShowing` method indicates if the Soft Keyboard is currently open. 48 | 49 | The following example shows how to check if the Soft Input Keyboard is currently open and showing: 50 | 51 | ```csharp 52 | using CommunityToolkit.Maui.Core.Platform; 53 | 54 | entry.IsSoftKeyboardShowing() 55 | ``` 56 | 57 | ## Examples 58 | 59 | You can find an example of this extension in action in the [.NET MAUI Community Toolkit Sample Application](https://github.com/CommunityToolkit/Maui/blob/main/samples/CommunityToolkit.Maui.Sample/Pages/Extensions/KeyboardExtensionsPage.xaml). 60 | 61 | ## API 62 | 63 | You can find the source code for `KeyboardExtensions` over on the [.NET MAUI Community Toolkit GitHub repository](https://github.com/CommunityToolkit/Maui/blob/main/src/CommunityToolkit.Maui.Core/Platform/KeyboardExtensions/KeyboardExtensions.shared.cs). 64 | -------------------------------------------------------------------------------- /docs/maui/images/alerts/snackbar-android.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/CommunityToolkit/8d5872986998496d790f420c27b5c246592c6376/docs/maui/images/alerts/snackbar-android.gif -------------------------------------------------------------------------------- /docs/maui/images/alerts/snackbar-ios.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/CommunityToolkit/8d5872986998496d790f420c27b5c246592c6376/docs/maui/images/alerts/snackbar-ios.gif -------------------------------------------------------------------------------- /docs/maui/images/alerts/toast-android.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/CommunityToolkit/8d5872986998496d790f420c27b5c246592c6376/docs/maui/images/alerts/toast-android.gif -------------------------------------------------------------------------------- /docs/maui/images/alerts/toast-ios.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/CommunityToolkit/8d5872986998496d790f420c27b5c246592c6376/docs/maui/images/alerts/toast-ios.gif -------------------------------------------------------------------------------- /docs/maui/images/behaviors/animation-behavior-android.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/CommunityToolkit/8d5872986998496d790f420c27b5c246592c6376/docs/maui/images/behaviors/animation-behavior-android.gif -------------------------------------------------------------------------------- /docs/maui/images/behaviors/character-validation-behavior-android.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/CommunityToolkit/8d5872986998496d790f420c27b5c246592c6376/docs/maui/images/behaviors/character-validation-behavior-android.gif -------------------------------------------------------------------------------- /docs/maui/images/behaviors/email-validation-behavior-android.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/CommunityToolkit/8d5872986998496d790f420c27b5c246592c6376/docs/maui/images/behaviors/email-validation-behavior-android.gif -------------------------------------------------------------------------------- /docs/maui/images/behaviors/masked-behavior-android.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/CommunityToolkit/8d5872986998496d790f420c27b5c246592c6376/docs/maui/images/behaviors/masked-behavior-android.gif -------------------------------------------------------------------------------- /docs/maui/images/behaviors/masked-behavior-unmasked-character.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/CommunityToolkit/8d5872986998496d790f420c27b5c246592c6376/docs/maui/images/behaviors/masked-behavior-unmasked-character.png -------------------------------------------------------------------------------- /docs/maui/images/behaviors/multi-validation-behavior-android.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/CommunityToolkit/8d5872986998496d790f420c27b5c246592c6376/docs/maui/images/behaviors/multi-validation-behavior-android.gif -------------------------------------------------------------------------------- /docs/maui/images/behaviors/required-string-validation-behavior-android.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/CommunityToolkit/8d5872986998496d790f420c27b5c246592c6376/docs/maui/images/behaviors/required-string-validation-behavior-android.gif -------------------------------------------------------------------------------- /docs/maui/images/behaviors/text-validation-behavior-android.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/CommunityToolkit/8d5872986998496d790f420c27b5c246592c6376/docs/maui/images/behaviors/text-validation-behavior-android.gif -------------------------------------------------------------------------------- /docs/maui/images/behaviors/uri-validation-behavior-android.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/CommunityToolkit/8d5872986998496d790f420c27b5c246592c6376/docs/maui/images/behaviors/uri-validation-behavior-android.gif -------------------------------------------------------------------------------- /docs/maui/images/behaviors/user-stopped-typing-behavior-android.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/CommunityToolkit/8d5872986998496d790f420c27b5c246592c6376/docs/maui/images/behaviors/user-stopped-typing-behavior-android.gif -------------------------------------------------------------------------------- /docs/maui/images/essentials/badge-windows.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/CommunityToolkit/8d5872986998496d790f420c27b5c246592c6376/docs/maui/images/essentials/badge-windows.gif -------------------------------------------------------------------------------- /docs/maui/images/essentials/file-saver-mac.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/CommunityToolkit/8d5872986998496d790f420c27b5c246592c6376/docs/maui/images/essentials/file-saver-mac.png -------------------------------------------------------------------------------- /docs/maui/images/essentials/speech-to-text-mac.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/CommunityToolkit/8d5872986998496d790f420c27b5c246592c6376/docs/maui/images/essentials/speech-to-text-mac.gif -------------------------------------------------------------------------------- /docs/maui/images/get-started/manage-nuget.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/CommunityToolkit/8d5872986998496d790f420c27b5c246592c6376/docs/maui/images/get-started/manage-nuget.png -------------------------------------------------------------------------------- /docs/maui/images/layouts/DockLayout.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Top 9 | 10 | 11 | Right 12 | 13 | 14 | 15 | 16 | None 17 | 18 | 19 | 20 | 21 | Left 22 | 23 | 24 | 25 | Bottom 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /docs/maui/images/layouts/statecontainer.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/CommunityToolkit/8d5872986998496d790f420c27b5c246592c6376/docs/maui/images/layouts/statecontainer.gif -------------------------------------------------------------------------------- /docs/maui/images/native-library-interop/nativelibraryinterop-conceptual-overview-android.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/CommunityToolkit/8d5872986998496d790f420c27b5c246592c6376/docs/maui/images/native-library-interop/nativelibraryinterop-conceptual-overview-android.png -------------------------------------------------------------------------------- /docs/maui/images/native-library-interop/nativelibraryinterop-conceptual-overview-ios.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/CommunityToolkit/8d5872986998496d790f420c27b5c246592c6376/docs/maui/images/native-library-interop/nativelibraryinterop-conceptual-overview-ios.png -------------------------------------------------------------------------------- /docs/maui/images/native-library-interop/nativelibraryinterop-conceptual-overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/CommunityToolkit/8d5872986998496d790f420c27b5c246592c6376/docs/maui/images/native-library-interop/nativelibraryinterop-conceptual-overview.png -------------------------------------------------------------------------------- /docs/maui/images/navigation-bar/navigation-bar-sample.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/CommunityToolkit/8d5872986998496d790f420c27b5c246592c6376/docs/maui/images/navigation-bar/navigation-bar-sample.png -------------------------------------------------------------------------------- /docs/maui/images/views/Expander-ListView.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/CommunityToolkit/8d5872986998496d790f420c27b5c246592c6376/docs/maui/images/views/Expander-ListView.gif -------------------------------------------------------------------------------- /docs/maui/images/views/Expander.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/CommunityToolkit/8d5872986998496d790f420c27b5c246592c6376/docs/maui/images/views/Expander.gif -------------------------------------------------------------------------------- /docs/maui/images/views/RatingView.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/CommunityToolkit/8d5872986998496d790f420c27b5c246592c6376/docs/maui/images/views/RatingView.png -------------------------------------------------------------------------------- /docs/maui/images/views/RatingView_CustomShape.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/CommunityToolkit/8d5872986998496d790f420c27b5c246592c6376/docs/maui/images/views/RatingView_CustomShape.png -------------------------------------------------------------------------------- /docs/maui/images/views/RatingView_RatingFill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/CommunityToolkit/8d5872986998496d790f420c27b5c246592c6376/docs/maui/images/views/RatingView_RatingFill.png -------------------------------------------------------------------------------- /docs/maui/images/views/RatingView_Shape.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/CommunityToolkit/8d5872986998496d790f420c27b5c246592c6376/docs/maui/images/views/RatingView_Shape.png -------------------------------------------------------------------------------- /docs/maui/images/views/drawingview-android.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/CommunityToolkit/8d5872986998496d790f420c27b5c246592c6376/docs/maui/images/views/drawingview-android.gif -------------------------------------------------------------------------------- /docs/maui/images/views/drawingview-multiline-android.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/CommunityToolkit/8d5872986998496d790f420c27b5c246592c6376/docs/maui/images/views/drawingview-multiline-android.gif -------------------------------------------------------------------------------- /docs/maui/imagesources/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: ImageSources - .NET MAUI Community Toolkit 3 | author: GeorgeLeithead 4 | description: The .NET MAUI Community Toolkit extends .NET MAUI ImageSources. 5 | ms.date: 09/16/2022 6 | --- 7 | 8 | # ImageSources 9 | 10 | The .NET Multi-platform App UI (.NET MAUI) `Image` displays an image that can be loaded from a local file, a URI, an embedded resource, or a stream. The standard platform image formats are supported, including animated GIFs, and local Scalable Vector Graphics (SVG) files are also supported. For more information about the `Image` control, see [Image](/dotnet/maui/user-interface/controls/image). 11 | 12 | Any control that has a property of type `ImageSource`, can specify the source of an image. The `ImageSource` property has the following methods that can be used to load an image from different sources: 13 | 14 | - `FromFile` returns a `FileImageSource` that reads an image from a local file. 15 | - `FromUri` returns an `UriImageSource` that downloads and reads an image from a specified URI. 16 | - `FromResource` returns a `StreamImageSource` that reads an image file embedded in an assembly. 17 | - `FromStream` returns a `StreamImageSource` that reads an image from a stream that supplies image data. 18 | 19 | ## .NET MAUI Community Toolkit ImageSources 20 | 21 | The .NET MAUI Community Toolkit provides a collection of additional pre-built, reusable `ImageSources` to make developers lives easier. Here are the sources provided by the toolkit: 22 | 23 | | View | Description | 24 | | --------- | ----------- | 25 | | [`GravatarImageSource`](GravatarImageSource.md) | The `GravatarImageSource` provides an Image source to display a users Gravatar registered image via their email address. | -------------------------------------------------------------------------------- /docs/maui/includes/behavior-bindings.md: -------------------------------------------------------------------------------- 1 | --- 2 | ms.topic: include 3 | --- 4 | 5 | > [!IMPORTANT] 6 | > The .NET MAUI Community Toolkit Behaviors do not set the `BindingContext` of a behavior, because behaviors can be shared and applied to multiple controls through styles. For more information refer to [.NET MAUI Behaviors](/dotnet/maui/fundamentals/behaviors#net-maui-behaviors) 7 | -------------------------------------------------------------------------------- /docs/maui/includes/communitytoolkit-converter.md: -------------------------------------------------------------------------------- 1 | --- 2 | ms.topic: include 3 | --- 4 | 5 | ### BaseConverter Properties 6 | 7 | The following properties are implemented in the base class, `public abstract class BaseConverter`: 8 | 9 | |Property |Description | 10 | |---------|---------| 11 | | `DefaultConvertReturnValue` | Default value to return when `IValueConverter.Convert(object?, Type, object?, CultureInfo?)` throws an `Exception`. This value is used when [CommunityToolkit.Maui.Options](../options.md)`.ShouldSuppressExceptionsInConverters` is set to `true`. | 12 | | `DefaultConvertBackReturnValue` | Default value to return when `IValueConverter.ConvertBack(object?, Type, object?, CultureInfo?)` throws an `Exception`. This value is used when [CommunityToolkit.Maui.Options](../options.md)`.ShouldSuppressExceptionsInConverters` is set to `true`. | 13 | 14 | ### ICommunityToolkitValueConverter Properties 15 | 16 | The following properties are implemented in the `public interface ICommunityToolkitValueConverter`: 17 | 18 | |Property |Type |Description | 19 | |---------|---------|---------| 20 | | `DefaultConvertReturnValue` | `object?` | Default value to return when `IValueConverter.Convert(object?, Type, object?, CultureInfo?)` throws an `Exception`. This value is used when [CommunityToolkit.Maui.Options](../options.md)`.ShouldSuppressExceptionsInConverters` is set to `true`. | 21 | | `DefaultConvertBackReturnValue` | `object?` | Default value to return when `IValueConverter.ConvertBack(object?, Type, object?, CultureInfo?)` throws an `Exception`. This value is used when [CommunityToolkit.Maui.Options](../options.md)`.ShouldSuppressExceptionsInConverters` is set to `true`. | 22 | -------------------------------------------------------------------------------- /docs/maui/includes/math-expression-operations.md: -------------------------------------------------------------------------------- 1 | --- 2 | ms.topic: include 3 | --- 4 | 5 | ## Supported operations 6 | 7 | The following operations are supported: 8 | 9 | - `"+"` 10 | - `"-"` 11 | - `"*"` 12 | - `"/"` 13 | - `"%"` 14 | - `"?"` `":"` 15 | - `"=="` 16 | - `"!="` 17 | - `"!"` 18 | - `"or"` or `"||"` 19 | - `"and"` or `"&&"` if you want to use this in XAML you will need to escape the characters (e.g. `"&&"`) 20 | - `"ge"` or `">="` if you want to use this in XAML you will need to escape the characters (e.g. `">="`) 21 | - `"gt"` or `">"` if you want to use this in XAML you will need to escape the characters (e.g. `">"`) 22 | - `"le"` or `"<="` if you want to use this in XAML you will need to escape the characters (e.g. `"<="`) 23 | - `"lt"` or `"<"` if you want to use this in XAML you will need to escape the characters (e.g. `"<"`) 24 | - `"abs"` 25 | - `"acos"` 26 | - `"asin"` 27 | - `"atan"` 28 | - `"atan2"` 29 | - `"ceiling"` 30 | - `"cos"` 31 | - `"cosh"` 32 | - `"exp"` 33 | - `"floor"` 34 | - `"ieeeremainder"` 35 | - `"log"` 36 | - `"log10"` 37 | - `"max"` 38 | - `"min"` 39 | - `"pow"` 40 | - `"round"` 41 | - `"sign"` 42 | - `"sin"` 43 | - `"sinh"` 44 | - `"sqrt"` 45 | - `"tan"` 46 | - `"tanh"` 47 | - `"truncate"` 48 | - `"^"` 49 | - `"pi"` 50 | - `"e"` 51 | - `"true"` 52 | - `"false"` 53 | -------------------------------------------------------------------------------- /docs/maui/includes/validation-behavior.md: -------------------------------------------------------------------------------- 1 | --- 2 | ms.topic: include 3 | --- 4 | 5 | ### ValidationBehavior Properties 6 | 7 | The following properties are implemented in the base class, `public abstract class ValidationBehavior`: 8 | 9 | |Property |Type |Description | 10 | |---------|---------|---------| 11 | | `Flags` | `ValidationFlags` | Provides an enumerated value that specifies how to handle validation. | 12 | | `ForceValidateCommand` | `ICommand` | Allows the user to provide a custom `ICommand` that handles forcing validation. | 13 | | `InvalidStyle` | `Style` | The `Style` to apply to the element when validation fails. | 14 | | `IsNotValid` | `bool` | Indicates whether or not the current value is considered not valid. | 15 | | `IsRunning` | `bool` | Indicates whether or not the validation is in progress now (waiting for an asynchronous call is finished). | 16 | | `IsValid` | `bool` | Indicates whether or not the current value is considered valid. | 17 | | `ValidStyle` | `Style` | The `Style` to apply to the element when validation is successful. | 18 | | `Value` | `object` | The value to validate. | 19 | | `ValuePropertyName` | `string` | Allows the user to override the property that will be used as the value to validate. | 20 | -------------------------------------------------------------------------------- /docs/maui/includes/xaml-usage.md: -------------------------------------------------------------------------------- 1 | --- 2 | ms.topic: include 3 | --- 4 | 5 | In order to use the toolkit in XAML the following `xmlns` needs to be added into your page or view: 6 | 7 | ```xaml 8 | xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit" 9 | ``` 10 | 11 | Therefore the following: 12 | 13 | ```xaml 14 | 18 | 19 | 20 | ``` 21 | 22 | Would be modified to include the `xmlns` as follows: 23 | 24 | ```xaml 25 | 30 | 31 | 32 | ``` 33 | -------------------------------------------------------------------------------- /docs/maui/layouts/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Layouts - .NET MAUI Community Toolkit 3 | author: VladislavAntonyuk 4 | description: The .NET MAUI Community Toolkit extends .NET MAUI layouts. 5 | ms.date: 04/21/2022 6 | --- 7 | 8 | # Layouts 9 | 10 | ## .NET MAUI Community Toolkit Layouts 11 | 12 | The .NET MAUI Community Toolkit extends the list of .NET MAUI layouts. Here are the layouts provided by the toolkit: 13 | 14 | | View | Description | 15 | | --------- | ----------- | 16 | | [`DockLayout`](DockLayout.md) | The `DockLayout` is a layout where views can be docked to the sides (top, left, right, bottom) of the layout container. | 17 | | [`StateContainer`](StateContainer.md) | The `StateContainer` bindable properties enable any Layout derived element to become state-aware. | 18 | | [`UniformItemsLayout`](UniformItemsLayout.md) | The `UniformItemsLayout` is a layout where all rows and columns have the same size. | 19 | -------------------------------------------------------------------------------- /docs/maui/markup/dotnet-hot-reload.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicrosoftDocs/CommunityToolkit/8d5872986998496d790f420c27b5c246592c6376/docs/maui/markup/dotnet-hot-reload.gif -------------------------------------------------------------------------------- /docs/maui/markup/extensions/automation-properties.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AutomationProperties extensions - .NET MAUI Community Toolkit 3 | author: bijington 4 | description: The AutomationProperties extensions provide a series of extension methods that support the configuring of accessibility related settings. 5 | ms.date: 09/14/2022 6 | --- 7 | 8 | # AutomationProperties extensions 9 | 10 | The `AutomationProperties` extensions provide a series of extension methods that support the configuring of accessibility related settings. 11 | 12 | Automation properties are attached properties that can be added to any element to indicate how the element is reported to the underlying platform's accessibility framework. 13 | 14 | For further information on `AutomationProperties` and accessibility please refer to the [.NET MAUI documentation](/dotnet/maui/fundamentals/accessibility#automation-properties). 15 | 16 | For information on other accessibility related extensions please refer to the [SemanticProperties extensions](semantic-properties.md). 17 | 18 | ## AutomationExcludedWithChildren 19 | 20 | The `AutomationExcludedWithChildren` method sets a value determining if the `BindableObject` and its children should be excluded from the accessibility tree. 21 | 22 | The following example demonstrates how to exclude a new `VerticalStackLayout` and its children from the accessibility tree: 23 | 24 | ```cs 25 | new VerticalStackLayout().AutomationExcludedWithChildren(true); 26 | ``` 27 | 28 | ## AutomationIsInAccessibleTree 29 | 30 | The `AutomationIsInAccessibleTree` method sets a value determining if the `BindableObject` is visible to screen readers. 31 | 32 | The following example demonstrates how to exclude a new `VerticalStackLayout` from the accessibility tree: 33 | 34 | ```cs 35 | new VerticalStackLayout().AutomationIsInAccessibleTree(false); 36 | ``` 37 | -------------------------------------------------------------------------------- /docs/maui/markup/extensions/dynamic-resource-handler-extensions.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: DynamicResourceHandler extensions - .NET MAUI Community Toolkit 3 | author: TheCodeTraveler 4 | description: The Dynamic Resource Handler extensions provide a series of extension methods that support configuring IDynamicResourceHandler 5 | ms.date: 05/16/2022 6 | --- 7 | 8 | # DynamicResourceHandler extensions 9 | 10 | The `DynamicResourceHandler` extensions provide a series of extension methods that support configuring `IDynamicResourceHandler` which can be used to [Theme an App](/dotnet/maui/user-interface/theming). 11 | 12 | The extensions offer the following methods: 13 | 14 | ## DynamicResource 15 | 16 | The `DynamicResource` method sets the `DynamicResource` property on a control implementing `IDynamicResourceHandler`. 17 | 18 | The following example binds `Label.TextColorProperty` to the [ResourceDictionary][resource-dictionaries-url] key `TextColor`: 19 | 20 | ```csharp 21 | new Label().DynamicResource(Label.TextColorProperty, "TextColor"); 22 | ``` 23 | 24 | ## DynamicResources 25 | 26 | The `DynamicResources` method sets multiple `DynamicResource` properties on a control implementing `IDynamicResourceHandler`. 27 | 28 | The following example binds `Label.TextColorProperty` to the [ResourceDictionary][resource-dictionaries-url] key `TextColor`, and also binds `Label.FontFamilyProperty` to the [ResourceDictionary][resource-dictionaries-url] key `FontFamily`, 29 | 30 | ```csharp 31 | new Label().DynamicResources(Label.TextColorProperty, "TextColor", 32 | Label.FontFamilyProperty, "FontFamily"); 33 | ``` 34 | 35 | [resource-dictionaries-url]: /dotnet/maui/fundamentals/resource-dictionaries "Microsoft .NET MAUI Resource Dictionaries documentation" -------------------------------------------------------------------------------- /docs/maui/markup/extensions/image-extensions.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Image extensions - .NET MAUI Community Toolkit 3 | author: TheCodeTraveler 4 | description: The Image extensions provide a series of extension methods that support configuring IImage controls 5 | ms.date: 03/28/2022 6 | --- 7 | 8 | # Image extensions 9 | 10 | The `Image` extensions provide a series of extension methods that support configuring `IImage` controls. 11 | 12 | The extensions offer the following methods: 13 | 14 | ## Source 15 | 16 | The `Source` method sets the `Source` property on an `IImage` element. 17 | 18 | The following example sets the `Source` to `"dotnet_bot"`: 19 | 20 | ```csharp 21 | new Image().Source("dotnet_bot"); 22 | ``` 23 | 24 | ## Aspect 25 | 26 | The `Aspect` method sets the `Aspect` property on an `IImage` element. 27 | 28 | The following example sets the `Aspect` to `Aspect.AspectFill`: 29 | 30 | ```csharp 31 | new Image().Aspect(Aspect.AspectFill); 32 | ``` 33 | 34 | ## IsOpaque 35 | 36 | The `IsOpaque` method sets the `IsOpaque` property on an `IImage` element. 37 | 38 | The following example sets the `IsOpaque` to `true`: 39 | 40 | ```csharp 41 | new Image().IsOpaque(true); 42 | ``` 43 | -------------------------------------------------------------------------------- /docs/maui/markup/extensions/label-extensions.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Label extensions - .NET MAUI Community Toolkit 3 | author: TheCodeTraveler 4 | description: The Label extensions provide a series of extension methods that support configuring a Label. 5 | ms.date: 05/18/2022 6 | --- 7 | 8 | # Label extensions 9 | 10 | The `Label` extensions provide a series of extension methods that support configuring a `Label`. 11 | 12 | ## FormattedText 13 | 14 | The `FormattedText` method allows us to assign multiple `Span`s to the `Label.FormattedTextProperty`. 15 | 16 | The following example demonstrates how to add multiple `Span`s to a `Label` using `.FormattedText()`: 17 | 18 | ```cs 19 | new Label().FormattedText(new[] 20 | { 21 | new Span { Text = "Here is a link to the docs: " }, 22 | new Span { Text = "https://learn.microsoft.com/", TextDecorations = TextDecorations.Underline, TextColor = Colors.Blue } 23 | }); 24 | ``` 25 | -------------------------------------------------------------------------------- /docs/maui/markup/extensions/object-extensions.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Object extensions - .NET MAUI Community Toolkit 3 | author: TheCodeTraveler 4 | description: The Object Extensions provide a series of extension methods that support configuring any object. 5 | ms.date: 11/05/2022 6 | --- 7 | 8 | # Object extensions 9 | 10 | The `Object` extensions provide a series of extension methods that support configuring any C# object (including reference types, value types, records, structs, etc). 11 | 12 | The extensions offer the following methods: 13 | 14 | ## Assign 15 | 16 | The `Assign` method makes it possible to assign a variable fluently. This is extremely useful for setting up a view-to-view binding. 17 | 18 | This example binds the `TextColor` of the `Label` to be the inverse of its `BackgroundColor`: 19 | 20 | ```csharp 21 | Content = new Label() 22 | .Assign(out var label) 23 | .Bind( 24 | Label.TextColorProperty, 25 | static (Label label) => label.BackgroundColor, 26 | source: label, 27 | converter: new ColorToInverseColorConverter()); 28 | ``` 29 | 30 | ## Invoke 31 | 32 | The `Invoke` method allows you to perform an `Action` against. 33 | 34 | One benefit is the ability to fluently subscribe event handlers or configure other parts of your application. 35 | 36 | This example subscribes the `SelectionChanged` event on the `CollectionView`. 37 | 38 | ```csharp 39 | new CollectionView() 40 | .Invoke(collectionView => collectionView.SelectionChanged += HandleSelectionChanged); 41 | ``` 42 | -------------------------------------------------------------------------------- /docs/maui/markup/extensions/placeholder-extensions.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Placeholder extensions - .NET MAUI Community Toolkit 3 | author: TheCodeTraveler 4 | description: The Placeholder extensions provide a series of extension methods that support configuring IPlaceholder controls 5 | ms.date: 03/28/2022 6 | --- 7 | 8 | # Placeholder extensions 9 | 10 | The `Placeholder` extensions provide a series of extension methods that support configuring `IPlaceholder` controls. 11 | 12 | The extensions offer the following methods: 13 | 14 | ## PlaceholderColor 15 | 16 | The `PlaceholderColor` method sets the `PlaceholderColor` property on an `IPlaceholder` element. 17 | 18 | The following example sets the `PlaceholderColor` to `Colors.Red`: 19 | 20 | ```csharp 21 | new Entry().PlaceholderColor(Colors.Red); 22 | ``` 23 | 24 | ## Placeholder 25 | 26 | The `Placeholder` method sets the `Placeholder` property on an `IPlaceholder` element. 27 | 28 | The following example sets the `Placeholder` to `"Enter Text"`: 29 | 30 | ```csharp 31 | new Entry().Placeholder("Enter Text"); 32 | ``` 33 | 34 | There is a second, overloaded, method for `Placeholder` that will set both the `Placeholder` and `PlaceholderColor` properties on an `IPlaceholder` element. 35 | 36 | The following example sets the `Placeholder` to `"Address, City, State"` and the `PlaceholderColor` to `Colors.Grey`: 37 | 38 | ```csharp 39 | new Editor().Placeholder("Address, City, State", Colors.Grey); 40 | ``` 41 | -------------------------------------------------------------------------------- /docs/maui/markup/extensions/semantic-properties.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: SemanticProperties extensions - .NET MAUI Community Toolkit 3 | author: bijington 4 | description: The SemanticProperties extensions provide a series of extension methods that support the configuring of accessibility related settings. 5 | ms.date: 09/14/2022 6 | --- 7 | 8 | # SemanticProperties extensions 9 | 10 | The `SemanticProperties` extensions provide a series of extension methods that support the configuring of accessibility related settings. 11 | 12 | Semantic properties are used to define information about which controls should receive accessibility focus and which text should be read aloud to the user. Semantic properties are attached properties that can be added to any element to set the underlying platform accessibility APIs. 13 | 14 | For further information on `SemanticProperties` and accessibility please refer to the [.NET MAUI documentation](/dotnet/maui/fundamentals/accessibility). 15 | 16 | For information on other accessibility related extensions please refer to the [AutomationProperties extensions](automation-properties.md). 17 | 18 | ## SemanticDescription 19 | 20 | The `SemanticDescription` method sets a short, descriptive string that the platforms screen reader uses to announce the `BindableObject`. 21 | 22 | The following example demonstrates how to set the description on a new `Entry`: 23 | 24 | ```cs 25 | new Entry().SemanticDescription("Enter your username."); 26 | ``` 27 | 28 | ## SemanticHeadingLevel 29 | 30 | The `SemanticDescription` method sets a heading level to enable the `BindableObject` to be marked as a heading to organize the UI and make it easier to navigate for the platform's screen reader. 31 | 32 | The following example demonstrates how to set the heading level on a new `Entry`: 33 | 34 | ```cs 35 | new Entry().SemanticHeadingLevel(SemanticHeadingLevel.Level5); 36 | ``` 37 | 38 | > [!IMPORTANT] 39 | > Not all platforms support all `SemanticHeadingLevel` values, please refer to the [.NET MAUI documentation](/dotnet/maui/fundamentals/accessibility#heading-levels) for further information. 40 | 41 | ## SemanticHint 42 | 43 | The `SemanticHint` method sets an additional context to that set in `SemanticDescription`, such as the purpose of the `BindableObject`. 44 | 45 | The following example demonstrates how to set the hint on a new `Entry`: 46 | 47 | ```cs 48 | new Entry().SemanticHint("The username field used to create a new account. This is a required field."); 49 | ``` 50 | -------------------------------------------------------------------------------- /docs/maui/markup/theming.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Theming - .NET MAUI Community Toolkit 3 | author: bijington 4 | description: The C# Markup package provides the ability to define property values that will swap based on the systems current theme. 5 | ms.date: 01/13/2023 6 | --- 7 | 8 | # Theming in C# 9 | 10 | All platforms supported by .NET MAUI provide support for light and dark modes. It is essential to factor this into application designs to provide the best experience for the end-user. The C# Markup package provides the ability to define property values that will swap based on the systems current theme (refer to the [Microsoft documentation](/dotnet/maui/user-interface/system-theme-changes#extension-methods)). 11 | 12 | There are two ways to define app theme values: 13 | 14 | ## 1. On a specific `BindableObject` 15 | 16 | When building an application's user interface with C# it is possible to define the values for light and dark mode with the [`AppThemeBinding`](extensions/bindable-object-extensions.md#appthemebinding) extension method. 17 | 18 | The following example shows how to create a `Label` with the following: 19 | 20 | 1. Set the `Text` property to display "Light Mode" when the system is in light mode and "Dark Mode" when the application is in dark mode. 21 | 1. Set the `TextColor` property to `Colors.Black` when the system is in light mode and `Colors.White` when the application is in dark mode. 22 | 23 | ```csharp 24 | new Label() 25 | .AppThemeBinding(Label.TextProperty, "Light Mode", "Dark Mode") 26 | .AppThemeColorBinding(Label.TextColorProperty, Colors.Black, Colors.White); 27 | ``` 28 | 29 | ## 2. On a `Style` 30 | 31 | It is typically recommended to create a `Style` that can apply to multiple instances of a control and therefore simplify the code required to build an application's user interface. For this purpose there are [`AppThemeBinding`](extensions/style.md#add) methods available on the `Style` class. 32 | 33 | The following example shows how to create a `Style` for a `Label` with the same behaviour as the previous example: 34 | 35 | 1. Set the `Text` property to display "Light Mode" when the system is in light mode and "Dark Mode" when the application is in dark mode. 36 | 1. Set the `TextColor` property to `Colors.Black` when the system is in light mode and `Colors.White` when the application is in dark mode. 37 | 38 | ```csharp 39 | var labelStyle = new Style