├── .editorconfig
├── .gitattributes
├── .github
├── ISSUE_TEMPLATE
│ ├── bug_report_template.yml
│ ├── config.yml
│ └── open-a-new-feature-proposal.yml
├── PULL_REQUEST_TEMPLATE.md
├── copilot-instructions.md
├── dependabot.yml
├── policies
│ └── resourceManagement.yml
├── prompts
│ ├── dotnet
│ │ ├── async.prompt.md
│ │ ├── codestyle.prompt.md
│ │ ├── maui
│ │ │ ├── maui-controls.prompt.md
│ │ │ ├── maui-memory-leaks.prompt.md
│ │ │ └── mct-maui-controls.prompt.md
│ │ └── testing.xunit.prompt.md
│ └── prompts.prompt.md
└── workflows
│ ├── SignClientFileList.txt
│ ├── benchmarks.yml
│ ├── dotnet-build.yml
│ ├── dotnet-format-daily.yml
│ └── locker.yml
├── .gitignore
├── .runsettings
├── CONTRIBUTING.md
├── Directory.Build.props
├── Directory.Build.targets
├── LICENSE
├── README.md
├── azure-pipelines.yml
├── build
├── Sign-Package.ps1
├── SignClientSettings.json
├── nuget.png
└── workflow.sketch
├── global.json
├── samples
├── CommunityToolkit.Maui.Sample.sln
└── CommunityToolkit.Maui.Sample
│ ├── App.xaml
│ ├── App.xaml.cs
│ ├── AppShell.xaml
│ ├── AppShell.xaml.cs
│ ├── CommunityToolkit.Maui.Sample.csproj
│ ├── Constants
│ └── StreamingVideoUrls.cs
│ ├── Converters
│ ├── CompareDoubleToColorConverter.cs
│ └── SecondsToStringConverter.cs
│ ├── MauiProgram.cs
│ ├── Models
│ ├── AvatarModel.cs
│ └── SectionModel.cs
│ ├── Pages
│ ├── Alerts
│ │ ├── AlertsGalleryPage.cs
│ │ ├── SnackbarPage.xaml
│ │ ├── SnackbarPage.xaml.cs
│ │ ├── ToastPage.xaml
│ │ └── ToastPage.xaml.cs
│ ├── Base
│ │ ├── BaseGalleryPage.cs
│ │ └── BasePage.cs
│ ├── Behaviors
│ │ ├── AnimationBehaviorPage.xaml
│ │ ├── AnimationBehaviorPage.xaml.cs
│ │ ├── BehaviorsGalleryPage.cs
│ │ ├── CharactersValidationBehaviorPage.xaml
│ │ ├── CharactersValidationBehaviorPage.xaml.cs
│ │ ├── EmailValidationBehaviorPage.xaml
│ │ ├── EmailValidationBehaviorPage.xaml.cs
│ │ ├── EventToCommandBehaviorPage.xaml
│ │ ├── EventToCommandBehaviorPage.xaml.cs
│ │ ├── IconTintColorBehaviorPage.xaml
│ │ ├── IconTintColorBehaviorPage.xaml.cs
│ │ ├── MaskedBehaviorPage.xaml
│ │ ├── MaskedBehaviorPage.xaml.cs
│ │ ├── MaxLengthReachedBehaviorPage.xaml
│ │ ├── MaxLengthReachedBehaviorPage.xaml.cs
│ │ ├── MultiValidationBehaviorPage.xaml
│ │ ├── MultiValidationBehaviorPage.xaml.cs
│ │ ├── NumericValidationBehaviorPage.xaml
│ │ ├── NumericValidationBehaviorPage.xaml.cs
│ │ ├── ProgressBarAnimationBehaviorPage.xaml
│ │ ├── ProgressBarAnimationBehaviorPage.xaml.cs
│ │ ├── RequiredStringValidationBehaviorPage.xaml
│ │ ├── RequiredStringValidationBehaviorPage.xaml.cs
│ │ ├── SelectAllTextBehaviorPage.xaml
│ │ ├── SelectAllTextBehaviorPage.xaml.cs
│ │ ├── SetFocusOnEntryCompletedBehaviorPage.xaml
│ │ ├── SetFocusOnEntryCompletedBehaviorPage.xaml.cs
│ │ ├── StatusBarBehaviorPage.xaml
│ │ ├── StatusBarBehaviorPage.xaml.cs
│ │ ├── TextValidationBehaviorPage.xaml
│ │ ├── TextValidationBehaviorPage.xaml.cs
│ │ ├── TouchBehavior
│ │ │ ├── TouchBehaviorCollectionViewMultipleSelectionPage.cs
│ │ │ ├── TouchBehaviorPage.xaml
│ │ │ └── TouchBehaviorPage.xaml.cs
│ │ ├── UriValidationBehaviorPage.xaml
│ │ ├── UriValidationBehaviorPage.xaml.cs
│ │ ├── UserStoppedTypingBehaviorPage.xaml
│ │ └── UserStoppedTypingBehaviorPage.xaml.cs
│ ├── Converters
│ │ ├── BoolToObjectConverterPage.xaml
│ │ ├── BoolToObjectConverterPage.xaml.cs
│ │ ├── ByteArrayToImageSourceConverterPage.xaml
│ │ ├── ByteArrayToImageSourceConverterPage.xaml.cs
│ │ ├── ColorsConverterPage.xaml
│ │ ├── ColorsConverterPage.xaml.cs
│ │ ├── CompareConverterPage.xaml
│ │ ├── CompareConverterPage.xaml.cs
│ │ ├── ConvertersGalleryPage.cs
│ │ ├── DateTimeOffsetConverterPage.xaml
│ │ ├── DateTimeOffsetConverterPage.xaml.cs
│ │ ├── DoubleToIntConverterPage.xaml
│ │ ├── DoubleToIntConverterPage.xaml.cs
│ │ ├── EnumToBoolConverterPage.xaml
│ │ ├── EnumToBoolConverterPage.xaml.cs
│ │ ├── EnumToIntConverterPage.xaml
│ │ ├── EnumToIntConverterPage.xaml.cs
│ │ ├── ImageResourceConverterPage.xaml
│ │ ├── ImageResourceConverterPage.xaml.cs
│ │ ├── IndexToArrayItemConverterPage.xaml
│ │ ├── IndexToArrayItemConverterPage.xaml.cs
│ │ ├── IntToBoolConverterPage.xaml
│ │ ├── IntToBoolConverterPage.xaml.cs
│ │ ├── InvertedBoolConverterPage.xaml
│ │ ├── InvertedBoolConverterPage.xaml.cs
│ │ ├── IsEqualConverterPage.xaml
│ │ ├── IsEqualConverterPage.xaml.cs
│ │ ├── IsInRangeConverterPage.cs
│ │ ├── IsListNotNullOrEmptyConverterPage.xaml
│ │ ├── IsListNotNullOrEmptyConverterPage.xaml.cs
│ │ ├── IsListNullOrEmptyConverterPage.xaml
│ │ ├── IsListNullOrEmptyConverterPage.xaml.cs
│ │ ├── IsNotEqualConverterPage.xaml
│ │ ├── IsNotEqualConverterPage.xaml.cs
│ │ ├── IsNotNullConverterPage.xaml
│ │ ├── IsNotNullConverterPage.xaml.cs
│ │ ├── IsNullConverterPage.xaml
│ │ ├── IsNullConverterPage.xaml.cs
│ │ ├── IsStringNotNullOrEmptyConverterPage.xaml
│ │ ├── IsStringNotNullOrEmptyConverterPage.xaml.cs
│ │ ├── IsStringNotNullOrWhiteSpaceConverterPage.xaml
│ │ ├── IsStringNotNullOrWhiteSpaceConverterPage.xaml.cs
│ │ ├── IsStringNullOrEmptyConverterPage.xaml
│ │ ├── IsStringNullOrEmptyConverterPage.xaml.cs
│ │ ├── IsStringNullOrWhiteSpaceConverterPage.xaml
│ │ ├── IsStringNullOrWhiteSpaceConverterPage.xaml.cs
│ │ ├── ItemTappedEventArgsConverterPage.xaml
│ │ ├── ItemTappedEventArgsConverterPage.xaml.cs
│ │ ├── ListToStringConverterPage.xaml
│ │ ├── ListToStringConverterPage.xaml.cs
│ │ ├── MathExpressionConverterPage.xaml
│ │ ├── MathExpressionConverterPage.xaml.cs
│ │ ├── MultiConverterPage.xaml
│ │ ├── MultiConverterPage.xaml.cs
│ │ ├── MultiMathExpressionConverterPage.xaml
│ │ ├── MultiMathExpressionConverterPage.xaml.cs
│ │ ├── SelectedItemEventArgsConverterPage.xaml
│ │ ├── SelectedItemEventArgsConverterPage.xaml.cs
│ │ ├── StateToBooleanConverterPage.xaml
│ │ ├── StateToBooleanConverterPage.xaml.cs
│ │ ├── StringToListConverterPage.xaml
│ │ ├── StringToListConverterPage.xaml.cs
│ │ ├── TextCaseConverterPage.xaml
│ │ ├── TextCaseConverterPage.xaml.cs
│ │ ├── VariableMultiValueConverterPage.xaml
│ │ └── VariableMultiValueConverterPage.xaml.cs
│ ├── Essentials
│ │ ├── AppThemePage.xaml
│ │ ├── AppThemePage.xaml.cs
│ │ ├── BadgePage.xaml
│ │ ├── BadgePage.xaml.cs
│ │ ├── EssentialsGalleryPage.cs
│ │ ├── FileSaverPage.xaml
│ │ ├── FileSaverPage.xaml.cs
│ │ ├── FolderPickerPage.xaml
│ │ ├── FolderPickerPage.xaml.cs
│ │ ├── OfflineSpeechToTextPage.xaml
│ │ ├── OfflineSpeechToTextPage.xaml.cs
│ │ ├── SpeechToTextPage.xaml
│ │ └── SpeechToTextPage.xaml.cs
│ ├── Extensions
│ │ ├── ColorAnimationExtensionsPage.xaml
│ │ ├── ColorAnimationExtensionsPage.xaml.cs
│ │ ├── ExtensionsGalleryPage.cs
│ │ ├── KeyboardExtensionsPage.xaml
│ │ └── KeyboardExtensionsPage.xaml.cs
│ ├── ImageSources
│ │ ├── GravatarImageSourcePage.xaml
│ │ ├── GravatarImageSourcePage.xaml.cs
│ │ └── ImageSourcesGalleryPage.cs
│ ├── Layouts
│ │ ├── DockLayoutPage.xaml
│ │ ├── DockLayoutPage.xaml.cs
│ │ ├── LayoutsGalleryPage.cs
│ │ ├── StateContainerPage.xaml
│ │ ├── StateContainerPage.xaml.cs
│ │ ├── UniformItemsLayoutPage.xaml
│ │ └── UniformItemsLayoutPage.xaml.cs
│ ├── PlatformSpecific
│ │ ├── NavigationBarPage.xaml
│ │ ├── NavigationBarPage.xaml.cs
│ │ └── PlatformSpecificGalleryPage.cs
│ ├── Views
│ │ ├── AvatarView
│ │ │ ├── AvatarViewBindablePropertiesPage.xaml
│ │ │ ├── AvatarViewBindablePropertiesPage.xaml.cs
│ │ │ ├── AvatarViewBordersPage.xaml
│ │ │ ├── AvatarViewBordersPage.xaml.cs
│ │ │ ├── AvatarViewColorsPage.xaml
│ │ │ ├── AvatarViewColorsPage.xaml.cs
│ │ │ ├── AvatarViewDayOfWeekPage.xaml
│ │ │ ├── AvatarViewDayOfWeekPage.xaml.cs
│ │ │ ├── AvatarViewGesturesPage.xaml
│ │ │ ├── AvatarViewGesturesPage.xaml.cs
│ │ │ ├── AvatarViewImagesPage.xaml
│ │ │ ├── AvatarViewImagesPage.xaml.cs
│ │ │ ├── AvatarViewKeyboardPage.xaml
│ │ │ ├── AvatarViewKeyboardPage.xaml.cs
│ │ │ ├── AvatarViewRatingPage.xaml
│ │ │ ├── AvatarViewRatingPage.xaml.cs
│ │ │ ├── AvatarViewShadowsPage.xaml
│ │ │ ├── AvatarViewShadowsPage.xaml.cs
│ │ │ ├── AvatarViewShapesPage.xaml
│ │ │ ├── AvatarViewShapesPage.xaml.cs
│ │ │ ├── AvatarViewSizesPage.xaml
│ │ │ └── AvatarViewSizesPage.xaml.cs
│ │ ├── CameraView
│ │ │ ├── CameraViewPage.xaml
│ │ │ ├── CameraViewPage.xaml.cs
│ │ │ ├── ImageViewPage.xaml
│ │ │ └── ImageViewPage.xaml.cs
│ │ ├── DrawingViewPage.xaml
│ │ ├── DrawingViewPage.xaml.cs
│ │ ├── Expander
│ │ │ ├── ExpanderPage.xaml
│ │ │ ├── ExpanderPage.xaml.cs
│ │ │ └── ExpanderPageCS.cs
│ │ ├── LazyView
│ │ │ ├── CustomLazyView.cs
│ │ │ ├── LazyViewPage.xaml
│ │ │ ├── LazyViewPage.xaml.cs
│ │ │ ├── MyView.xaml
│ │ │ ├── MyView.xaml.cs
│ │ │ └── MyViewLazyView.cs
│ │ ├── Maps
│ │ │ ├── BasicMapsPage.xaml
│ │ │ ├── BasicMapsPage.xaml.cs
│ │ │ ├── MapsPinsPage.xaml
│ │ │ └── MapsPinsPage.xaml.cs
│ │ ├── MediaElement
│ │ │ ├── MediaElementCarouselViewPage.xaml
│ │ │ ├── MediaElementCarouselViewPage.xaml.cs
│ │ │ ├── MediaElementCollectionViewPage.xaml
│ │ │ ├── MediaElementCollectionViewPage.xaml.cs
│ │ │ ├── MediaElementMultipleWindowsPage.cs
│ │ │ ├── MediaElementPage.xaml
│ │ │ └── MediaElementPage.xaml.cs
│ │ ├── Popup
│ │ │ ├── PopupLayoutAlignmentPage.xaml
│ │ │ ├── PopupLayoutAlignmentPage.xaml.cs
│ │ │ ├── PopupOnDisappearingPage.cs
│ │ │ ├── PopupPositionPage.xaml
│ │ │ ├── PopupPositionPage.xaml.cs
│ │ │ ├── PopupSizingIssuesPage.xaml
│ │ │ ├── PopupSizingIssuesPage.xaml.cs
│ │ │ ├── PopupsPage.xaml
│ │ │ ├── PopupsPage.xaml.cs
│ │ │ ├── ShowPopupInOnAppearingPage.xaml
│ │ │ ├── ShowPopupInOnAppearingPage.xaml.cs
│ │ │ ├── StylePopupPage.xaml
│ │ │ └── StylePopupPage.xaml.cs
│ │ ├── RatingView
│ │ │ ├── RatingViewCsharpPage.cs
│ │ │ ├── RatingViewShowcasePage.xaml
│ │ │ ├── RatingViewShowcasePage.xaml.cs
│ │ │ ├── RatingViewXamlPage.xaml
│ │ │ └── RatingViewXamlPage.xaml.cs
│ │ ├── SemanticOrderView
│ │ │ ├── SemanticOrderViewPage.xaml
│ │ │ └── SemanticOrderViewPage.xaml.cs
│ │ └── ViewsGalleryPage.cs
│ └── WelcomePage.cs
│ ├── Platforms
│ ├── Android
│ │ ├── AndroidManifest.xml
│ │ ├── MainActivity.cs
│ │ ├── MainApplication.cs
│ │ ├── Resources
│ │ │ └── values
│ │ │ │ └── colors.xml
│ │ └── SamsungBadgeProvider.cs
│ ├── MacCatalyst
│ │ ├── AppDelegate.cs
│ │ ├── Info.plist
│ │ └── Program.cs
│ ├── Tizen
│ │ ├── Main.cs
│ │ └── tizen-manifest.xml
│ ├── Windows
│ │ ├── App.xaml
│ │ ├── App.xaml.cs
│ │ ├── Package.appxmanifest
│ │ └── app.manifest
│ └── iOS
│ │ ├── AppDelegate.cs
│ │ ├── Info.plist
│ │ └── Program.cs
│ ├── Properties
│ └── launchSettings.json
│ ├── Resources
│ ├── AppIcon
│ │ ├── appicon.svg
│ │ └── appiconfg.svg
│ ├── Embedded
│ │ ├── MCT.png
│ │ └── XCT.png
│ ├── Fonts
│ │ ├── Font Awesome 6 Brands-Regular-400.otf
│ │ ├── FontAwesomeIcons.cs
│ │ └── FontFamilies.cs
│ ├── Images
│ │ ├── avatar_icon.png
│ │ ├── button.png
│ │ ├── button_pressed.png
│ │ ├── dotnet_bot.svg
│ │ └── shield.png
│ ├── Raw
│ │ ├── AndroidVideo.mp4
│ │ ├── AppleVideo.mp4
│ │ ├── WindowsVideo.mp4
│ │ └── dotnet_bot.png
│ ├── Splash
│ │ └── splash.svg
│ └── Styles
│ │ ├── Colors.xaml
│ │ └── Styles.xaml
│ ├── ViewModels
│ ├── Alerts
│ │ ├── AlertsGalleryViewModel.cs
│ │ ├── SnackbarViewModel.cs
│ │ └── ToastViewModel.cs
│ ├── Base
│ │ ├── BaseGalleryViewModel.cs
│ │ └── BaseViewModel.cs
│ ├── Behaviors
│ │ ├── AnimationBehaviorViewModel.cs
│ │ ├── BehaviorsGalleryViewModel.cs
│ │ ├── CharactersValidationBehaviorViewModel.cs
│ │ ├── EmailValidationBehaviorViewModel.cs
│ │ ├── EventToCommandBehaviorViewModel.cs
│ │ ├── IconTintColorBehaviorViewModel.cs
│ │ ├── MaskedBehaviorViewModel.cs
│ │ ├── MaxLengthReachedBehaviorViewModel.cs
│ │ ├── MultiValidationBehaviorViewModel.cs
│ │ ├── NumericValidationBehaviorViewModel.cs
│ │ ├── ProgressBarAnimationBehaviorViewModel.cs
│ │ ├── RequiredStringValidationBehaviorViewModel.cs
│ │ ├── SelectAllTextBehaviorViewModel.cs
│ │ ├── SetFocusOnEntryCompletedBehaviorViewModel.cs
│ │ ├── StatusBarBehaviorViewModel.cs
│ │ ├── TextValidationBehaviorViewModel.cs
│ │ ├── TouchBehavior
│ │ │ ├── TouchBehaviorCollectionViewMultipleSelectionViewModel.cs
│ │ │ └── TouchBehaviorViewModel.cs
│ │ ├── UriValidationBehaviorViewModel.cs
│ │ └── UserStoppedTypingBehaviorViewModel.cs
│ ├── Converters
│ │ ├── BoolToObjectConverterViewModel.cs
│ │ ├── ByteArrayToImageSourceConverterViewModel.cs
│ │ ├── ColorsConverterViewModel.cs
│ │ ├── CompareConverterViewModel.cs
│ │ ├── ConvertersGalleryViewModel.cs
│ │ ├── DateTimeOffsetConverterViewModel.cs
│ │ ├── DoubleToIntConverterViewModel.cs
│ │ ├── EnumToBoolConverterViewModel.cs
│ │ ├── EnumToIntConverterViewModel.cs
│ │ ├── ImageResourceConverterViewModel.cs
│ │ ├── IndexToArrayItemConverterViewModel.cs
│ │ ├── IntToBoolConverterViewModel.cs
│ │ ├── InvertedBoolConverterViewModel.cs
│ │ ├── IsEqualConverterViewModel.cs
│ │ ├── IsInRangeConverterViewModel.cs
│ │ ├── IsListNotNullOrEmptyConverterViewModel.cs
│ │ ├── IsListNullOrEmptyConverterViewModel.cs
│ │ ├── IsNotEqualConverterViewModel.cs
│ │ ├── IsNotNullConverterViewModel.cs
│ │ ├── IsNullConverterViewModel.cs
│ │ ├── IsStringNotNullOrEmptyConverterViewModel.cs
│ │ ├── IsStringNotNullOrWhiteSpaceConverterViewModel.cs
│ │ ├── IsStringNullOrEmptyConverterViewModel.cs
│ │ ├── IsStringNullOrWhiteSpaceConverterViewModel.cs
│ │ ├── ItemTappedEventArgsConverterViewModel.cs
│ │ ├── ListToStringConverterViewModel.cs
│ │ ├── MathExpressionConverterViewModel.cs
│ │ ├── MultiConverterViewModel.cs
│ │ ├── MultiMathExpressionConverterViewModel.cs
│ │ ├── SelectedItemEventArgsConverterViewModel.cs
│ │ ├── StateToBooleanConverterViewModel.cs
│ │ ├── StringToListConverterViewModel.cs
│ │ ├── TextCaseConverterViewModel.cs
│ │ └── VariableMultiValueConverterViewModel.cs
│ ├── Essentials
│ │ ├── AppThemeViewModel.cs
│ │ ├── BadgeViewModel.cs
│ │ ├── EssentialsGalleryViewModel.cs
│ │ ├── FileSaverViewModel.cs
│ │ ├── FolderPickerViewModel.cs
│ │ ├── OfflineSpeechToTextViewModel.cs
│ │ └── SpeechToTextViewModel.cs
│ ├── Extensions
│ │ ├── ColorAnimationExtensionsViewModel.cs
│ │ ├── ExtensionsGalleryViewModel.cs
│ │ └── KeyboardExtensionsViewModel.cs
│ ├── ImageSources
│ │ ├── GravatarImageSourceViewModel.cs
│ │ └── ImageSourcesGalleryViewModel.cs
│ ├── Layouts
│ │ ├── DockLayoutViewModel.cs
│ │ ├── LayoutsGalleryViewModel.cs
│ │ ├── StateContainerViewModel.cs
│ │ └── UniformItemsLayoutViewModel.cs
│ ├── PlatformSpecific
│ │ ├── NavigationBarAndroidViewModel.cs
│ │ └── PlatformSpecificGalleryViewModel.cs
│ └── Views
│ │ ├── AvatarView
│ │ ├── AvatarViewBindablePropertiesViewModel.cs
│ │ ├── AvatarViewBordersViewModel.cs
│ │ ├── AvatarViewColorsViewModel.cs
│ │ ├── AvatarViewDayOfWeekViewModel.cs
│ │ ├── AvatarViewGesturesPage.cs
│ │ ├── AvatarViewImagesViewModel.cs
│ │ ├── AvatarViewKeyboardViewModel.cs
│ │ ├── AvatarViewRatingViewModel.cs
│ │ ├── AvatarViewShadowsViewModel.cs
│ │ ├── AvatarViewShapesViewModel.cs
│ │ └── AvatarViewSizesViewModel.cs
│ │ ├── CameraView
│ │ └── CameraViewViewModel.cs
│ │ ├── DrawingViewViewModel.cs
│ │ ├── ExpanderViewModel.cs
│ │ ├── LazyView
│ │ └── LazyViewViewModel.cs
│ │ ├── Maps
│ │ ├── MapsPinsViewModel.cs
│ │ └── MapsViewModel.cs
│ │ ├── MediaElement
│ │ ├── MediaElementCarouselViewViewModel.cs
│ │ ├── MediaElementCollectionViewViewModel.cs
│ │ ├── MediaElementMultipleWindowsViewModel.cs
│ │ └── MediaElementViewModel.cs
│ │ ├── Popup
│ │ ├── CsharpBindingPopupViewModel.cs
│ │ ├── PopupContentViewModel.cs
│ │ ├── PopupLayoutAlignmentViewModel.cs
│ │ ├── PopupPositionViewModel.cs
│ │ ├── PopupSizingIssuesViewModel.cs
│ │ ├── PopupsViewModel.cs
│ │ ├── ShowPopupInOnAppearingPageViewModel.cs
│ │ ├── StylePopupViewModel.cs
│ │ ├── UpdatingPopupViewModel.cs
│ │ └── XamlBindingPopupViewModel.cs
│ │ ├── RatingView
│ │ ├── RatingViewShowcaseViewModel.cs
│ │ └── RatingViewViewModel.cs
│ │ ├── SemanticOrderView
│ │ └── SemanticOrderViewPageViewModel.cs
│ │ └── ViewsGalleryViewModel.cs
│ └── Views
│ ├── NullableBoolComponentWithLabel.xaml
│ ├── NullableBoolComponentWithLabel.xaml.cs
│ └── Popups
│ ├── ApplyToDerivedTypesPopup.xaml
│ ├── ApplyToDerivedTypesPopup.xaml.cs
│ ├── ButtonPopup.xaml
│ ├── ButtonPopup.xaml.cs
│ ├── CsharpBindingPopup.cs
│ ├── DynamicStyleInheritancePopup.xaml
│ ├── DynamicStyleInheritancePopup.xaml.cs
│ ├── DynamicStylePopup.xaml
│ ├── DynamicStylePopup.xaml.cs
│ ├── ExplicitStylePopup.xaml
│ ├── ExplicitStylePopup.xaml.cs
│ ├── ImplicitStylePopup.xaml
│ ├── ImplicitStylePopup.xaml.cs
│ ├── MultipleButtonPopup.xaml
│ ├── MultipleButtonPopup.xaml.cs
│ ├── NoOutsideTapDismissPopup.xaml
│ ├── NoOutsideTapDismissPopup.xaml.cs
│ ├── OpenedEventSimplePopup.xaml
│ ├── OpenedEventSimplePopup.xaml.cs
│ ├── PopupContentView.xaml
│ ├── PopupContentView.xaml.cs
│ ├── RedBlueBoxPopup.xaml
│ ├── RedBlueBoxPopup.xaml.cs
│ ├── ReturnResultPopup.xaml
│ ├── ReturnResultPopup.xaml.cs
│ ├── SimplePopup.xaml
│ ├── SimplePopup.xaml.cs
│ ├── StyleClassPopup.xaml
│ ├── StyleClassPopup.xaml.cs
│ ├── StyleInheritancePopup.xaml
│ ├── StyleInheritancePopup.xaml.cs
│ ├── ToggleSizePopup.xaml
│ ├── ToggleSizePopup.xaml.cs
│ ├── TransparentPopup.xaml
│ ├── TransparentPopup.xaml.cs
│ ├── UpdatingPopup.xaml
│ ├── UpdatingPopup.xaml.cs
│ ├── XamlBindingPopup.xaml
│ └── XamlBindingPopup.xaml.cs
└── src
├── CommunityToolkit.Maui.Analyzers.Benchmarks
├── CommunityToolkit.Maui.Analyzers.Benchmarks.csproj
├── Program.cs
├── UseMauiCommunityToolkitAnalyzerBenchmarks.cs
├── UseMauiCommunityToolkitCameraAnalyzerBenchmarks.cs
└── UseMauiCommunityToolkitMediaElementInitializationAnalyzerBenchmarks.cs
├── CommunityToolkit.Maui.Analyzers.CodeFixes
├── CodeFixResources.Designer.cs
├── CodeFixResources.resx
├── CommunityToolkit.Maui.Analyzers.CodeFixes.csproj
├── Properties
│ ├── AssemblyInfo.cs
│ └── launchSettings.json
└── UseCommunityToolkitInitializationAnalyzerCodeFixProvider.cs
├── CommunityToolkit.Maui.Analyzers.UnitTests
├── CommunityToolkit.Maui.Analyzers.UnitTests.csproj
├── UseCommunityToolkitCameraInitializationAnalyzerTests.cs
├── UseCommunityToolkitInitializationAnalyzerTests.cs
├── UseCommunityToolkitMediaElementInitializationAnalyzerTests.cs
├── Verifiers
│ ├── CSharpAnalyzerVerifier`1+Test.cs
│ ├── CSharpAnalyzerVerifier`1.cs
│ ├── CSharpCodeFixVerifier`2+Test.cs
│ ├── CSharpCodeFixVerifier`2.cs
│ └── CSharpVerifierHelper.cs
└── xunit.runner.json
├── CommunityToolkit.Maui.Analyzers
├── AnalyzerReleases.Shipped.md
├── AnalyzerReleases.Unshipped.md
├── CommunityToolkit.Maui.Analyzers.csproj
├── MaximumRatingRangeAnalyzer.cs
├── Properties
│ ├── AssemblyInfo.cs
│ └── launchSettings.json
├── Resources.Designer.cs
├── Resources.resx
└── UseCommunityToolkitInitializationAnalyzer.cs
├── CommunityToolkit.Maui.Camera.Analyzers.CodeFixes
├── CodeFixResources.Designer.cs
├── CodeFixResources.resx
├── CommunityToolkit.Maui.Camera.Analyzers.CodeFixes.csproj
├── Properties
│ └── AssemblyInfo.cs
└── UseCommunityToolkitCameraViewInitializationAnalyzerCodeFixProvider.cs
├── CommunityToolkit.Maui.Camera.Analyzers
├── AnalyzerReleases.Shipped.md
├── AnalyzerReleases.Unshipped.md
├── CommunityToolkit.Maui.Camera.Analyzers.csproj
├── Properties
│ └── AssemblyInfo.cs
├── Resources.Designer.cs
├── Resources.resx
└── UseCommunityToolkitCameraInitializationAnalyzer.cs
├── CommunityToolkit.Maui.Camera
├── AppBuilderExtensions.shared.cs
├── AssemblyInfo.shared.cs
├── CameraInfo.shared.cs
├── CameraManager.android.cs
├── CameraManager.macios.cs
├── CameraManager.net.cs
├── CameraManager.shared.cs
├── CameraManager.tizen.cs
├── CameraManager.windows.cs
├── CommunityToolkit.Maui.Camera.csproj
├── CommunityToolkit.Maui.Camera.nuspec
├── Extensions
│ ├── CameraView.net.cs
│ ├── CameraViewExtensions.android.cs
│ ├── CameraViewExtensions.macios.cs
│ ├── CameraViewExtensions.tizen.cs
│ └── CameraViewExtensions.windows.cs
├── GlobalUsings.shared.cs
├── Handlers
│ └── CameraViewHandler.shared.cs
├── Interfaces
│ ├── IAsynchronouseHandler.cs
│ ├── ICameraProvider.shared.cs
│ └── ICameraView.shared.cs
├── Primitives
│ ├── CameraException.shared.cs
│ ├── CameraFlashMode.shared.cs
│ ├── CameraPosition.shared.cs
│ ├── CameraViewDefaults.shared.cs
│ ├── MediaCaptureFailedEventArgs.shared.cs
│ └── MediaCapturedEventArgs.shared.cs
├── Providers
│ ├── CameraProvider.android.cs
│ ├── CameraProvider.macios.cs
│ ├── CameraProvider.net.cs
│ ├── CameraProvider.shared.cs
│ ├── CameraProvider.tizen.cs
│ └── CameraProvider.windows.cs
├── Views
│ └── CameraView.shared.cs
├── linker.xml
└── readme.txt
├── CommunityToolkit.Maui.Core
├── .editorconfig
├── AppBuilderExtensions.shared.cs
├── CommunityToolkit.Maui.Core.csproj
├── Essentials
│ ├── AndroidRequestCode.android.cs
│ ├── AndroidStorageConstants.android.cs
│ ├── Badge
│ │ ├── Android
│ │ │ ├── BadgeFactory.android.cs
│ │ │ ├── BadgeImplementation.android.cs
│ │ │ ├── DefaultBadgeProvider.android.cs
│ │ │ └── IBadgeProvider.android.cs
│ │ ├── Badge.shared.cs
│ │ ├── BadgeImplementation.macios.cs
│ │ ├── BadgeImplementation.net.cs
│ │ ├── BadgeImplementation.tizen.cs
│ │ ├── BadgeImplementation.windows.cs
│ │ └── IBadge.shared.cs
│ ├── FileFolderDialog.tizen.cs
│ ├── FileFolderDialogLocalization.tizen.cs
│ ├── FileSaver
│ │ ├── FileSaveException.shared.cs
│ │ ├── FileSaver.shared.cs
│ │ ├── FileSaverImplementation.android.cs
│ │ ├── FileSaverImplementation.macios.cs
│ │ ├── FileSaverImplementation.net.cs
│ │ ├── FileSaverImplementation.shared.cs
│ │ ├── FileSaverImplementation.tizen.cs
│ │ ├── FileSaverImplementation.windows.cs
│ │ ├── FileSaverResult.shared.cs
│ │ └── IFileSaver.shared.cs
│ ├── FolderPicker
│ │ ├── FolderPicker.shared.cs
│ │ ├── FolderPickerException.shared.cs
│ │ ├── FolderPickerImplementation.android.cs
│ │ ├── FolderPickerImplementation.macios.cs
│ │ ├── FolderPickerImplementation.net.cs
│ │ ├── FolderPickerImplementation.shared.cs
│ │ ├── FolderPickerImplementation.tizen.cs
│ │ ├── FolderPickerImplementation.windows.cs
│ │ ├── FolderPickerResult.shared.cs
│ │ └── IFolderPicker.shared.cs
│ └── SpeechToText
│ │ ├── Events
│ │ ├── SpeechToTextRecognitionResultCompletedEventArgs.cs
│ │ ├── SpeechToTextRecognitionResultUpdatedEventArgs.cs
│ │ └── SpeechToTextStateChangedEventArgs.cs
│ │ ├── ISpeechToText.shared.cs
│ │ ├── OfflineSharedSpeechToTextImplementation.macios.cs
│ │ ├── OfflineSpeechToText.shared.cs
│ │ ├── OfflineSpeechToTextImplementation.android.cs
│ │ ├── OfflineSpeechToTextImplementation.ios.cs
│ │ ├── OfflineSpeechToTextImplementation.macos.cs
│ │ ├── OfflineSpeechToTextImplementation.net.cs
│ │ ├── OfflineSpeechToTextImplementation.shared.cs
│ │ ├── OfflineSpeechToTextImplementation.tizen.cs
│ │ ├── OfflineSpeechToTextImplementation.windows.cs
│ │ ├── SharedSpeechToTextImplementation.macios.cs
│ │ ├── SpeechToText.shared.cs
│ │ ├── SpeechToTextImplementation.android.cs
│ │ ├── SpeechToTextImplementation.ios.cs
│ │ ├── SpeechToTextImplementation.macos.cs
│ │ ├── SpeechToTextImplementation.net.cs
│ │ ├── SpeechToTextImplementation.shared.cs
│ │ ├── SpeechToTextImplementation.tizen.cs
│ │ ├── SpeechToTextImplementation.windows.cs
│ │ ├── SpeechToTextOptions.cs
│ │ ├── SpeechToTextResult.shared.cs
│ │ └── SpeechToTextState.shared.cs
├── Extensions
│ ├── AndroidPathExtensions.android.cs
│ ├── BrushExtensions.windows.cs
│ ├── ColorConversionExtensions.shared.cs
│ ├── MathExtensions.shared.cs
│ ├── NullableExtensions.cs
│ ├── ObservableCollectionExtensions.shared.cs
│ ├── UIViewExtensions.macios.cs
│ └── WindowExtensions.android.cs
├── GlobalUsings.shared.cs
├── Handlers
│ ├── DrawingView
│ │ ├── DrawingLineAdapter.shared.cs
│ │ ├── DrawingViewHandler.net.cs
│ │ ├── DrawingViewHandler.shared.cs
│ │ ├── IDrawingLineAdapter.shared.cs
│ │ └── IDrawingViewHandler.shared.cs
│ ├── Popup
│ │ ├── PopUpHandler.android.cs
│ │ ├── PopUpHandler.windows.cs
│ │ ├── PopupHandler.macios.cs
│ │ ├── PopupHandler.net.cs
│ │ ├── PopupHandler.shared.cs
│ │ └── PopupHandler.tizen.cs
│ └── SemanticOrderView
│ │ ├── SemanticOrderViewHandler.android.cs
│ │ ├── SemanticOrderViewHandler.macios.cs
│ │ ├── SemanticOrderViewHandler.net.cs
│ │ ├── SemanticOrderViewHandler.shared.cs
│ │ ├── SemanticOrderViewHandler.tizen.cs
│ │ └── SemanticOrderViewHandler.windows.cs
├── Interfaces
│ ├── IAlert.shared.cs
│ ├── IAsynchronousHandler.cs
│ ├── IAvatarView.shared.cs
│ ├── IDialogFragmentService.android.cs
│ ├── IDockLayout.shared.cs
│ ├── IDrawingLine.shared.cs
│ ├── IDrawingView.shared.cs
│ ├── IExpander.shared.cs
│ ├── IPopup.shared.cs
│ ├── IPopupResult.shared.cs
│ ├── IRatingView.shared.cs
│ ├── ISemanticOrderView.shared.cs
│ ├── ISnackbar.shared.cs
│ ├── IToast.shared.cs
│ └── IUniformItemsLayout.shared.cs
├── Layouts
│ ├── DockLayoutManager.shared.cs
│ └── UniformItemsLayoutManager.shared.cs
├── Options.cs
├── Platform
│ ├── KeyboardExtensions
│ │ ├── KeyboardExtensions.android.cs
│ │ ├── KeyboardExtensions.ios.cs
│ │ ├── KeyboardExtensions.macos.cs
│ │ ├── KeyboardExtensions.net.cs
│ │ ├── KeyboardExtensions.shared.cs
│ │ ├── KeyboardExtensions.tizen.cs
│ │ └── KeyboardExtensions.windows.cs
│ └── StatusBar
│ │ ├── StatusBar.android.cs
│ │ ├── StatusBar.ios.cs
│ │ ├── StatusBar.macos.cs
│ │ ├── StatusBar.net.cs
│ │ ├── StatusBar.shared.cs
│ │ ├── StatusBar.tizen.cs
│ │ └── StatusBar.windows.cs
├── Primitives
│ ├── AlertViewVisualOptions.macios.cs
│ ├── Defaults
│ │ ├── AlertDefaults.shared.cs
│ │ ├── AvatarViewDefaults.shared.cs
│ │ ├── DrawingViewDefaults.shared.cs
│ │ ├── ImageTouchBehaviorDefaults.shared.cs
│ │ ├── RatingViewDefaults.shared.cs
│ │ └── TouchBehaviorDefaults.shared.cs
│ ├── DockPosition.shared.cs
│ ├── DrawingLineCompletedEventArgs.shared.cs
│ ├── DrawingLineStartedEventArgs.shared.cs
│ ├── DrawingViewOutputOption.shared.cs
│ ├── ExpandDirection.shared.cs
│ ├── ExpandedChangedEventArgs.shared.cs
│ ├── Folder.shared.cs
│ ├── HoverState.shared.cs
│ ├── HoverStateChangedEventArgs.shared.cs
│ ├── HoverStatus.shared.cs
│ ├── HoverStatusChangedEventArgs.shared.cs
│ ├── LongPressCompletedEventArgs.shared.cs
│ ├── MathOperator.shared.cs
│ ├── MauiDrawingLineCompletedEventArgs.shared.cs
│ ├── MauiDrawingStartedEventArgs.shared.cs
│ ├── MauiOnDrawingEventArgs.shared.cs
│ ├── NavigationBarStyle.cs
│ ├── PointDrawnEventArgs.shared.cs
│ ├── RatingChangedEventArgs.shared.cs
│ ├── RatingViewFillOption.cs
│ ├── RatingViewShapes.shared.cs
│ ├── SnackbarOptions.shared.cs
│ ├── StatusBarStyle.shared.cs
│ ├── TouchCompletedEventArgs.shared.cs
│ ├── TouchInteractionStatus.shared.cs
│ ├── TouchInteractionStatusChangedEventArgs.shared.cs
│ ├── TouchState.shared.cs
│ ├── TouchStateChangedEventArgs.shared.cs
│ ├── TouchStatus.shared.cs
│ └── TouchStatusChangedEventArgs.shared.cs
├── Services
│ ├── DialogFragmentService.android.cs
│ ├── DialogFragmentService.shared.cs
│ └── FragmentLifecycleManager.android.cs
├── Views
│ ├── Alert
│ │ ├── Alert.macios.cs
│ │ └── AlertView.macios.cs
│ ├── DrawingView
│ │ ├── DrawingLine.shared.cs
│ │ ├── PlatformView
│ │ │ ├── MauiDrawingLine.shared.cs
│ │ │ ├── MauiDrawingView.android.cs
│ │ │ ├── MauiDrawingView.macios.cs
│ │ │ ├── MauiDrawingView.net.cs
│ │ │ ├── MauiDrawingView.shared.cs
│ │ │ ├── MauiDrawingView.tizen.cs
│ │ │ ├── MauiDrawingView.windows.cs
│ │ │ └── MauiDrawingViewExtensions.shared.cs
│ │ └── Service
│ │ │ ├── DrawingViewService.android.cs
│ │ │ ├── DrawingViewService.macios.cs
│ │ │ ├── DrawingViewService.net.cs
│ │ │ ├── DrawingViewService.shared.cs
│ │ │ ├── DrawingViewService.tizen.cs
│ │ │ └── DrawingViewService.windows.cs
│ ├── PaddedButton.macios.cs
│ ├── PaddedLabel.macios.cs
│ ├── Popup
│ │ ├── MauiPopup.android.cs
│ │ ├── MauiPopup.macios.cs
│ │ ├── MauiPopup.tizen.cs
│ │ ├── PopupExtensions.android.cs
│ │ ├── PopupExtensions.macios.cs
│ │ ├── PopupExtensions.windows.cs
│ │ └── PopupOverlay.windows.cs
│ ├── RoundedView.macios.cs
│ ├── SemanticOrderView
│ │ ├── MauiSemanticOrderView.android.cs
│ │ ├── MauiSemanticOrderView.macios.cs
│ │ ├── MauiSemanticOrderView.tizen.cs
│ │ └── MauiSemanticOrderView.windows.cs
│ ├── Snackbar
│ │ └── PlatformSnackbar.macios.cs
│ └── Toast
│ │ └── PlatformToast.macios.cs
└── readme.txt
├── CommunityToolkit.Maui.Maps
├── AppBuilderExtensions.cs
├── CommunityToolkit.Maui.Maps.csproj
├── Handler
│ └── Map
│ │ ├── Bounds.shared.cs
│ │ ├── Center.shared.cs
│ │ ├── EventIdentifier.shared.cs
│ │ ├── EventMessage.shared.cs
│ │ ├── InfoWindow.shared.cs
│ │ ├── MapHandler.Windows.cs
│ │ └── SerializerContext.shared.cs
└── ReadMe.txt
├── CommunityToolkit.Maui.MediaElement.Analyzers.CodeFixes
├── CodeFixResources.Designer.cs
├── CodeFixResources.resx
├── CommunityToolkit.Maui.MediaElement.Analyzers.CodeFixes.csproj
├── Properties
│ └── AssemblyInfo.cs
└── UseCommunityToolkitMediaElementInitializationAnalyzerCodeFixProvider.cs
├── CommunityToolkit.Maui.MediaElement.Analyzers
├── AnalyzerReleases.Shipped.md
├── AnalyzerReleases.Unshipped.md
├── CommunityToolkit.Maui.MediaElement.Analyzers.csproj
├── Properties
│ └── AssemblyInfo.cs
├── Resources.Designer.cs
├── Resources.resx
└── UseCommunityToolkitMediaElementInitializationAnalyzer.cs
├── CommunityToolkit.Maui.MediaElement
├── AppBuilderExtensions.shared.cs
├── AssemblyInfo.shared.cs
├── CommunityToolkit.Maui.MediaElement.csproj
├── Converters
│ ├── FileMediaSourceConverter.shared.cs
│ └── MediaSourceConverter.shared.cs
├── Extensions
│ ├── ElementExtensions.shared.cs
│ └── PageExtensions.shared.cs
├── Handlers
│ ├── MediaElementHandler.android.cs
│ ├── MediaElementHandler.macios.cs
│ ├── MediaElementHandler.net.cs
│ ├── MediaElementHandler.shared.cs
│ ├── MediaElementHandler.tizen.cs
│ └── MediaElementHandler.windows.cs
├── Interfaces
│ ├── IAsynchronousMediaElementHandler.shared.cs
│ └── IMediaElement.shared.cs
├── MediaElement.shared.cs
├── MediaElementOptions.shared.cs
├── MediaSource
│ ├── FileMediaSource.shared.cs
│ ├── MediaSource.shared.cs
│ ├── ResourceMediaSource.shared.cs
│ └── UriMediaSource.shared.cs
├── Platforms
│ └── Android
│ │ └── Resources
│ │ └── layout
│ │ └── textureview.xml
├── Primitives
│ ├── AndroidViewType.shared.cs
│ ├── CustomTransportControls.windows.cs
│ ├── MediaElementState.shared.cs
│ ├── MediaFailedEventArgs.shared.cs
│ ├── MediaPositionChangedEventArgs.shared.cs
│ ├── MediaStateChangedEventArgs.shared.cs
│ ├── Metadata.macios.cs
│ ├── Metadata.windows.cs
│ ├── PlayerViewChangedEventArgs.android.cs
│ └── SeekRequestedEventArgs.shared.cs
├── ResourceDictionary.windows.xaml
├── Services
│ ├── BoundServiceBinder.android.cs
│ ├── BoundServiceConnection.android.cs
│ ├── MediaControlsService.android.cs
│ └── SafeFireAndForgetExtensions.shared.cs
├── Views
│ ├── MauiMediaElement.android.cs
│ ├── MauiMediaElement.macios.cs
│ ├── MauiMediaElement.tizen.cs
│ ├── MauiMediaElement.windows.cs
│ ├── MediaManager.android.cs
│ ├── MediaManager.macios.cs
│ ├── MediaManager.shared.cs
│ ├── MediaManager.tizen.cs
│ ├── MediaManager.windows.cs
│ └── TizenPlayer.tizen.cs
└── readme.txt
├── CommunityToolkit.Maui.SourceGenerators.Internal
├── AnalyzerReleases.Shipped.md
├── AnalyzerReleases.Unshipped.md
├── BindablePropertyAttributeSourceGenerator.cs
├── CommunityToolkit.Maui.SourceGenerators.Internal.csproj
├── Helpers
│ ├── AttributeExtensions.cs
│ ├── EquatableArray{T}.cs
│ └── HashCode.cs
├── IsExternalInit.cs
└── Models
│ └── Records.cs
├── CommunityToolkit.Maui.SourceGenerators
├── AnalyzerReleases.Shipped.md
├── AnalyzerReleases.Unshipped.md
├── CommunityToolkit.Maui.SourceGenerators.csproj
├── Diagnostics
│ └── TextColorToDiagnostic.cs
├── Extensions
│ ├── CompilationExtensions.cs
│ └── NamespaceSymbolExtensions.cs
├── Generators
│ └── TextColorToGenerator.cs
├── IsExternalInit.cs
├── Properties
│ └── launchSettings.json
└── Services
│ └── SourceStringService.cs
├── CommunityToolkit.Maui.UnitTests
├── Alerts
│ ├── SnackbarTests.cs
│ └── ToastTests.cs
├── Animations
│ └── FadeAnimationTests.cs
├── BaseHandlerTest.cs
├── BaseTest.cs
├── Behaviors
│ ├── AnimationBehaviorTests.cs
│ ├── BaseBehaviorTest.cs
│ ├── BaseBehaviorTests.cs
│ ├── CharactersValidationBehaviorTests.cs
│ ├── EmailValidationBehaviorTests.cs
│ ├── EventToCommandBehaviorGenericTests.cs
│ ├── EventToCommandBehaviorTests.cs
│ ├── GestureManagerTests.cs
│ ├── IconTintColorBehaviorTests.cs
│ ├── ImageTouchBehaviorTests.cs
│ ├── ImpliedOrderGridBehaviorTests.cs
│ ├── MaskedBehaviorTests.cs
│ ├── MaxLengthReachedBehaviorTests.cs
│ ├── MultiValidationBehaviorTests.cs
│ ├── NumericValidationBehaviorTests.cs
│ ├── ProgressBarAnimationBehaviorTests.cs
│ ├── RequiredStringValidationBehaviorTests.cs
│ ├── SetFocusOnEntryCompletedTests.cs
│ ├── StatusBarBehaviorTests.cs
│ ├── TextValidationBehaviorTests.cs
│ ├── TouchBehaviorTests.cs
│ ├── UriValidationBehaviorTests.cs
│ ├── UserStoppedTypingBehaviorTests.cs
│ └── ValidationBehaviorTests.cs
├── CommunityToolkit.Maui.UnitTests.csproj
├── Converters
│ ├── BaseConverterOneWayTests.cs
│ ├── BaseConverterTest.cs
│ ├── BaseConverterTests.cs
│ ├── BoolToObjectConverterTests.cs
│ ├── ByteArrayToImageSourceConverterTests.cs
│ ├── ColorToBlackOrWhiteConverterTests.cs
│ ├── ColorToByteAlphaConverterTests.cs
│ ├── ColorToByteBlueConverterTests.cs
│ ├── ColorToByteGreenConverterTests.cs
│ ├── ColorToByteRedConverterTests.cs
│ ├── ColorToCmykStringConverterTests.cs
│ ├── ColorToCmykaStringConverterTests.cs
│ ├── ColorToColorForTextConverterTests.cs
│ ├── ColorToDegreeHueConverterTests.cs
│ ├── ColorToGrayScaleColorConverterTests.cs
│ ├── ColorToHexArgbStringConverterTests.cs
│ ├── ColorToHexRgbStringConverterTests.cs
│ ├── ColorToHexRgbaStringConverterTests.cs
│ ├── ColorToHslStringConverterTests.cs
│ ├── ColorToHslaStringConverterTests.cs
│ ├── ColorToInverseColorConverterTests.cs
│ ├── ColorToPercentBlackKeyConverterTests.cs
│ ├── ColorToPercentCyanConverterTests.cs
│ ├── ColorToPercentMagentaConverterTests.cs
│ ├── ColorToPercentYellowConverterTests.cs
│ ├── ColorToRgbStringConverterTests.cs
│ ├── ColorToRgbaStringConverterTests.cs
│ ├── CompareConverterTests.cs
│ ├── DateTimeOffsetConverterTests.cs
│ ├── DoubleToIntConverterTests.cs
│ ├── EnumToBoolConverterTests.cs
│ ├── EnumToIntConverterTests.cs
│ ├── ImageResourceConverterTests.cs
│ ├── IndexToArrayItemConverterTests.cs
│ ├── IntToBoolConverterTests.cs
│ ├── InvertedBoolConverterTests.cs
│ ├── IsEqualConverterTests.cs
│ ├── IsInRangeConverterTests.cs
│ ├── IsListNotNullOrEmptyConverterTests.cs
│ ├── IsListNullOrEmptyConverterTests.cs
│ ├── IsNotEqualConverterTests.cs
│ ├── IsNotNullConverterTests.cs
│ ├── IsNullConverterTests.cs
│ ├── IsStringNotNullOrEmptyConverterTests.cs
│ ├── IsStringNotNullOrWhiteSpaceConverterTests.cs
│ ├── IsStringNullOrEmptyConverterTests.cs
│ ├── IsStringNullOrWhiteSpaceConverterTests.cs
│ ├── ItemTappedEventArgsConverterTests.cs
│ ├── ListToStringConverterTests.cs
│ ├── MathExpressionConverterTests.cs
│ ├── MultiConverterTests.cs
│ ├── SelectedItemEventArgsConverterTests.cs
│ ├── StateToBoolConverterTests.cs
│ ├── StringToListConverterTests.cs
│ ├── TextCaseConverterTests.cs
│ ├── TimeSpanToSecondsConverterTests.cs
│ └── VariableMultiValueConverterTests.cs
├── Essentials
│ ├── AppThemeTests.cs
│ ├── BadgeTests.cs
│ ├── FileSaverTests.cs
│ ├── FolderPickerTests.cs
│ └── SpeechToTextTests.cs
├── Extensions
│ ├── AppBuilderExtensionsTests.cs
│ ├── BackgroundColorToTests.cs
│ ├── ColorConversionExtensionsTests.cs
│ ├── MathExtensionsTests.cs
│ ├── PopupExtensionsTests.cs
│ ├── ServiceCollectionExtensionsTests.cs
│ └── TextColorToTests.cs
├── GlobalUsings.cs
├── ImageSources
│ └── GravatarImageSource
│ │ └── GravatarImageSourceTests.cs
├── Layouts
│ ├── DockLayoutTests.cs
│ ├── StateContainerTests.cs
│ └── UniformItemsLayoutTests.cs
├── Mocks
│ ├── AnimationExtensions.cs
│ ├── BadgeImplementationMock.cs
│ ├── FileSaverImplementationMock.cs
│ ├── FolderPickerImplementationMock.cs
│ ├── HandlersContextStub.cs
│ ├── MockAppInfo.cs
│ ├── MockApplication.cs
│ ├── MockBehavior.cs
│ ├── MockCameraProvider.cs
│ ├── MockConverter.cs
│ ├── MockDispatcher.cs
│ ├── MockDispatcherProvider.cs
│ ├── MockDrawingViewHandler.cs
│ ├── MockOneWayConverter.cs
│ ├── MockPage.cs
│ ├── MockPageHandler.cs
│ ├── MockPageRouteFactory.cs
│ ├── MockPageViewModel.cs
│ ├── MockResourceManager.cs
│ ├── MockResourcesProvider.cs
│ ├── MockSemanticOrderViewHandler.cs
│ ├── MockShell.cs
│ ├── MockValueConverter.cs
│ ├── MockViewHandler.cs
│ ├── MockWindowHandler.cs
│ └── SpeechToTextImplementationMock.cs
├── Resources
│ └── dotnet-bot.png
├── Services
│ └── PopupServiceTests.cs
├── Views
│ ├── AvatarView
│ │ ├── AvatarViewImageTests.cs
│ │ ├── AvatarViewInterfaceTests.cs
│ │ └── AvatarViewTests.cs
│ ├── CameraView
│ │ └── CameraViewTests.cs
│ ├── DrawingView
│ │ ├── DrawingLineAdapterTests.cs
│ │ ├── DrawingLineCompletedEventArgsTests.cs
│ │ ├── DrawingLineTests.cs
│ │ ├── DrawingViewTests.cs
│ │ ├── MauiDrawingLineCompletedEventArgsTests.cs
│ │ ├── MauiDrawingLineTests.cs
│ │ ├── MauiDrawingViewExtensionsTests.cs
│ │ └── MauiDrawingViewTests.cs
│ ├── Expander
│ │ ├── ExpandedChangedEventArgsTests.cs
│ │ └── ExpanderTests.cs
│ ├── LazyView
│ │ └── LazyViewTests.cs
│ ├── MediaElement
│ │ ├── MediaElementTests.cs
│ │ ├── MediaSourceConverterTests.cs
│ │ ├── MediaSourceTests.cs
│ │ └── ParentWindowTests.cs
│ ├── Popup
│ │ ├── PopupOptionsTests.cs
│ │ ├── PopupPageTests.cs
│ │ ├── PopupResultTests.cs
│ │ └── PopupTests.cs
│ ├── RatingView
│ │ └── RatingViewTests.cs
│ └── SemanticOrderView
│ │ └── SemanticOrderViewTests.cs
└── xunit.runner.json
├── CommunityToolkit.Maui.sln
└── CommunityToolkit.Maui
├── .editorconfig
├── Alerts
├── Snackbar
│ ├── Snackbar.android.cs
│ ├── Snackbar.macios.cs
│ ├── Snackbar.net.cs
│ ├── Snackbar.shared.cs
│ ├── Snackbar.tizen.cs
│ └── Snackbar.windows.cs
└── Toast
│ ├── Toast.android.cs
│ ├── Toast.macios.cs
│ ├── Toast.net.cs
│ ├── Toast.shared.cs
│ ├── Toast.tizen.cs
│ └── Toast.windows.cs
├── Animations
├── BaseAnimation.shared.cs
└── FadeAnimation.shared.cs
├── AppBuilderExtensions.shared.cs
├── AssemblyInfo.shared.cs
├── Behaviors
├── AnimationBehavior.shared.cs
├── AttachedBehaviors
│ └── SetFocusOnEntryCompletedBehavior.shared.cs
├── BaseBehavior.shared.cs
├── EventToCommandBehavior.shared.cs
├── EventToCommandBehaviorGeneric.shared.cs
├── ICommunityToolkitBehavior.shared.cs
├── ImpliedOrderGridBehavior.shared.cs
├── MaskedBehavior.shared.cs
├── MaxLengthReachedBehavior.shared.cs
├── MaxLengthReachedEventArgs.shared.cs
├── PlatformBehaviors
│ ├── BasePlatformBehavior.shared.cs
│ ├── IconTintColor
│ │ ├── IconTintColorBehavior.android.cs
│ │ ├── IconTintColorBehavior.macios.cs
│ │ ├── IconTintColorBehavior.shared.cs
│ │ └── IconTintColorBehavior.windows.cs
│ ├── ImageTouch
│ │ ├── ImageTouchBehavior.android.cs
│ │ ├── ImageTouchBehavior.macios.cs
│ │ ├── ImageTouchBehavior.shared.cs
│ │ └── ImageTouchBehavior.windows.cs
│ ├── SelectAllText
│ │ ├── SelectAllTextBehavior.android.cs
│ │ ├── SelectAllTextBehavior.macios.cs
│ │ ├── SelectAllTextBehavior.tizen.cs
│ │ └── SelectAllTextBehavior.windows.cs
│ ├── StatusBar
│ │ └── StatusBarBehavior.shared.cs
│ └── Touch
│ │ ├── GestureManager.shared.cs
│ │ ├── TouchBehavior.android.cs
│ │ ├── TouchBehavior.macios.cs
│ │ ├── TouchBehavior.methods.shared.cs
│ │ ├── TouchBehavior.shared.cs
│ │ └── TouchBehavior.windows.cs
├── ProgressBarAnimationBehavior.shared.cs
├── UserStoppedTypingBehavior.shared.cs
└── Validators
│ ├── CharactersValidationBehavior.shared.cs
│ ├── EmailValidationBehavior.shared.cs
│ ├── MultiValidationBehavior.shared.cs
│ ├── NumericValidationBehavior.shared.cs
│ ├── RequiredStringValidationBehavior.shared.cs
│ ├── TextValidationBehavior.shared.cs
│ ├── UriValidationBehavior.shared.cs
│ └── ValidationBehavior.shared.cs
├── CommunityToolkit.Maui.csproj
├── Converters
├── BaseConverter.shared.cs
├── BaseConverterOneWay.shared.cs
├── BoolToObjectConverter.shared.cs
├── ByteArrayToImageSourceConverter.shared.cs
├── ColorToColorConverters.shared.cs
├── ColorToComponentConverter.shared.cs
├── ColorToStringConverter.shared.cs
├── CompareConverter.shared.cs
├── DateTimeOffsetConverter.shared.cs
├── DoubleToIntConverter.shared.cs
├── EnumToBoolConverter.shared.cs
├── EnumToIntConverter.shared.cs
├── ICommunityToolkitMultiValueConverter.shared.cs
├── ICommunityToolkitValueConverter.shared.cs
├── ImageResourceConverter.shared.cs
├── IndexToArrayItemConverter.shared.cs
├── IntToBoolConverter.shared.cs
├── InvertedBoolConverter.shared.cs
├── IsEqualConverter.shared.cs
├── IsInRangeConverter.shared.cs
├── IsListNotNullOrEmptyConverter.shared.cs
├── IsListNullOrEmptyConverter.shared.cs
├── IsNotEqualConverter.shared.cs
├── IsNotNullConverter.shared.cs
├── IsNullConverter.shared.cs
├── IsStringNotNullOrEmptyConverter.shared.cs
├── IsStringNotNullOrWhiteSpaceConverter.cs
├── IsStringNullOrEmptyConverter.shared.cs
├── IsStringNullOrWhiteSpaceConverter.shared.cs
├── ItemTappedEventArgsConverter.shared.cs
├── ListToStringConverter.shared.cs
├── MathExpressionConverter
│ ├── MathExpression.shared.cs
│ ├── MathExpressionConverter.shared.cs
│ └── MultiMathExpressionConverter.shared.cs
├── MultiConverter.shared.cs
├── MultiConverterParameter.shared.cs
├── SelectedItemEventArgsConverter.cs
├── StateToBooleanConverter.shared.cs
├── StringToListConverter.shared.cs
├── TextCaseConverter.shared.cs
├── TimeSpanToSecondsConverter.shared.cs
└── VariableMultiValueConverter.shared.cs
├── Essentials
└── AppTheme
│ ├── AppThemeColor.shared.cs
│ └── AppThemeObject.shared.cs
├── Extensions
├── AppThemeObjectExtensions.shared.cs
├── AppThemeResourceExtension.shared.cs
├── ColorAnimationExtensions.shared.cs
├── CryptographyExtensions.shared.cs
├── HttpClientExtensions.shared.cs
├── MultiValueConverterExtension.shared.cs
├── PopupExtensions.shared.cs
├── PropertyChangedEventArgsExtensions.shared.cs
├── SafeFireAndForgotExtensions.shared.cs
├── ServiceCollectionExtensions.shared.cs
├── UIFontExtensions.macios.cs
├── ValueConverterExtension.shared.cs
└── VisualElementExtensions.cs
├── ImageSources
└── GravatarImageSource.shared.cs
├── Interfaces
├── IPopupOptions.shared.cs
└── IPopupService.shared.cs
├── Layouts
├── DockLayout.shared.cs
├── StateContainer
│ ├── StateContainer.shared.cs
│ ├── StateContainerController.shared.cs
│ └── StateView.shared.cs
└── UniformItemsLayout.shared.cs
├── Options.cs
├── PlatformConfiguration
└── AndroidSpecific
│ ├── NavigationBar.android.cs
│ └── NavigationBar.cs
├── Primitives
├── Defaults
│ ├── PopupDefaults.shared.cs
│ └── PopupOptionsDefaults.shared.cs
└── PopupResult.shared.cs
├── ReadMe.txt
├── Services
└── PopupService.shared.cs
└── Views
├── AvatarView.shared.cs
├── DrawingView
└── DrawingView.shared.cs
├── Expander
├── Expander.shared.cs
└── Expander.windows.cs
├── LazyView
└── LazyView.shared.cs
├── Popup
├── Popup.shared.cs
├── PopupOptions.shared.cs
└── PopupPage.shared.cs
├── RatingView
├── RatingView.PathShapes.shared.cs
└── RatingView.shared.cs
├── SemanticOrderView
└── SemanticOrderView.shared.cs
└── WrapperControl.windows.cs
/.github/ISSUE_TEMPLATE/config.yml:
--------------------------------------------------------------------------------
1 | blank_issues_enabled: false
2 | contact_links:
3 | - name: Bug Report - Xamarin.CommunityToolkit.MauiCompat
4 | url: https://github.com/xamarin/XamarinCommunityToolkit/issues/new?assignees=&labels=bug%2C+unverified%2C+maui-compat&template=maui_compat_bug_report_template.md&title=%5BBug%5D+%5BMauiCompat%5D+
5 | about: Issues for Xamarin.CommunityToolkit.MauiCompat and Xamarin.CommunityToolkit.Markup.MauiCompat are filed in the the Xamarin Community Toolkit repository
6 | - name: Propose a New Feature or Ask a Question
7 | url: https://github.com/communitytoolkit/maui/discussions/new
8 | about: Starting a discussion is the first step in creating a new feature proposal
9 |
10 |
--------------------------------------------------------------------------------
/.github/prompts/prompts.prompt.md:
--------------------------------------------------------------------------------
1 | # Prompt Instructions
2 |
3 | Include these prompt instructions if their link's name is called.
4 |
5 | - [MAUI Controls](dotnet/maui/maui-controls.prompt.md)
6 | - [MAUI Memory Leaks](dotnet/maui/maui-memory-leaks.prompt.md)
7 | - [Async Await](dotnet/async.prompt.md)
8 | - [Code Style](dotnet/codestyle.prompt.md)
9 | - [MCT Controls](dotnet/maui/mct-maui-controls.prompt.md)
10 | - [Testing using xUnit](dotnet/testing.xunit.prompt.md)
--------------------------------------------------------------------------------
/.github/workflows/SignClientFileList.txt:
--------------------------------------------------------------------------------
1 | **/CommunityToolkit.*
--------------------------------------------------------------------------------
/.runsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | true
5 |
6 |
7 |
8 |
9 |
10 |
11 | cobertura
12 | true
13 | false
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/build/SignClientSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "SignClient": {
3 | "AzureAd": {
4 | "AADInstance": "https://login.microsoftonline.com/",
5 | "ClientId": "c248d68a-ba6f-4aa9-8a68-71fe872063f8",
6 | "TenantId": "16076fdc-fcc1-4a15-b1ca-32c9a255900e"
7 | },
8 | "Service": {
9 | "Url": "https://codesign.dotnetfoundation.org/",
10 | "ResourceId": "https://SignService/3c30251f-36f3-490b-a955-520addb85001"
11 | }
12 | }
13 | }
--------------------------------------------------------------------------------
/build/nuget.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CommunityToolkit/Maui/d7ab26bb6974b8daea1155303aabfc2731f3f175/build/nuget.png
--------------------------------------------------------------------------------
/build/workflow.sketch:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CommunityToolkit/Maui/d7ab26bb6974b8daea1155303aabfc2731f3f175/build/workflow.sketch
--------------------------------------------------------------------------------
/global.json:
--------------------------------------------------------------------------------
1 | {
2 | "sdk": {
3 | "version": "9.0.300",
4 | "rollForward": "latestFeature",
5 | "allowPrerelease": false
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using Application = Microsoft.Maui.Controls.Application;
2 |
3 | namespace CommunityToolkit.Maui.Sample;
4 |
5 | public partial class App : Application
6 | {
7 | readonly AppShell appShell;
8 |
9 | public App(AppShell appShell)
10 | {
11 | InitializeComponent();
12 |
13 | this.appShell = appShell;
14 | }
15 |
16 | protected override Window CreateWindow(IActivationState? activationState) => new(appShell);
17 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Constants/StreamingVideoUrls.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Sample.Constants;
2 |
3 | static class StreamingVideoUrls
4 | {
5 | public const string BuckBunny = "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4";
6 | public const string ElephantsDream = "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4";
7 | public const string Sintel = "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/Sintel.mp4";
8 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Converters/CompareDoubleToColorConverter.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Converters;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Converters;
4 |
5 | ///
6 | /// Compares a double value against the ComparingValue property
7 | /// and returns a based on the comparison.
8 | ///
9 | [AcceptEmptyServiceProvider]
10 | public sealed partial class CompareDoubleToColorConverter : CompareConverter
11 | {
12 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Alerts/AlertsGalleryPage.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.Alerts;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Pages.Alerts;
4 |
5 | public partial class AlertsGalleryPage(IDeviceInfo deviceInfo, AlertsGalleryViewModel alertsGalleryViewModel) : BaseGalleryPage("Alerts", deviceInfo, alertsGalleryViewModel)
6 | {
7 |
8 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Behaviors/CharactersValidationBehaviorPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.Behaviors;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Pages.Behaviors;
4 |
5 | public partial class CharactersValidationBehaviorPage : BasePage
6 | {
7 | public CharactersValidationBehaviorPage(CharactersValidationBehaviorViewModel charactersValidationBehaviorViewModel)
8 | : base(charactersValidationBehaviorViewModel)
9 | {
10 | InitializeComponent();
11 | }
12 | protected override void OnAppearing()
13 | {
14 | base.OnAppearing();
15 |
16 | CharacterTypePicker.SelectedIndex = 3;
17 | }
18 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Behaviors/EmailValidationBehaviorPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.Behaviors;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Pages.Behaviors;
4 |
5 | public partial class EmailValidationBehaviorPage : BasePage
6 | {
7 | public EmailValidationBehaviorPage(EmailValidationBehaviorViewModel emailValidationBehaviorViewModel)
8 | : base(emailValidationBehaviorViewModel)
9 | {
10 | InitializeComponent();
11 | }
12 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Behaviors/EventToCommandBehaviorPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.Behaviors;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Pages.Behaviors;
4 |
5 | public partial class EventToCommandBehaviorPage : BasePage
6 | {
7 | public EventToCommandBehaviorPage(EventToCommandBehaviorViewModel eventToCommandBehaviorViewModel)
8 | : base(eventToCommandBehaviorViewModel)
9 | {
10 | InitializeComponent();
11 | }
12 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Behaviors/MaskedBehaviorPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.Behaviors;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Pages.Behaviors;
4 |
5 | public partial class MaskedBehaviorPage : BasePage
6 | {
7 | public MaskedBehaviorPage(MaskedBehaviorViewModel maskedBehaviorViewModel)
8 | : base(maskedBehaviorViewModel)
9 | {
10 | InitializeComponent();
11 | }
12 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Behaviors/MaxLengthReachedBehaviorPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Behaviors;
2 | using CommunityToolkit.Maui.Sample.ViewModels.Behaviors;
3 |
4 | namespace CommunityToolkit.Maui.Sample.Pages.Behaviors;
5 |
6 | partial class MaxLengthReachedBehaviorPage : BasePage
7 | {
8 | public MaxLengthReachedBehaviorPage(MaxLengthReachedBehaviorViewModel maxLengthReachedBehaviorViewModel)
9 | : base(maxLengthReachedBehaviorViewModel)
10 | {
11 | InitializeComponent();
12 | }
13 |
14 | void MaxLengthReachedBehavior_MaxLengthReached(object? sender, MaxLengthReachedEventArgs e)
15 | {
16 | NextEntry.Focus();
17 | }
18 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Behaviors/MultiValidationBehaviorPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.Behaviors;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Pages.Behaviors;
4 |
5 | public partial class MultiValidationBehaviorPage : BasePage
6 | {
7 | public MultiValidationBehaviorPage(MultiValidationBehaviorViewModel multiValidationBehaviorViewModel)
8 | : base(multiValidationBehaviorViewModel)
9 | {
10 | InitializeComponent();
11 | }
12 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Behaviors/RequiredStringValidationBehaviorPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.Behaviors;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Pages.Behaviors;
4 |
5 | public partial class RequiredStringValidationBehaviorPage : BasePage
6 | {
7 | public RequiredStringValidationBehaviorPage(RequiredStringValidationBehaviorViewModel requiredStringValidationBehaviorViewModel)
8 | : base(requiredStringValidationBehaviorViewModel)
9 | {
10 | InitializeComponent();
11 | }
12 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Behaviors/SelectAllTextBehaviorPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.Behaviors;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Pages.Behaviors;
4 |
5 | public partial class SelectAllTextBehaviorPage : BasePage
6 | {
7 | public SelectAllTextBehaviorPage(SelectAllTextBehaviorViewModel selectAllTextBehaviorViewModel)
8 | : base(selectAllTextBehaviorViewModel)
9 | {
10 | InitializeComponent();
11 | }
12 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Behaviors/SetFocusOnEntryCompletedBehaviorPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.Behaviors;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Pages.Behaviors;
4 |
5 | public partial class SetFocusOnEntryCompletedBehaviorPage : BasePage
6 | {
7 | public SetFocusOnEntryCompletedBehaviorPage(SetFocusOnEntryCompletedBehaviorViewModel setFocusOnEntryCompletedBehaviorViewModel)
8 | : base(setFocusOnEntryCompletedBehaviorViewModel)
9 | {
10 | InitializeComponent();
11 | }
12 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Behaviors/TextValidationBehaviorPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.Behaviors;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Pages.Behaviors;
4 |
5 | public partial class TextValidationBehaviorPage : BasePage
6 | {
7 | public TextValidationBehaviorPage(TextValidationBehaviorViewModel textValidationBehaviorViewModel)
8 | : base(textValidationBehaviorViewModel)
9 | {
10 | InitializeComponent();
11 | }
12 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Behaviors/TouchBehavior/TouchBehaviorPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.Behaviors;
2 | namespace CommunityToolkit.Maui.Sample.Pages.Behaviors;
3 |
4 | public partial class TouchBehaviorPage : BasePage
5 | {
6 | public TouchBehaviorPage(TouchBehaviorViewModel viewModel)
7 | : base(viewModel)
8 | {
9 | InitializeComponent();
10 | }
11 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Behaviors/UriValidationBehaviorPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.Behaviors;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Pages.Behaviors;
4 |
5 | public partial class UriValidationBehaviorPage : BasePage
6 | {
7 | public UriValidationBehaviorPage(UriValidationBehaviorViewModel uriValidationBehaviorViewModel)
8 | : base(uriValidationBehaviorViewModel)
9 | {
10 | InitializeComponent();
11 | }
12 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Behaviors/UserStoppedTypingBehaviorPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.Behaviors;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Pages.Behaviors;
4 |
5 | public partial class UserStoppedTypingBehaviorPage : BasePage
6 | {
7 | public UserStoppedTypingBehaviorPage(UserStoppedTypingBehaviorViewModel userStoppedTypingBehaviorViewModel)
8 | : base(userStoppedTypingBehaviorViewModel)
9 | {
10 | InitializeComponent();
11 | }
12 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Converters/BoolToObjectConverterPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.Converters;
2 | using Button = Microsoft.Maui.Controls.Button;
3 |
4 | namespace CommunityToolkit.Maui.Sample.Pages.Converters;
5 |
6 | public partial class BoolToObjectConverterPage : BasePage
7 | {
8 | public BoolToObjectConverterPage(BoolToObjectConverterViewModel boolToObjectConverterViewModel)
9 | : base(boolToObjectConverterViewModel)
10 | {
11 | InitializeComponent();
12 | }
13 |
14 | void OnButtonClicked(object? sender, EventArgs args)
15 | {
16 | ArgumentNullException.ThrowIfNull(sender);
17 |
18 | var button = (Button)sender;
19 |
20 | Ellipse.Fill = new SolidColorBrush(button.BackgroundColor);
21 | }
22 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Converters/CompareConverterPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.Converters;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Pages.Converters;
4 |
5 | public partial class CompareConverterPage : BasePage
6 | {
7 | public CompareConverterPage(CompareConverterViewModel compareConverterViewModel)
8 | : base(compareConverterViewModel)
9 | {
10 | InitializeComponent();
11 | }
12 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Converters/ConvertersGalleryPage.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.Converters;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Pages.Converters;
4 |
5 | public partial class ConvertersGalleryPage(IDeviceInfo deviceInfo, ConvertersGalleryViewModel convertersGalleryViewModel) : BaseGalleryPage("Converters", deviceInfo, convertersGalleryViewModel)
6 | {
7 |
8 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Converters/DateTimeOffsetConverterPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.Converters;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Pages.Converters;
4 |
5 | public partial class DateTimeOffsetConverterPage : BasePage
6 | {
7 | public DateTimeOffsetConverterPage(DateTimeOffsetConverterViewModel dateTimeOffsetConverterViewModel)
8 | : base(dateTimeOffsetConverterViewModel)
9 | {
10 | InitializeComponent();
11 | }
12 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Converters/DoubleToIntConverterPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.Converters;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Pages.Converters;
4 |
5 | public partial class DoubleToIntConverterPage : BasePage
6 | {
7 | public DoubleToIntConverterPage(DoubleToIntConverterViewModel doubleToIntConverterViewModel)
8 | : base(doubleToIntConverterViewModel)
9 | {
10 | InitializeComponent();
11 | }
12 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Converters/EnumToBoolConverterPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.Converters;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Pages.Converters;
4 |
5 | public partial class EnumToBoolConverterPage : BasePage
6 | {
7 | public EnumToBoolConverterPage(EnumToBoolConverterViewModel enumToBoolConverterViewModel)
8 | : base(enumToBoolConverterViewModel)
9 | {
10 | InitializeComponent();
11 | }
12 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Converters/EnumToIntConverterPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.Converters;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Pages.Converters;
4 |
5 | public partial class EnumToIntConverterPage : BasePage
6 | {
7 | public EnumToIntConverterPage(EnumToIntConverterViewModel enumToIntConverterViewModel)
8 | : base(enumToIntConverterViewModel)
9 | {
10 | InitializeComponent();
11 | }
12 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Converters/ImageResourceConverterPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.Converters;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Pages.Converters;
4 |
5 | public partial class ImageResourceConverterPage : BasePage
6 | {
7 | public ImageResourceConverterPage(ImageResourceConverterViewModel imageResourceConverterViewModel)
8 | : base(imageResourceConverterViewModel)
9 | {
10 | InitializeComponent();
11 | }
12 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Converters/IndexToArrayItemConverterPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.Converters;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Pages.Converters;
4 |
5 | public partial class IndexToArrayItemConverterPage : BasePage
6 | {
7 | public IndexToArrayItemConverterPage(IndexToArrayItemConverterViewModel indexToArrayItemConverterViewModel)
8 | : base(indexToArrayItemConverterViewModel)
9 | {
10 | InitializeComponent();
11 | }
12 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Converters/IntToBoolConverterPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.Converters;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Pages.Converters;
4 |
5 | public partial class IntToBoolConverterPage : BasePage
6 | {
7 | public IntToBoolConverterPage(IntToBoolConverterViewModel intToBoolConverterViewModel)
8 | : base(intToBoolConverterViewModel)
9 | {
10 | InitializeComponent();
11 | }
12 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Converters/InvertedBoolConverterPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.Converters;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Pages.Converters;
4 |
5 | public partial class InvertedBoolConverterPage : BasePage
6 | {
7 | public InvertedBoolConverterPage(InvertedBoolConverterViewModel invertedBoolConverterViewModel)
8 | : base(invertedBoolConverterViewModel)
9 | {
10 | InitializeComponent();
11 | }
12 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Converters/IsEqualConverterPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.Converters;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Pages.Converters;
4 |
5 | public partial class IsEqualConverterPage : BasePage
6 | {
7 | public IsEqualConverterPage(IsEqualConverterViewModel equalConverterViewModel)
8 | : base(equalConverterViewModel)
9 | {
10 | InitializeComponent();
11 | }
12 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Converters/IsListNotNullOrEmptyConverterPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.Converters;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Pages.Converters;
4 |
5 | public partial class IsListNotNullOrEmptyConverterPage : BasePage
6 | {
7 | public IsListNotNullOrEmptyConverterPage(IsListNotNullOrEmptyConverterViewModel isListNotNullOrEmptyConverterViewModel)
8 | : base(isListNotNullOrEmptyConverterViewModel)
9 | {
10 | InitializeComponent();
11 | }
12 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Converters/IsListNullOrEmptyConverterPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.Converters;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Pages.Converters;
4 |
5 | public partial class IsListNullOrEmptyConverterPage : BasePage
6 | {
7 | public IsListNullOrEmptyConverterPage(IsListNullOrEmptyConverterViewModel isListNullOrEmptyConverterViewModel)
8 | : base(isListNullOrEmptyConverterViewModel)
9 | {
10 | InitializeComponent();
11 | }
12 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Converters/IsNotEqualConverterPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.Converters;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Pages.Converters;
4 |
5 | public partial class IsNotEqualConverterPage : BasePage
6 | {
7 | public IsNotEqualConverterPage(IsNotEqualConverterViewModel notEqualConverterViewModel)
8 | : base(notEqualConverterViewModel)
9 | {
10 | InitializeComponent();
11 | }
12 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Converters/IsNotNullConverterPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.Converters;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Pages.Converters;
4 |
5 | public partial class IsNotNullConverterPage : BasePage
6 | {
7 | public IsNotNullConverterPage(IsNotNullConverterViewModel isNotNullConverterViewModel)
8 | : base(isNotNullConverterViewModel)
9 | {
10 | InitializeComponent();
11 | }
12 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Converters/IsNullConverterPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.Converters;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Pages.Converters;
4 |
5 | public partial class IsNullConverterPage : BasePage
6 | {
7 | public IsNullConverterPage(IsNullConverterViewModel isNullConverterViewModel)
8 | : base(isNullConverterViewModel)
9 | {
10 | InitializeComponent();
11 | }
12 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Converters/IsStringNotNullOrEmptyConverterPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.Converters;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Pages.Converters;
4 |
5 | public partial class IsStringNotNullOrEmptyConverterPage : BasePage
6 | {
7 | public IsStringNotNullOrEmptyConverterPage(IsStringNotNullOrEmptyConverterViewModel isStringNotNullOrEmptyConverterViewModel)
8 | : base(isStringNotNullOrEmptyConverterViewModel)
9 | {
10 | InitializeComponent();
11 | }
12 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Converters/IsStringNotNullOrWhiteSpaceConverterPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.Converters;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Pages.Converters;
4 |
5 | public partial class IsStringNotNullOrWhiteSpaceConverterPage : BasePage
6 | {
7 | public IsStringNotNullOrWhiteSpaceConverterPage(IsStringNotNullOrWhiteSpaceConverterViewModel isStringNotNullOrWhiteSpaceConverterViewModel)
8 | : base(isStringNotNullOrWhiteSpaceConverterViewModel)
9 | {
10 | InitializeComponent();
11 | }
12 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Converters/IsStringNullOrEmptyConverterPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.Converters;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Pages.Converters;
4 |
5 | public partial class IsStringNullOrEmptyConverterPage : BasePage
6 | {
7 | public IsStringNullOrEmptyConverterPage(IsStringNullOrEmptyConverterViewModel isStringNullOrEmptyConverterViewModel)
8 | : base(isStringNullOrEmptyConverterViewModel)
9 | {
10 | InitializeComponent();
11 | }
12 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Converters/IsStringNullOrWhiteSpaceConverterPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.Converters;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Pages.Converters;
4 |
5 | public partial class IsStringNullOrWhiteSpaceConverterPage : BasePage
6 | {
7 | public IsStringNullOrWhiteSpaceConverterPage(IsStringNullOrWhiteSpaceConverterViewModel isStringNullOrWhiteSpaceConverterViewModel)
8 | : base(isStringNullOrWhiteSpaceConverterViewModel)
9 | {
10 | InitializeComponent();
11 | }
12 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Converters/ItemTappedEventArgsConverterPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.Converters;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Pages.Converters;
4 |
5 | public partial class ItemTappedEventArgsConverterPage : BasePage
6 | {
7 | public ItemTappedEventArgsConverterPage(ItemTappedEventArgsConverterViewModel itemTappedEventArgsViewModel)
8 | : base(itemTappedEventArgsViewModel)
9 | {
10 | InitializeComponent();
11 | }
12 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Converters/ListToStringConverterPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.Converters;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Pages.Converters;
4 |
5 | public partial class ListToStringConverterPage : BasePage
6 | {
7 | public ListToStringConverterPage(ListToStringConverterViewModel listToStringConverterViewModel)
8 | : base(listToStringConverterViewModel)
9 | {
10 | InitializeComponent();
11 | }
12 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Converters/MathExpressionConverterPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.Converters;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Pages.Converters;
4 |
5 | public partial class MathExpressionConverterPage : BasePage
6 | {
7 | public MathExpressionConverterPage(MathExpressionConverterViewModel mathExpressionConverterViewModel)
8 | : base(mathExpressionConverterViewModel)
9 | {
10 | InitializeComponent();
11 | }
12 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Converters/MultiConverterPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.Converters;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Pages.Converters;
4 |
5 | public partial class MultiConverterPage : BasePage
6 | {
7 | public MultiConverterPage(MultiConverterViewModel multiConverterViewModel)
8 | : base(multiConverterViewModel)
9 | {
10 | InitializeComponent();
11 | }
12 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Converters/MultiMathExpressionConverterPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.Converters;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Pages.Converters;
4 |
5 | public partial class MultiMathExpressionConverterPage : BasePage
6 | {
7 | public MultiMathExpressionConverterPage(MultiMathExpressionConverterViewModel mathExpressionConverterViewModel)
8 | : base(mathExpressionConverterViewModel)
9 | {
10 | InitializeComponent();
11 | }
12 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Converters/SelectedItemEventArgsConverterPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.Converters;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Pages.Converters;
4 |
5 | public partial class SelectedItemEventArgsConverterPage : BasePage
6 | {
7 | public SelectedItemEventArgsConverterPage(SelectedItemEventArgsConverterViewModel selectedItemEventArgsConverterViewModel)
8 | : base(selectedItemEventArgsConverterViewModel)
9 | {
10 | InitializeComponent();
11 | }
12 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Converters/StateToBooleanConverterPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.Pages;
2 | using CommunityToolkit.Maui.Sample.ViewModels.Converters;
3 |
4 | namespace CommunityToolkit.Maui.Sample;
5 |
6 | public partial class StateToBooleanConverterPage : BasePage
7 | {
8 | public StateToBooleanConverterPage(StateToBooleanConverterViewModel stateToBooleanConverterViewModel)
9 | : base(stateToBooleanConverterViewModel)
10 | {
11 | InitializeComponent();
12 | }
13 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Converters/StringToListConverterPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Converters;
2 | using CommunityToolkit.Maui.Sample.ViewModels.Converters;
3 |
4 | namespace CommunityToolkit.Maui.Sample.Pages.Converters;
5 |
6 | public partial class StringToListConverterPage : BasePage
7 | {
8 | public StringToListConverterPage(StringToListConverterViewModel stringToListConverterViewModel)
9 | : base(stringToListConverterViewModel)
10 | {
11 | Resources.Add(nameof(StringToListConverter), new StringToListConverter
12 | {
13 | SplitOptions = StringSplitOptions.RemoveEmptyEntries,
14 | Separators = [",", ".", ";"]
15 | });
16 |
17 | InitializeComponent();
18 | }
19 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Converters/TextCaseConverterPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.Converters;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Pages.Converters;
4 |
5 | public partial class TextCaseConverterPage : BasePage
6 | {
7 | public TextCaseConverterPage(TextCaseConverterViewModel textCaseConverterViewModel)
8 | : base(textCaseConverterViewModel)
9 | {
10 | InitializeComponent();
11 | }
12 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Converters/VariableMultiValueConverterPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.Converters;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Pages.Converters;
4 |
5 | public partial class VariableMultiValueConverterPage : BasePage
6 | {
7 | public VariableMultiValueConverterPage(VariableMultiValueConverterViewModel variableMultiValueConverterViewModel)
8 | : base(variableMultiValueConverterViewModel)
9 | {
10 | InitializeComponent();
11 | }
12 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Essentials/AppThemePage.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.Essentials;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Pages.Essentials;
4 |
5 | public partial class AppThemePage : BasePage
6 | {
7 | public AppThemePage(AppThemeViewModel viewModel) : base(viewModel)
8 | {
9 | InitializeComponent();
10 | }
11 |
12 | void Switch_Toggled(object sender, ToggledEventArgs e)
13 | {
14 | if (Application.Current is not null)
15 | {
16 | Application.Current.UserAppTheme = Application.Current.RequestedTheme is AppTheme.Dark
17 | ? AppTheme.Light
18 | : AppTheme.Dark;
19 | }
20 | }
21 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Essentials/BadgePage.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.Essentials;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Pages.Essentials;
4 |
5 | public partial class BadgePage : BasePage
6 | {
7 | public BadgePage(BadgeViewModel viewModel) : base(viewModel)
8 | {
9 | InitializeComponent();
10 | }
11 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Essentials/EssentialsGalleryPage.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.Essentials;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Pages.Essentials;
4 |
5 | public partial class EssentialsGalleryPage(IDeviceInfo deviceInfo, EssentialsGalleryViewModel essentialsGalleryViewModel) : BaseGalleryPage("Essentials", deviceInfo, essentialsGalleryViewModel)
6 | {
7 |
8 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Essentials/FileSaverPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.Essentials;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Pages.Essentials;
4 |
5 | public partial class FileSaverPage : BasePage
6 | {
7 | public FileSaverPage(FileSaverViewModel viewModel) : base(viewModel)
8 | {
9 | InitializeComponent();
10 | }
11 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Essentials/FolderPickerPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.Essentials;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Pages.Essentials;
4 |
5 | public partial class FolderPickerPage : BasePage
6 | {
7 | public FolderPickerPage(FolderPickerViewModel viewModel) : base(viewModel)
8 | {
9 | InitializeComponent();
10 | }
11 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Essentials/OfflineSpeechToTextPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.Essentials;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Pages.Essentials;
4 |
5 | public partial class OfflineSpeechToTextPage : BasePage
6 | {
7 | public OfflineSpeechToTextPage(OfflineSpeechToTextViewModel viewModel) : base(viewModel)
8 | {
9 | InitializeComponent();
10 | }
11 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Extensions/ExtensionsGalleryPage.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.Converters;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Pages.Extensions;
4 |
5 | public partial class ExtensionsGalleryPage(IDeviceInfo deviceInfo, ExtensionsGalleryViewModel extensionsGalleryViewModel) : BaseGalleryPage("Extensions", deviceInfo, extensionsGalleryViewModel)
6 | {
7 |
8 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/ImageSources/GravatarImageSourcePage.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Sample.Pages.ImageSources;
2 |
3 | using CommunityToolkit.Maui.Sample.ViewModels.ImageSources;
4 |
5 | public partial class GravatarImageSourcePage : BasePage
6 | {
7 | public GravatarImageSourcePage(GravatarImageSourceViewModel viewModel) : base(viewModel)
8 | {
9 | InitializeComponent();
10 |
11 | Padding = new Thickness(Padding.Left, 0, Padding.Right, 0);
12 | }
13 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/ImageSources/ImageSourcesGalleryPage.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.ImageSources;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Pages.ImageSources;
4 |
5 | public partial class ImageSourcesGalleryPage(IDeviceInfo deviceInfo, ImageSourcesGalleryViewModel imageSourcesGalleryViewModel) : BaseGalleryPage("Image Sources", deviceInfo, imageSourcesGalleryViewModel)
6 | {
7 |
8 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Layouts/DockLayoutPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.Layouts;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Pages.Layouts;
4 |
5 | public partial class DockLayoutPage : BasePage
6 | {
7 | public DockLayoutPage(DockLayoutViewModel dockLayoutViewModel)
8 | : base(dockLayoutViewModel)
9 | {
10 | InitializeComponent();
11 | }
12 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Layouts/LayoutsGalleryPage.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.Layouts;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Pages.Layouts;
4 |
5 | public partial class LayoutsGalleryPage(IDeviceInfo deviceInfo, LayoutsGalleryViewModel layoutGalleryViewModel) : BaseGalleryPage("Layouts", deviceInfo, layoutGalleryViewModel)
6 | {
7 |
8 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/PlatformSpecific/NavigationBarPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.PlatformSpecific;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Pages.PlatformSpecific;
4 |
5 | public partial class NavigationBarPage : BasePage
6 | {
7 | public NavigationBarPage(NavigationBarAndroidViewModel vm) : base(vm)
8 | {
9 | InitializeComponent();
10 | }
11 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/PlatformSpecific/PlatformSpecificGalleryPage.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.PlatformSpecific;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Pages;
4 |
5 | public class PlatformSpecificGalleryPage(IDeviceInfo deviceInfo, PlatformSpecificGalleryViewModel viewModel) : BaseGalleryPage("Platform Specific", deviceInfo, viewModel)
6 | {
7 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Views/AvatarView/AvatarViewBindablePropertiesPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.Views;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Pages.Views;
4 |
5 | public partial class AvatarViewBindablePropertiesPage : BasePage
6 | {
7 | public AvatarViewBindablePropertiesPage(AvatarViewBindablePropertiesViewModel avatarViewBindablePropertiesViewModel) : base(avatarViewBindablePropertiesViewModel)
8 | {
9 | InitializeComponent();
10 | }
11 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Views/AvatarView/AvatarViewBordersPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.Views;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Pages.Views;
4 |
5 | public partial class AvatarViewBordersPage : BasePage
6 | {
7 | public AvatarViewBordersPage(AvatarViewBordersViewModel bordersAvatarViewViewModel) : base(bordersAvatarViewViewModel) => InitializeComponent();
8 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Views/AvatarView/AvatarViewColorsPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.Views;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Pages.Views;
4 |
5 | public partial class AvatarViewColorsPage : BasePage
6 | {
7 | public AvatarViewColorsPage(AvatarViewColorsViewModel avatarViewColorsViewModel) : base(avatarViewColorsViewModel) => InitializeComponent();
8 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Views/AvatarView/AvatarViewDayOfWeekPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.Views;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Pages.Views;
4 |
5 | public partial class AvatarViewDayOfWeekPage : BasePage
6 | {
7 | public AvatarViewDayOfWeekPage(AvatarViewDayOfWeekViewModel avatarViewDayOfWeekViewModel) : base(avatarViewDayOfWeekViewModel) => InitializeComponent();
8 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Views/AvatarView/AvatarViewImagesPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.Views;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Pages.Views;
4 |
5 | public partial class AvatarViewImagesPage : BasePage
6 | {
7 | public AvatarViewImagesPage(AvatarViewImagesViewModel avatarViewImagesViewModel) : base(avatarViewImagesViewModel) => InitializeComponent();
8 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Views/AvatarView/AvatarViewKeyboardPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.Views;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Pages.Views;
4 |
5 | public partial class AvatarViewKeyboardPage : BasePage
6 | {
7 | public AvatarViewKeyboardPage(AvatarViewKeyboardViewModel avatarViewKeyboardViewModel) : base(avatarViewKeyboardViewModel) => InitializeComponent();
8 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Views/AvatarView/AvatarViewRatingPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.Views;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Pages.Views;
4 |
5 | public partial class AvatarViewRatingPage : BasePage
6 | {
7 | public AvatarViewRatingPage(AvatarViewRatingViewModel avatarViewSampleRatingViewModel) : base(avatarViewSampleRatingViewModel) => InitializeComponent();
8 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Views/AvatarView/AvatarViewShadowsPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.Views;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Pages.Views;
4 |
5 | public partial class AvatarViewShadowsPage : BasePage
6 | {
7 | public AvatarViewShadowsPage(AvatarViewShadowsViewModel avatarViewShadowsViewModel) : base(avatarViewShadowsViewModel) => InitializeComponent();
8 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Views/AvatarView/AvatarViewShapesPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.Views;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Pages.Views;
4 |
5 | public partial class AvatarViewShapesPage : BasePage
6 | {
7 | public AvatarViewShapesPage(AvatarViewShapesViewModel avatarViewShapesViewModel) : base(avatarViewShapesViewModel) => InitializeComponent();
8 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Views/AvatarView/AvatarViewSizesPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.Views;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Pages.Views;
4 |
5 | public partial class AvatarViewSizesPage : BasePage
6 | {
7 | public AvatarViewSizesPage(AvatarViewSizesViewModel avatarViewSizesViewModel) : base(avatarViewSizesViewModel) => InitializeComponent();
8 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Views/LazyView/CustomLazyView.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Markup;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Pages.Views.LazyView;
4 |
5 | public partial class CustomLazyView : Maui.Views.LazyView where TView : View, new()
6 | {
7 | public override async ValueTask LoadViewAsync(CancellationToken token = default)
8 | {
9 | // display a loading indicator
10 | Content = new ActivityIndicator { IsRunning = true }.Center();
11 |
12 | // simulate a long running task
13 | await Task.Delay(3000, token);
14 |
15 | // load the view
16 | Content = new TView { BindingContext = BindingContext };
17 |
18 | SetHasLazyViewLoaded(true);
19 | }
20 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Views/LazyView/MyView.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Views/LazyView/MyView.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Sample.Pages.Views.LazyView;
2 |
3 | public partial class MyView : ContentView
4 | {
5 | public MyView()
6 | {
7 | InitializeComponent();
8 | }
9 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Views/LazyView/MyViewLazyView.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Views;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Pages.Views.LazyView;
4 |
5 | partial class MyViewLazyView : LazyView
6 | {
7 | public override async ValueTask LoadViewAsync(CancellationToken token = default)
8 | {
9 | await base.LoadViewAsync(token);
10 | }
11 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Views/Maps/BasicMapsPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.Views;
2 | using Microsoft.Maui.Maps;
3 |
4 | namespace CommunityToolkit.Maui.Sample.Pages.Views;
5 |
6 | public partial class BasicMapsPage : BasePage
7 | {
8 | public BasicMapsPage(BasicMapsViewModel mapsViewModel) : base(mapsViewModel) => InitializeComponent();
9 |
10 | void MapTypePicker_OnSelectedIndexChanged(object? sender, EventArgs e)
11 | {
12 | BasicMap.MapType = (MapType)MapTypePicker.SelectedIndex;
13 | }
14 |
15 | void Button_OnClicked(object? sender, EventArgs e)
16 | {
17 | BasicMap.MoveToRegion(MapSpan.FromCenterAndRadius(new Location(50, 6), Distance.FromKilometers(1)));
18 | }
19 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Views/MediaElement/MediaElementCarouselViewPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.Views;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Pages.Views;
4 |
5 | public partial class MediaElementCarouselViewPage : BasePage
6 | {
7 | public MediaElementCarouselViewPage(MediaElementCarouselViewViewModel viewModel) : base(viewModel)
8 | {
9 | InitializeComponent();
10 | }
11 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Views/MediaElement/MediaElementCollectionViewPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.Views;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Pages.Views;
4 |
5 | public partial class MediaElementCollectionViewPage : BasePage
6 | {
7 | public MediaElementCollectionViewPage(MediaElementCollectionViewViewModel viewModel) : base(viewModel)
8 | {
9 | InitializeComponent();
10 | }
11 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Views/Popup/PopupPositionPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.Views;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Pages.Views;
4 |
5 | public partial class PopupPositionPage : BasePage
6 | {
7 | public PopupPositionPage(PopupPositionViewModel popupPositionViewModel)
8 | : base(popupPositionViewModel)
9 | {
10 | InitializeComponent();
11 | }
12 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Views/Popup/PopupSizingIssuesPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.Views;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Pages.Views;
4 |
5 | public partial class PopupSizingIssuesPage : BasePage
6 | {
7 | public PopupSizingIssuesPage(PopupSizingIssuesViewModel popupSizingIssuesViewModel)
8 | : base(popupSizingIssuesViewModel)
9 | {
10 | InitializeComponent();
11 | }
12 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Views/Popup/StylePopupPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.Views;
2 | namespace CommunityToolkit.Maui.Sample.Pages.Views;
3 |
4 | public partial class StylePopupPage : BasePage
5 | {
6 | public StylePopupPage(StylePopupViewModel stylePopupViewModel) : base(stylePopupViewModel)
7 | {
8 | InitializeComponent();
9 | }
10 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Views/SemanticOrderView/SemanticOrderViewPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.Views;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Pages.Views;
4 |
5 | public partial class SemanticOrderViewPage : BasePage
6 | {
7 | public SemanticOrderViewPage(SemanticOrderViewPageViewModel semanticOrderViewPageViewModel) : base(semanticOrderViewPageViewModel)
8 | {
9 | InitializeComponent();
10 | SemanticOrderView.ViewOrder = new List { First, Second, Third, Fourth, Fifth };
11 | }
12 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/Views/ViewsGalleryPage.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.Views;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Pages.Views;
4 |
5 | public partial class ViewsGalleryPage(IDeviceInfo deviceInfo, ViewsGalleryViewModel viewsGalleryViewModel) : BaseGalleryPage("Views", deviceInfo, viewsGalleryViewModel)
6 | {
7 |
8 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Pages/WelcomePage.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Markup;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Pages;
4 |
5 | public partial class WelcomePage : ContentPage
6 | {
7 | public WelcomePage()
8 | {
9 | Title = "Welcome";
10 |
11 | Padding = 12;
12 |
13 | Content = new VerticalStackLayout
14 | {
15 | Spacing = 12,
16 |
17 | Children =
18 | {
19 | new Label { Text = "Welcome to the .NET MAUI Community Toolkit" }
20 | .Font(size: 32).TextCenter(),
21 |
22 | new Label { Text = "Explore features using the flyout menu in the top left" }
23 | .Font(size: 16).TextCenter()
24 | }
25 | }.CenterHorizontal();
26 | }
27 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Platforms/Android/MainActivity.cs:
--------------------------------------------------------------------------------
1 | using Android.App;
2 | using Android.Content.PM;
3 |
4 | namespace CommunityToolkit.Maui.Sample;
5 |
6 | [Activity(Theme = "@style/Maui.SplashTheme", ResizeableActivity = true, MainLauncher = true, LaunchMode = LaunchMode.SingleTask, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize)]
7 | public class MainActivity : MauiAppCompatActivity
8 | {
9 |
10 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Platforms/Android/MainApplication.cs:
--------------------------------------------------------------------------------
1 | using Android.App;
2 | using Android.Runtime;
3 | using CommunityToolkit.Maui.ApplicationModel;
4 |
5 | namespace CommunityToolkit.Maui.Sample;
6 |
7 | [Application]
8 | public class MainApplication : MauiApplication
9 | {
10 | public MainApplication(IntPtr handle, JniHandleOwnership ownership)
11 | : base(handle, ownership)
12 | {
13 | var samsungProvider = new SamsungBadgeProvider();
14 | BadgeFactory.SetBadgeProvider("com.sec.android.app.launcher", samsungProvider);
15 | BadgeFactory.SetBadgeProvider("com.sec.android.app.twlauncher", samsungProvider);
16 | }
17 |
18 | protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
19 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Platforms/Android/Resources/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #1976D2
4 | #141414
5 | #FFFFFF
6 |
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Platforms/MacCatalyst/AppDelegate.cs:
--------------------------------------------------------------------------------
1 | using System.Diagnostics.CodeAnalysis;
2 | using Foundation;
3 |
4 | namespace CommunityToolkit.Maui.Sample;
5 |
6 | [Register(nameof(AppDelegate))]
7 | [RequiresUnreferencedCode($"{nameof(MauiProgram.CreateMauiApp)} requires unreferenced code")]
8 | public class AppDelegate : MauiUIApplicationDelegate
9 | {
10 | #pragma warning disable IL2046
11 | [RequiresUnreferencedCode($"{nameof(MauiProgram.CreateMauiApp)} requires unreferenced code")]
12 | protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
13 | #pragma warning restore IL2046
14 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Platforms/MacCatalyst/Program.cs:
--------------------------------------------------------------------------------
1 | using UIKit;
2 |
3 | namespace CommunityToolkit.Maui.Sample;
4 |
5 | public class Program
6 | {
7 | static void Main(string[] args) => UIApplication.Main(args, null, typeof(AppDelegate));
8 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Platforms/Tizen/Main.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Microsoft.Maui;
3 | using Microsoft.Maui.Hosting;
4 |
5 | namespace CommunityToolkit.Maui.Sample;
6 |
7 | class Program : MauiApplication
8 | {
9 | protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
10 |
11 | static void Main(string[] args)
12 | {
13 | var app = new Program();
14 | app.Run(args);
15 | }
16 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Platforms/Windows/App.xaml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Platforms/Windows/App.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Sample.Windows;
2 |
3 | ///
4 | /// Provides application-specific behavior to supplement the default Application class.
5 | ///
6 | public partial class App : MauiWinUIApplication
7 | {
8 | ///
9 | /// Initializes the singleton application object. This is the first line of authored code
10 | /// executed, and as such is the logical equivalent of main() or WinMain().
11 | ///
12 | public App()
13 | {
14 | this.InitializeComponent();
15 | }
16 |
17 | protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
18 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Platforms/iOS/AppDelegate.cs:
--------------------------------------------------------------------------------
1 | using System.Diagnostics.CodeAnalysis;
2 | using Foundation;
3 |
4 | namespace CommunityToolkit.Maui.Sample;
5 |
6 | [Register(nameof(AppDelegate))]
7 | [RequiresUnreferencedCode($"{nameof(MauiProgram.CreateMauiApp)} requires unreferenced code")]
8 | public class AppDelegate : MauiUIApplicationDelegate
9 | {
10 | #pragma warning disable IL2046
11 | [RequiresUnreferencedCode($"{nameof(MauiProgram.CreateMauiApp)} requires unreferenced code")]
12 | protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
13 | #pragma warning restore IL2046
14 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Platforms/iOS/Program.cs:
--------------------------------------------------------------------------------
1 | using UIKit;
2 |
3 | namespace CommunityToolkit.Maui.Sample;
4 |
5 | public class Program
6 | {
7 | static void Main(string[] args) => UIApplication.Main(args, null, typeof(AppDelegate));
8 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "profiles": {
3 | "Windows Machine": {
4 | "commandName": "MsixPackage",
5 | "nativeDebugging": false
6 | }
7 | }
8 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Resources/AppIcon/appicon.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Resources/Embedded/MCT.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CommunityToolkit/Maui/d7ab26bb6974b8daea1155303aabfc2731f3f175/samples/CommunityToolkit.Maui.Sample/Resources/Embedded/MCT.png
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Resources/Embedded/XCT.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CommunityToolkit/Maui/d7ab26bb6974b8daea1155303aabfc2731f3f175/samples/CommunityToolkit.Maui.Sample/Resources/Embedded/XCT.png
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Resources/Fonts/Font Awesome 6 Brands-Regular-400.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CommunityToolkit/Maui/d7ab26bb6974b8daea1155303aabfc2731f3f175/samples/CommunityToolkit.Maui.Sample/Resources/Fonts/Font Awesome 6 Brands-Regular-400.otf
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Resources/Fonts/FontAwesomeIcons.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Sample.Resources.Fonts;
2 |
3 | ///
4 | /// The unicode values for all FontAwesome v6.1.1 icons.
5 | ///
6 | /// See https://fontawesome.com/cheatsheet
7 | /// This code was automatically generated by FA2CS (https://github.com/matthewrdev/fa2cs).
8 | ///
9 | public static class FontAwesomeIcons
10 | {
11 | ///
12 | /// fa-microsoft unicode value ("\uf3ca").
13 | ///
14 | /// This icon supports the following styles: Brands
15 | ///
16 | /// Introduced in '5.0.0', Last Modified in '5.0.0'.
17 | ///
18 | /// See https://fontawesome.com/icons/microsoft
19 | ///
20 | public const string Microsoft = "\uf3ca";
21 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Resources/Fonts/FontFamilies.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Sample.Resources.Fonts;
2 |
3 | public static class FontFamilies
4 | {
5 | public const string FontAwesomeBrands = nameof(FontAwesomeBrands);
6 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Resources/Images/avatar_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CommunityToolkit/Maui/d7ab26bb6974b8daea1155303aabfc2731f3f175/samples/CommunityToolkit.Maui.Sample/Resources/Images/avatar_icon.png
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Resources/Images/button.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CommunityToolkit/Maui/d7ab26bb6974b8daea1155303aabfc2731f3f175/samples/CommunityToolkit.Maui.Sample/Resources/Images/button.png
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Resources/Images/button_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CommunityToolkit/Maui/d7ab26bb6974b8daea1155303aabfc2731f3f175/samples/CommunityToolkit.Maui.Sample/Resources/Images/button_pressed.png
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Resources/Images/shield.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CommunityToolkit/Maui/d7ab26bb6974b8daea1155303aabfc2731f3f175/samples/CommunityToolkit.Maui.Sample/Resources/Images/shield.png
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Resources/Raw/AndroidVideo.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CommunityToolkit/Maui/d7ab26bb6974b8daea1155303aabfc2731f3f175/samples/CommunityToolkit.Maui.Sample/Resources/Raw/AndroidVideo.mp4
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Resources/Raw/AppleVideo.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CommunityToolkit/Maui/d7ab26bb6974b8daea1155303aabfc2731f3f175/samples/CommunityToolkit.Maui.Sample/Resources/Raw/AppleVideo.mp4
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Resources/Raw/WindowsVideo.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CommunityToolkit/Maui/d7ab26bb6974b8daea1155303aabfc2731f3f175/samples/CommunityToolkit.Maui.Sample/Resources/Raw/WindowsVideo.mp4
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Resources/Raw/dotnet_bot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CommunityToolkit/Maui/d7ab26bb6974b8daea1155303aabfc2731f3f175/samples/CommunityToolkit.Maui.Sample/Resources/Raw/dotnet_bot.png
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Alerts/AlertsGalleryViewModel.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.Models;
2 |
3 | namespace CommunityToolkit.Maui.Sample.ViewModels.Alerts;
4 |
5 | public partial class AlertsGalleryViewModel() : BaseGalleryViewModel(
6 | [
7 | SectionModel.Create("Snackbar", "Show Snackbar"),
8 | SectionModel.Create("Toast", "Show Toast")
9 | ]);
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Alerts/SnackbarViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Sample.ViewModels.Alerts;
2 |
3 | public partial class SnackbarViewModel : BaseViewModel
4 | {
5 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Alerts/ToastViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Sample.ViewModels.Alerts;
2 |
3 | public partial class ToastViewModel : BaseViewModel
4 | {
5 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Base/BaseViewModel.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Mvvm.ComponentModel;
2 |
3 | namespace CommunityToolkit.Maui.Sample.ViewModels;
4 |
5 | public abstract partial class BaseViewModel : ObservableObject
6 | {
7 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Behaviors/AnimationBehaviorViewModel.cs:
--------------------------------------------------------------------------------
1 | using System.Windows.Input;
2 | using CommunityToolkit.Maui.Alerts;
3 | using CommunityToolkit.Mvvm.Input;
4 |
5 | namespace CommunityToolkit.Maui.Sample.ViewModels.Behaviors;
6 |
7 | public partial class AnimationBehaviorViewModel : BaseViewModel
8 | {
9 | public ICommand? AnimateFromViewModelCommand { get; set; }
10 |
11 | [RelayCommand]
12 | Task OnAnimation(CancellationToken token) => Snackbar.Make($"{nameof(AnimationCommand)} is triggered.").Show(token);
13 |
14 | [RelayCommand]
15 | void OnTriggerAnimation()
16 | {
17 | AnimateFromViewModelCommand?.Execute(CancellationToken.None);
18 | }
19 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Behaviors/CharactersValidationBehaviorViewModel.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Behaviors;
2 |
3 | namespace CommunityToolkit.Maui.Sample.ViewModels.Behaviors;
4 |
5 | public partial class CharactersValidationBehaviorViewModel : BaseViewModel
6 | {
7 | public IReadOnlyList CharacterTypes { get; } = [.. Enum.GetValues()];
8 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Behaviors/EmailValidationBehaviorViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Sample.ViewModels.Behaviors;
2 |
3 | public partial class EmailValidationBehaviorViewModel : BaseViewModel
4 | {
5 |
6 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Behaviors/EventToCommandBehaviorViewModel.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Mvvm.ComponentModel;
2 | using CommunityToolkit.Mvvm.Input;
3 |
4 | namespace CommunityToolkit.Maui.Sample.ViewModels.Behaviors;
5 |
6 | public partial class EventToCommandBehaviorViewModel : BaseViewModel
7 | {
8 | [ObservableProperty]
9 | public partial int ClickCount { get; private set; }
10 |
11 | [RelayCommand]
12 | void Increment()
13 | {
14 | ClickCount++;
15 | }
16 |
17 | [RelayCommand]
18 | void IncrementWithArgs(EventArgs eventArgs)
19 | {
20 | ClickCount++;
21 | }
22 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Behaviors/MaskedBehaviorViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Sample.ViewModels.Behaviors;
2 |
3 | public partial class MaskedBehaviorViewModel : BaseViewModel
4 | {
5 |
6 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Behaviors/MaxLengthReachedBehaviorViewModel.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Mvvm.ComponentModel;
2 | using CommunityToolkit.Mvvm.Input;
3 |
4 | namespace CommunityToolkit.Maui.Sample.ViewModels.Behaviors;
5 |
6 | public partial class MaxLengthReachedBehaviorViewModel : BaseViewModel
7 | {
8 | [ObservableProperty]
9 | public partial string CommandExecutionText { get; set; } = string.Empty;
10 |
11 | [RelayCommand]
12 | void MaxLengthReached(string text)
13 | => CommandExecutionText += string.Format("MaxLength reached with value: '{0}'.", text) + Environment.NewLine;
14 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Behaviors/MultiValidationBehaviorViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Sample.ViewModels.Behaviors;
2 |
3 | public partial class MultiValidationBehaviorViewModel : BaseViewModel
4 | {
5 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Behaviors/NumericValidationBehaviorViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Sample.ViewModels.Behaviors;
2 |
3 | public partial class NumericValidationBehaviorViewModel : BaseViewModel
4 | {
5 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Behaviors/RequiredStringValidationBehaviorViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Sample.ViewModels.Behaviors;
2 |
3 | public partial class RequiredStringValidationBehaviorViewModel : BaseViewModel
4 | {
5 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Behaviors/SelectAllTextBehaviorViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Sample.ViewModels.Behaviors;
2 |
3 | public sealed partial class SelectAllTextBehaviorViewModel : BaseViewModel
4 | {
5 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Behaviors/SetFocusOnEntryCompletedBehaviorViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Sample.ViewModels.Behaviors;
2 |
3 | public partial class SetFocusOnEntryCompletedBehaviorViewModel : BaseViewModel
4 | {
5 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Behaviors/TextValidationBehaviorViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Sample.ViewModels.Behaviors;
2 |
3 | public partial class TextValidationBehaviorViewModel : BaseViewModel
4 | {
5 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Behaviors/TouchBehavior/TouchBehaviorCollectionViewMultipleSelectionViewModel.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.ObjectModel;
2 | using System.Diagnostics;
3 | using CommunityToolkit.Mvvm.Input;
4 |
5 | namespace CommunityToolkit.Maui.Sample.ViewModels.Behaviors;
6 |
7 | public partial class TouchBehaviorCollectionViewMultipleSelectionViewModel : BaseViewModel
8 | {
9 | public ObservableCollection ContentCreators { get; } = [.. ContentCreator.GetContentCreators()];
10 |
11 | [RelayCommand]
12 | void OnRowTapped(ContentCreator creatorTapped)
13 | {
14 | Trace.TraceInformation($"{creatorTapped.Name} Tapped");
15 | }
16 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Behaviors/UriValidationBehaviorViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Sample.ViewModels.Behaviors;
2 |
3 | public partial class UriValidationBehaviorViewModel : BaseViewModel
4 | {
5 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Behaviors/UserStoppedTypingBehaviorViewModel.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Mvvm.ComponentModel;
2 | using CommunityToolkit.Mvvm.Input;
3 |
4 | namespace CommunityToolkit.Maui.Sample.ViewModels.Behaviors;
5 |
6 | public partial class UserStoppedTypingBehaviorViewModel : BaseViewModel
7 | {
8 | [ObservableProperty]
9 | public partial string PerformedSearches { get; set; } = string.Empty;
10 |
11 | [RelayCommand]
12 | void Search(string searchTerms) => PerformedSearches += string.Format($"Performed search for '{searchTerms}'.") + Environment.NewLine;
13 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Converters/BoolToObjectConverterViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Sample.ViewModels.Converters;
2 |
3 | public partial class BoolToObjectConverterViewModel : BaseViewModel
4 | {
5 |
6 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Converters/ColorsConverterViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Sample.ViewModels.Converters;
2 |
3 | public partial class ColorsConverterViewModel : BaseViewModel
4 | {
5 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Converters/CompareConverterViewModel.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Mvvm.ComponentModel;
2 |
3 | namespace CommunityToolkit.Maui.Sample.ViewModels.Converters;
4 |
5 | public partial class CompareConverterViewModel : BaseViewModel
6 | {
7 | [ObservableProperty]
8 | public partial double SliderValue { get; set; } = 0.5;
9 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Converters/DateTimeOffsetConverterViewModel.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Mvvm.ComponentModel;
2 |
3 | namespace CommunityToolkit.Maui.Sample.ViewModels.Converters;
4 |
5 | public partial class DateTimeOffsetConverterViewModel : BaseViewModel
6 | {
7 | [ObservableProperty]
8 | public partial DateTimeOffset TheDate { get; set; } = DateTimeOffset.Now;
9 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Converters/DoubleToIntConverterViewModel.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Mvvm.ComponentModel;
2 |
3 | namespace CommunityToolkit.Maui.Sample.ViewModels.Converters;
4 |
5 | public partial class DoubleToIntConverterViewModel : BaseViewModel
6 | {
7 | [ObservableProperty]
8 | public partial double Input { get; set; }
9 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Converters/EnumToBoolConverterViewModel.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Mvvm.ComponentModel;
2 |
3 | namespace CommunityToolkit.Maui.Sample.ViewModels.Converters;
4 |
5 | public partial class EnumToBoolConverterViewModel : BaseViewModel
6 | {
7 | [ObservableProperty]
8 | public partial MyDevicePlatform SelectedPlatform { get; set; } = Enum.Parse(DeviceInfo.Platform.ToString(), true);
9 |
10 | public IReadOnlyCollection Platforms { get; } = Enum.GetValues();
11 | }
12 |
13 | public enum MyDevicePlatform
14 | {
15 | Android,
16 | iOS,
17 | MacCatalyst,
18 | Tizen,
19 | WinUI,
20 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Converters/EnumToIntConverterViewModel.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Mvvm.ComponentModel;
2 |
3 | namespace CommunityToolkit.Maui.Sample.ViewModels.Converters;
4 |
5 | public partial class EnumToIntConverterViewModel : BaseViewModel
6 | {
7 | [ObservableProperty]
8 | public partial IssueState SelectedState { get; set; } = IssueState.None;
9 |
10 | public IReadOnlyList AllStates { get; } = Enum.GetNames();
11 | }
12 |
13 | public enum IssueState
14 | {
15 | None = 0,
16 | New = 1,
17 | Open = 2,
18 | Waiting = 3,
19 | Developing = 4,
20 | WantFix = 5,
21 | Rejected = 6,
22 | Resolved = 7
23 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Converters/ImageResourceConverterViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Sample.ViewModels.Converters;
2 |
3 | public partial class ImageResourceConverterViewModel : BaseViewModel
4 | {
5 | public string XamarinImageResource { get; } = BuildImageResource("XCT.png");
6 | public string MauiImageResource { get; } = BuildImageResource("MCT.png");
7 |
8 | static string BuildImageResource(in string resourceName) => $"{System.Reflection.Assembly.GetExecutingAssembly().GetName().Name}.Resources.Embedded.{resourceName}";
9 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Converters/IndexToArrayItemConverterViewModel.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Mvvm.ComponentModel;
2 |
3 | namespace CommunityToolkit.Maui.Sample.ViewModels.Converters;
4 |
5 | public partial class IndexToArrayItemConverterViewModel : BaseViewModel
6 | {
7 | [ObservableProperty]
8 | public partial int SelectedIndex { get; set; }
9 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Converters/IntToBoolConverterViewModel.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Mvvm.ComponentModel;
2 |
3 | namespace CommunityToolkit.Maui.Sample.ViewModels.Converters;
4 |
5 | public partial class IntToBoolConverterViewModel : BaseViewModel
6 | {
7 | [ObservableProperty]
8 | public partial int Number { get; set; }
9 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Converters/InvertedBoolConverterViewModel.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Mvvm.ComponentModel;
2 |
3 | namespace CommunityToolkit.Maui.Sample.ViewModels.Converters;
4 |
5 | public partial class InvertedBoolConverterViewModel : BaseViewModel
6 | {
7 | [ObservableProperty]
8 | public partial bool IsToggled { get; set; }
9 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Converters/IsEqualConverterViewModel.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Mvvm.ComponentModel;
2 |
3 | namespace CommunityToolkit.Maui.Sample.ViewModels.Converters;
4 |
5 | public partial class IsEqualConverterViewModel : BaseViewModel
6 | {
7 | [ObservableProperty]
8 | public partial string InputValue { get; set; } = string.Empty;
9 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Converters/IsInRangeConverterViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Sample.ViewModels.Converters;
2 |
3 | using CommunityToolkit.Mvvm.ComponentModel;
4 |
5 | public partial class IsInRangeConverterViewModel : BaseViewModel
6 | {
7 | [ObservableProperty]
8 | [NotifyPropertyChangedFor(nameof(InputChar))]
9 | public partial string InputString { get; set; } = "H";
10 |
11 | public char InputChar => char.TryParse(InputString, out var returnChar) ? returnChar : default;
12 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Converters/IsListNullOrEmptyConverterViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Sample.ViewModels.Converters;
2 |
3 | public partial class IsListNullOrEmptyConverterViewModel : IsListNotNullOrEmptyConverterViewModel
4 | {
5 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Converters/IsNotEqualConverterViewModel.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Mvvm.ComponentModel;
2 |
3 | namespace CommunityToolkit.Maui.Sample.ViewModels.Converters;
4 |
5 | public partial class IsNotEqualConverterViewModel : BaseViewModel
6 | {
7 | [ObservableProperty]
8 | public partial string InputValue { get; set; } = string.Empty;
9 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Converters/IsNotNullConverterViewModel.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Mvvm.ComponentModel;
2 |
3 | namespace CommunityToolkit.Maui.Sample.ViewModels.Converters;
4 |
5 | public partial class IsNotNullConverterViewModel : BaseViewModel
6 | {
7 | [ObservableProperty]
8 | public partial int IntCheck { get; set; }
9 |
10 | [ObservableProperty]
11 | public partial List? ListCheck { get; set; }
12 |
13 | [ObservableProperty]
14 | public partial string? StringCheck { get; set; }
15 |
16 | [ObservableProperty]
17 | public partial object? ObjectCheck { get; set; }
18 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Converters/IsNullConverterViewModel.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Mvvm.ComponentModel;
2 |
3 | namespace CommunityToolkit.Maui.Sample.ViewModels.Converters;
4 |
5 | public partial class IsNullConverterViewModel : BaseViewModel
6 | {
7 | [ObservableProperty]
8 | public partial int IntCheck { get; set; }
9 |
10 | [ObservableProperty]
11 | public partial List? ListCheck { get; set; }
12 |
13 | [ObservableProperty]
14 | public partial string? StringCheck { get; set; }
15 |
16 | [ObservableProperty]
17 | public partial object? ObjectCheck { get; set; }
18 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Converters/IsStringNotNullOrEmptyConverterViewModel.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Mvvm.ComponentModel;
2 |
3 | namespace CommunityToolkit.Maui.Sample.ViewModels.Converters;
4 |
5 | public partial class IsStringNotNullOrEmptyConverterViewModel : BaseViewModel
6 | {
7 | [ObservableProperty]
8 | public partial string? LabelText { get; set; }
9 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Converters/IsStringNotNullOrWhiteSpaceConverterViewModel.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Mvvm.ComponentModel;
2 |
3 | namespace CommunityToolkit.Maui.Sample.ViewModels.Converters;
4 |
5 | public partial class IsStringNotNullOrWhiteSpaceConverterViewModel : BaseViewModel
6 | {
7 | [ObservableProperty]
8 | public partial string? LabelText { get; set; }
9 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Converters/IsStringNullOrEmptyConverterViewModel.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Mvvm.ComponentModel;
2 |
3 | namespace CommunityToolkit.Maui.Sample.ViewModels.Converters;
4 |
5 | public partial class IsStringNullOrEmptyConverterViewModel : BaseViewModel
6 | {
7 | [ObservableProperty]
8 | public partial string? LabelText { get; set; }
9 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Converters/IsStringNullOrWhiteSpaceConverterViewModel.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Mvvm.ComponentModel;
2 |
3 | namespace CommunityToolkit.Maui.Sample.ViewModels.Converters;
4 |
5 | public partial class IsStringNullOrWhiteSpaceConverterViewModel : BaseViewModel
6 | {
7 | [ObservableProperty]
8 | public partial string? LabelText { get; set; }
9 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Converters/ListToStringConverterViewModel.cs:
--------------------------------------------------------------------------------
1 |
2 | namespace CommunityToolkit.Maui.Sample.ViewModels.Converters;
3 |
4 | public partial class ListToStringConverterViewModel : BaseViewModel
5 | {
6 | public IReadOnlyList ItemSource { get; } =
7 | [
8 | "This",
9 | "Is",
10 | "The",
11 | "ListToStringConverter"
12 | ];
13 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Converters/MathExpressionConverterViewModel.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Mvvm.ComponentModel;
2 |
3 | namespace CommunityToolkit.Maui.Sample.ViewModels.Converters;
4 |
5 | public partial class MathExpressionConverterViewModel : BaseViewModel
6 | {
7 | [ObservableProperty]
8 | public partial double SliderValue { get; set; } = 50;
9 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Converters/MultiConverterViewModel.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Mvvm.ComponentModel;
2 |
3 | namespace CommunityToolkit.Maui.Sample.ViewModels.Converters;
4 |
5 | public partial class MultiConverterViewModel : BaseViewModel
6 | {
7 | [ObservableProperty]
8 | public partial string EnteredName { get; set; } = "Steven";
9 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Converters/MultiMathExpressionConverterViewModel.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Mvvm.ComponentModel;
2 |
3 | namespace CommunityToolkit.Maui.Sample.ViewModels.Converters;
4 |
5 | public partial class MultiMathExpressionConverterViewModel : BaseViewModel
6 | {
7 | [ObservableProperty]
8 | public partial double X0 { get; set; } = 10;
9 |
10 | [ObservableProperty]
11 | public partial double X1 { get; set; } = 20;
12 |
13 | [ObservableProperty]
14 | public partial double X2 { get; set; } = 30;
15 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Converters/StateToBooleanConverterViewModel.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Converters;
2 | using CommunityToolkit.Mvvm.ComponentModel;
3 | using CommunityToolkit.Mvvm.Input;
4 |
5 | namespace CommunityToolkit.Maui.Sample.ViewModels.Converters;
6 | public partial class StateToBooleanConverterViewModel : BaseViewModel
7 | {
8 | [ObservableProperty]
9 | public partial LayoutState LayoutState { get; set; } = LayoutState.None;
10 |
11 | [RelayCommand]
12 | public void ChangeLayout()
13 | {
14 | LayoutState = LayoutState switch
15 | {
16 | LayoutState.None => LayoutState.Success,
17 | _ => LayoutState.None
18 | };
19 | }
20 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Converters/StringToListConverterViewModel.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Mvvm.ComponentModel;
2 |
3 | namespace CommunityToolkit.Maui.Sample.ViewModels.Converters;
4 |
5 | public partial class StringToListConverterViewModel : BaseViewModel
6 | {
7 | [ObservableProperty]
8 | public partial string LabelText { get; set; } = "Item 1,Item 2,Item 3";
9 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Converters/TextCaseConverterViewModel.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Mvvm.ComponentModel;
2 |
3 | namespace CommunityToolkit.Maui.Sample.ViewModels.Converters;
4 |
5 | public partial class TextCaseConverterViewModel : BaseViewModel
6 | {
7 | [ObservableProperty]
8 | public partial string Input { get; set; } = string.Empty;
9 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Essentials/AppThemeViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Sample.ViewModels.Essentials;
2 |
3 | public partial class AppThemeViewModel : BaseViewModel
4 | {
5 | public AppThemeViewModel() : base()
6 | {
7 | }
8 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Essentials/BadgeViewModel.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.ApplicationModel;
2 | using CommunityToolkit.Mvvm.Input;
3 |
4 | namespace CommunityToolkit.Maui.Sample.ViewModels.Essentials;
5 |
6 | public partial class BadgeViewModel : BaseViewModel
7 | {
8 | readonly IBadge badge;
9 |
10 | uint count;
11 |
12 | public BadgeViewModel(IBadge badge)
13 | {
14 | this.badge = badge;
15 | }
16 |
17 | [RelayCommand]
18 | void Increment()
19 | {
20 | count++;
21 | badge.SetCount(count);
22 | }
23 |
24 | [RelayCommand]
25 | void Decrement()
26 | {
27 | if (count > 0)
28 | {
29 | count--;
30 | badge.SetCount(count);
31 | }
32 | }
33 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Extensions/ColorAnimationExtensionsViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Sample.ViewModels.Converters;
2 |
3 | public partial class ColorAnimationExtensionsViewModel : BaseViewModel
4 | {
5 |
6 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Extensions/ExtensionsGalleryViewModel.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Core.Platform;
2 | using CommunityToolkit.Maui.Extensions;
3 | using CommunityToolkit.Maui.Sample.Models;
4 | using CommunityToolkit.Maui.Sample.ViewModels.Extensions;
5 |
6 | namespace CommunityToolkit.Maui.Sample.ViewModels.Converters;
7 |
8 | public partial class ExtensionsGalleryViewModel() : BaseGalleryViewModel(
9 | [
10 | SectionModel.Create(nameof(ColorAnimationExtensions), "Extension methods that provide color animations"),
11 | SectionModel.Create(nameof(KeyboardExtensions), "Extension methods that provide keyboard interactions")
12 | ]);
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/ImageSources/ImageSourcesGalleryViewModel.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.Models;
2 |
3 | namespace CommunityToolkit.Maui.Sample.ViewModels.ImageSources;
4 |
5 | public partial class ImageSourcesGalleryViewModel() : BaseGalleryViewModel(
6 | [
7 | SectionModel.Create("GravatarImageSource", Colors.Red, "GravatarImageSource allows you to use as an Image source, a users Gravatar registered image via their email address.")
8 | ]);
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Layouts/DockLayoutViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Sample.ViewModels.Layouts;
2 |
3 | public partial class DockLayoutViewModel : BaseViewModel
4 | {
5 |
6 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Layouts/LayoutsGalleryViewModel.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.Models;
2 | using CommunityToolkit.Maui.Sample.Pages.Layouts;
3 |
4 | namespace CommunityToolkit.Maui.Sample.ViewModels.Layouts;
5 |
6 | public partial class LayoutsGalleryViewModel() : BaseGalleryViewModel(
7 | [
8 | SectionModel.Create(nameof(StateContainerPage), "Properties enabling any Layout derived element to become state-aware"),
9 | SectionModel.Create(nameof(UniformItemsLayoutPage), "A Grid where all rows and columns have the same size"),
10 | SectionModel.Create(nameof(DockLayoutPage), "A layout that positions its child elements along the edges of the container.")
11 | ]);
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Layouts/UniformItemsLayoutViewModel.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.ObjectModel;
2 | using CommunityToolkit.Mvvm.Input;
3 |
4 | namespace CommunityToolkit.Maui.Sample.ViewModels.Layouts;
5 |
6 | public partial class UniformItemsLayoutViewModel : BaseViewModel
7 | {
8 | [RelayCommand]
9 | void AddItem()
10 | {
11 | Items.Add(Path.GetRandomFileName());
12 | }
13 |
14 | [RelayCommand]
15 | void ClearItem()
16 | {
17 | Items.Clear();
18 | }
19 |
20 | public ObservableCollection Items { get; } = [];
21 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/PlatformSpecific/PlatformSpecificGalleryViewModel.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.Models;
2 |
3 | namespace CommunityToolkit.Maui.Sample.ViewModels.PlatformSpecific;
4 |
5 | public sealed partial class PlatformSpecificGalleryViewModel() : BaseGalleryViewModel(
6 | [
7 | SectionModel.Create("NavigationBar (Android)", "Change the Navigation Bar color on Android"),
8 | ]);
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Views/AvatarView/AvatarViewBordersViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Sample.ViewModels.Views;
2 |
3 | public partial class AvatarViewBordersViewModel : BaseViewModel
4 | {
5 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Views/AvatarView/AvatarViewColorsViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Sample.ViewModels.Views;
2 |
3 | public partial class AvatarViewColorsViewModel : BaseViewModel
4 | {
5 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Views/AvatarView/AvatarViewDayOfWeekViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Sample.ViewModels.Views;
2 |
3 | public partial class AvatarViewDayOfWeekViewModel : BaseViewModel
4 | {
5 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Views/AvatarView/AvatarViewGesturesPage.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Sample.ViewModels.Views;
2 |
3 | public partial class AvatarViewGesturesViewModel : BaseViewModel
4 | {
5 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Views/AvatarView/AvatarViewImagesViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Sample.ViewModels.Views;
2 |
3 | public partial class AvatarViewImagesViewModel : BaseViewModel
4 | {
5 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Views/AvatarView/AvatarViewKeyboardViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Sample.ViewModels.Views;
2 |
3 | public partial class AvatarViewKeyboardViewModel : BaseViewModel
4 | {
5 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Views/AvatarView/AvatarViewRatingViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Sample.ViewModels.Views;
2 |
3 | public partial class AvatarViewRatingViewModel : BaseViewModel
4 | {
5 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Views/AvatarView/AvatarViewShadowsViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Sample.ViewModels.Views;
2 |
3 | public partial class AvatarViewShadowsViewModel : BaseViewModel
4 | {
5 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Views/AvatarView/AvatarViewShapesViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Sample.ViewModels.Views;
2 |
3 | public partial class AvatarViewShapesViewModel : BaseViewModel
4 | {
5 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Views/AvatarView/AvatarViewSizesViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Sample.ViewModels.Views;
2 |
3 | public partial class AvatarViewSizesViewModel : BaseViewModel
4 | {
5 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Views/LazyView/LazyViewViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Sample.ViewModels.Views;
2 |
3 | public partial class LazyViewViewModel : BaseViewModel
4 | {
5 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Views/Maps/MapsPinsViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Sample.ViewModels.Views;
2 |
3 | public partial class MapsPinsViewModel : BaseViewModel
4 | {
5 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Views/Maps/MapsViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Sample.ViewModels.Views;
2 |
3 | public partial class BasicMapsViewModel : BaseViewModel
4 | {
5 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Views/MediaElement/MediaElementCarouselViewViewModel.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.ObjectModel;
2 | using CommunityToolkit.Maui.Sample.Constants;
3 |
4 | namespace CommunityToolkit.Maui.Sample.ViewModels.Views;
5 |
6 | public partial class MediaElementCarouselViewViewModel : BaseViewModel
7 | {
8 | public ObservableCollection ItemSource { get; } =
9 | [
10 | new(new Uri(StreamingVideoUrls.BuckBunny), "Buck Bunny", 720, 1280),
11 | new(new Uri(StreamingVideoUrls.ElephantsDream), "Elephants Dream", 720, 1280),
12 | new(new Uri(StreamingVideoUrls.Sintel), "Sintel", 546, 1280)
13 | ];
14 | }
15 |
16 | public record MediaElementDataSource(Uri Source, string Name, int VideoHeight, int VideoWidth);
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Views/MediaElement/MediaElementCollectionViewViewModel.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.ObjectModel;
2 | using CommunityToolkit.Maui.Sample.Constants;
3 |
4 | namespace CommunityToolkit.Maui.Sample.ViewModels.Views;
5 |
6 | public partial class MediaElementCollectionViewViewModel : BaseViewModel
7 | {
8 | public ObservableCollection ItemSource { get; } =
9 | [
10 | new(new Uri(StreamingVideoUrls.BuckBunny), "Buck Bunny", 720, 1280),
11 | new(new Uri(StreamingVideoUrls.ElephantsDream), "Elephants Dream", 720, 1280),
12 | new(new Uri(StreamingVideoUrls.Sintel), "Sintel", 546, 1280)
13 | ];
14 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Views/MediaElement/MediaElementMultipleWindowsViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Sample.ViewModels.Views;
2 |
3 | public partial class MediaElementMultipleWindowsViewModel : BaseViewModel
4 | {
5 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Views/MediaElement/MediaElementViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Sample.ViewModels.Views;
2 |
3 | public partial class MediaElementViewModel : BaseViewModel
4 | {
5 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Views/Popup/PopupContentViewModel.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Mvvm.ComponentModel;
2 |
3 | namespace CommunityToolkit.Maui.Sample.ViewModels.Views;
4 |
5 | public sealed partial class PopupContentViewModel : BaseViewModel
6 | {
7 | [ObservableProperty]
8 | public partial string Message { get; private set; } = "";
9 |
10 | internal void SetMessage(string text) => this.Message = text;
11 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Views/Popup/PopupLayoutAlignmentViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Sample.ViewModels.Views;
2 |
3 | public partial class PopupLayoutAlignmentViewModel : BaseViewModel
4 | {
5 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Views/Popup/ShowPopupInOnAppearingPageViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Sample.ViewModels.Views;
2 |
3 | public partial class ShowPopupInOnAppearingPageViewModel : BaseViewModel
4 | {
5 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Views/Popup/XamlBindingPopupViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Sample.ViewModels.Views;
2 |
3 | public sealed partial class XamlBindingPopupViewModel : BaseViewModel
4 | {
5 | public string Title { get; } = "Xaml Binding Popup";
6 |
7 | public string Message { get; } = "This is a platform specific popup with a .NET MAUI View being rendered.\nThe behaviors of the popup will confirm to 100% as each platform implementation look and feel, but still allows you to use your .NET MAUI Controls.";
8 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Views/RatingView/RatingViewShowcaseViewModel.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Mvvm.ComponentModel;
2 |
3 | namespace CommunityToolkit.Maui.Sample.ViewModels.Views;
4 |
5 | public partial class RatingViewShowcaseViewModel : BaseViewModel
6 | {
7 | [ObservableProperty]
8 | public partial double StepperValueMaximumRatings { get; set; } = 1;
9 |
10 | [ObservableProperty]
11 | public partial double ReviewSummaryAverage { get; set; } = 0;
12 |
13 | [ObservableProperty]
14 | public partial Thickness RatingViewShapePadding { get; set; } = new(0);
15 |
16 | [ObservableProperty]
17 | public partial double ReviewSummaryCount { get; set; } = 0;
18 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/ViewModels/Views/SemanticOrderView/SemanticOrderViewPageViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Sample.ViewModels.Views;
2 |
3 | public partial class SemanticOrderViewPageViewModel : BaseViewModel
4 | {
5 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Views/NullableBoolComponentWithLabel.xaml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Views/NullableBoolComponentWithLabel.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Sample.Views;
2 |
3 | public partial class NullableBoolComponentWithLabel : Label
4 | {
5 | public static readonly BindableProperty NullableIsVisibleProperty = BindableProperty.Create(
6 | nameof(NullableIsVisible),
7 | typeof(bool?),
8 | typeof(NullableBoolComponentWithLabel));
9 |
10 |
11 | public NullableBoolComponentWithLabel()
12 | {
13 | InitializeComponent();
14 | }
15 |
16 | public bool? NullableIsVisible
17 | {
18 | get => (bool?)GetValue(NullableIsVisibleProperty);
19 | set => SetValue(NullableIsVisibleProperty, value);
20 | }
21 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Views/Popups/ApplyToDerivedTypesPopup.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Sample.Views.Popups;
2 |
3 | ///
4 | /// This popup demonstrates how the ApplyToDerivedTypes property can allow for Popup implementations
5 | /// that inherit from Popup to still use a common Style definition.
6 | ///
7 | public partial class ApplyToDerivedTypesPopup
8 | {
9 | public ApplyToDerivedTypesPopup()
10 | {
11 | InitializeComponent();
12 | }
13 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Views/Popups/ButtonPopup.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Sample.Views.Popups;
2 |
3 | public partial class ButtonPopup : Maui.Views.Popup
4 | {
5 | public ButtonPopup()
6 | {
7 | InitializeComponent();
8 | }
9 |
10 | void Button_Clicked(object? sender, EventArgs e)
11 | {
12 | CloseAsync();
13 | }
14 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Views/Popups/DynamicStyleInheritancePopup.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Sample.Views.Popups;
2 |
3 | public partial class DynamicStyleInheritancePopup
4 | {
5 | public DynamicStyleInheritancePopup()
6 | {
7 | InitializeComponent();
8 | }
9 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Views/Popups/DynamicStylePopup.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Views;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Views.Popups;
4 |
5 | ///
6 | /// This popup demonstrates how a is applied to a .
7 | ///
8 | public partial class DynamicStylePopup
9 | {
10 | public DynamicStylePopup()
11 | {
12 | InitializeComponent();
13 | }
14 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Views/Popups/ExplicitStylePopup.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Views;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Views.Popups;
4 |
5 | ///
6 | /// This popup demonstrates how a is applied to a explicitly.
7 | ///
8 | public partial class ExplicitStylePopup
9 | {
10 | public ExplicitStylePopup()
11 | {
12 | InitializeComponent();
13 | }
14 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Views/Popups/ImplicitStylePopup.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Views;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Views.Popups;
4 |
5 | ///
6 | /// This popup demonstrates how a is applied to a implictly
7 | /// through the use of only the property.
8 | ///
9 | public partial class ImplicitStylePopup : Popup
10 | {
11 | public ImplicitStylePopup()
12 | {
13 | InitializeComponent();
14 | }
15 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Views/Popups/MultipleButtonPopup.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Sample.Views.Popups;
2 |
3 | public partial class MultipleButtonPopup : Maui.Views.Popup
4 | {
5 | public MultipleButtonPopup()
6 | {
7 | InitializeComponent();
8 | }
9 |
10 | async void Cancel_Clicked(object? sender, EventArgs e)
11 | {
12 | await CloseAsync(false);
13 | }
14 |
15 | async void Okay_Clicked(object? sender, EventArgs e)
16 | {
17 | await CloseAsync(true);
18 | }
19 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Views/Popups/NoOutsideTapDismissPopup.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Alerts;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Views.Popups;
4 |
5 | public partial class NoOutsideTapDismissPopup : Maui.Views.Popup
6 | {
7 | public NoOutsideTapDismissPopup()
8 | {
9 | InitializeComponent();
10 | }
11 |
12 | async void Button_Clicked(object? sender, EventArgs e)
13 | {
14 | await CloseAsync();
15 | await Toast.Make("Popup Dismissed By Button").Show();
16 | }
17 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Views/Popups/OpenedEventSimplePopup.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Sample.Views.Popups;
2 |
3 | public partial class OpenedEventSimplePopup
4 | {
5 | public OpenedEventSimplePopup()
6 | {
7 | InitializeComponent();
8 | Opened += async (s, e) =>
9 | {
10 | await Task.Delay(TimeSpan.FromSeconds(1));
11 |
12 | Title.Text = "Opened Event Popup";
13 | Message.Text = "The content of this popup was updated after the popup was rendered";
14 | };
15 | }
16 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Views/Popups/PopupContentView.xaml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
17 |
18 |
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Views/Popups/PopupContentView.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.Views;
2 | using CommunityToolkit.Maui.Views;
3 |
4 | namespace CommunityToolkit.Maui.Sample.Views.Popups;
5 |
6 | public partial class PopupContentView : Popup
7 | {
8 | public PopupContentView(PopupContentViewModel popupContentViewModel)
9 | {
10 | InitializeComponent();
11 |
12 | BindingContext = popupContentViewModel;
13 |
14 | Opened += (s, e) =>
15 | popupContentViewModel.SetMessage(
16 | "This is a dynamically set message, shown in a popup without the need to create your own Popup subclass.");
17 | }
18 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Views/Popups/RedBlueBoxPopup.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Views;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Views.Popups;
4 |
5 | public partial class RedBlueBoxPopup : Popup
6 | {
7 | public RedBlueBoxPopup()
8 | {
9 | InitializeComponent();
10 | }
11 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Views/Popups/ReturnResultPopup.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Sample.Views.Popups;
2 |
3 | public partial class ReturnResultPopup
4 | {
5 | public ReturnResultPopup()
6 | {
7 | InitializeComponent();
8 | }
9 |
10 | async void Button_Clicked(object? sender, EventArgs e)
11 | {
12 | await CloseAsync("Close button tapped");
13 | }
14 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Views/Popups/SimplePopup.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Sample.Views.Popups;
2 |
3 | public partial class SimplePopup : ContentView, IQueryAttributable
4 | {
5 | public SimplePopup()
6 | {
7 | InitializeComponent();
8 | }
9 |
10 | void IQueryAttributable.ApplyQueryAttributes(IDictionary query)
11 | {
12 | DescriptionLabel.Text = (string)query[nameof(DescriptionLabel)];
13 | }
14 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Views/Popups/StyleClassPopup.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Views;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Views.Popups;
4 |
5 | ///
6 | /// This popup demonstrates how the property can be used to apply
7 | /// a definition to a .
8 | ///
9 | public partial class StyleClassPopup
10 | {
11 | public StyleClassPopup()
12 | {
13 | InitializeComponent();
14 | }
15 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Views/Popups/StyleInheritancePopup.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Views;
2 |
3 | namespace CommunityToolkit.Maui.Sample.Views.Popups;
4 |
5 | ///
6 | /// This popup demonstrates how the property can allow for Popup implementations
7 | /// that inherit from to still use a common definition.
8 | ///
9 | public partial class StyleInheritancePopup
10 | {
11 | public StyleInheritancePopup()
12 | {
13 | InitializeComponent();
14 | }
15 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Views/Popups/ToggleSizePopup.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Sample.Views.Popups;
2 |
3 | public partial class ToggleSizePopup : Maui.Views.Popup
4 | {
5 | readonly Size originalSize;
6 |
7 | public ToggleSizePopup()
8 | {
9 | InitializeComponent();
10 | originalSize = new Size(300, 300);
11 | WidthRequest = 300;
12 | HeightRequest = 300;
13 | }
14 |
15 | void Button_Clicked(object? sender, EventArgs e)
16 | {
17 | if (originalSize == new Size(WidthRequest, HeightRequest))
18 | {
19 | WidthRequest = originalSize.Width * 1.25;
20 | HeightRequest = originalSize.Height * 1.25;
21 | }
22 | else
23 | {
24 | WidthRequest = originalSize.Width;
25 | HeightRequest = originalSize.Height;
26 | }
27 | }
28 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Views/Popups/TransparentPopup.xaml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Views/Popups/TransparentPopup.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Sample.Views.Popups;
2 |
3 | public partial class TransparentPopup : Maui.Views.Popup
4 | {
5 | public TransparentPopup() => InitializeComponent();
6 |
7 | async void CloseButtonClicked(object? sender, EventArgs args)
8 | {
9 | await CloseAsync();
10 | }
11 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Views/Popups/UpdatingPopup.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Sample.ViewModels.Views;
2 | using CommunityToolkit.Maui.Views;
3 |
4 | namespace CommunityToolkit.Maui.Sample.Views.Popups;
5 |
6 | public partial class UpdatingPopup : Popup
7 | {
8 | public UpdatingPopup(UpdatingPopupViewModel updatingPopupViewModel)
9 | {
10 | InitializeComponent();
11 | BindingContext = updatingPopupViewModel;
12 | Opened += (_, _) =>
13 | {
14 | updatingPopupViewModel.PerformUpdates(3);
15 | };
16 | }
17 | }
--------------------------------------------------------------------------------
/samples/CommunityToolkit.Maui.Sample/Views/Popups/XamlBindingPopup.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Sample.Views.Popups;
2 |
3 | public partial class XamlBindingPopup : ContentView
4 | {
5 | public XamlBindingPopup()
6 | {
7 | InitializeComponent();
8 | }
9 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Analyzers.Benchmarks/Program.cs:
--------------------------------------------------------------------------------
1 | using BenchmarkDotNet.Configs;
2 | using BenchmarkDotNet.Running;
3 |
4 | namespace CommunityToolkit.Maui.Analyzers.Benchmarks;
5 |
6 | public class Program
7 | {
8 | public static void Main(string[] args)
9 | {
10 | var config = DefaultConfig.Instance;
11 | BenchmarkRunner.Run(config, args);
12 | BenchmarkRunner.Run(config, args);
13 | BenchmarkRunner.Run(config, args);
14 | }
15 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Analyzers.CodeFixes/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | [assembly: System.Resources.NeutralResourcesLanguage("en")]
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Analyzers.CodeFixes/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "profiles": {
3 | "CommunityToolkit.Maui.Sample": {
4 | "commandName": "DebugRoslynComponent",
5 | "targetProject": "..\\..\\samples\\CommunityToolkit.Maui.Sample\\CommunityToolkit.Maui.Sample.csproj"
6 | }
7 | }
8 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Analyzers.UnitTests/xunit.runner.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://xunit.net/schema/current/xunit.runner.schema.json"
3 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Analyzers/AnalyzerReleases.Shipped.md:
--------------------------------------------------------------------------------
1 | ## Release 1.1.0
2 |
3 | ### New Rules
4 |
5 | Rule ID | Category | Severity | Notes
6 | --------|----------|----------|-----------------------------------------------------
7 | MCT001 | Usage | Error | `.UseMauiCommunityToolkit()` Not Found on MauiAppBuilder
8 |
9 | ## Release 11.1.0
10 |
11 | ### New Rules
12 |
13 | Rule ID | Category | Severity | Notes
14 | --------|----------|----------|-----------------------------------------------------
15 | MCT002 | Usage | Error | The value of MaximumRating must be between 1 and 10
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Analyzers/AnalyzerReleases.Unshipped.md:
--------------------------------------------------------------------------------
1 | ### New Rules
2 |
3 | Rule ID | Category | Severity | Notes
4 | --------|----------|----------|--------------------
5 |
6 | ### Changed Rules
7 |
8 | Rule ID | New Category | New Severity | Old Category | Old Severity | Notes
9 | --------|--------------|--------------|--------------|--------------|-------
10 | MCT001 | Initialization | Error | Usage | Error | UseCommunityToolkitInitializationAnalyzer
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Analyzers/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | [assembly: System.Resources.NeutralResourcesLanguage("en")]
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Analyzers/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "profiles": {
3 | "CommunityToolkit.Sample": {
4 | "commandName": "DebugRoslynComponent",
5 | "targetProject": "..\\..\\samples\\CommunityToolkit.Maui.Sample\\CommunityToolkit.Maui.Sample.csproj"
6 | }
7 | }
8 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Camera.Analyzers.CodeFixes/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | [assembly: System.Resources.NeutralResourcesLanguage("en")]
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Camera.Analyzers/AnalyzerReleases.Shipped.md:
--------------------------------------------------------------------------------
1 | ## Release 1.0.0
2 |
3 | ### New Rules
4 |
5 | Rule ID | Category | Severity | Notes
6 | --------|----------|----------|-----------------------------------------------------
7 | MCTC001 | Usage | Error | `.UseMauiCommunityToolkitCamera()` Not Found on MauiAppBuilder
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Camera.Analyzers/AnalyzerReleases.Unshipped.md:
--------------------------------------------------------------------------------
1 | ### New Rules
2 |
3 | Rule ID | Category | Severity | Notes
4 | --------|----------|----------|--------------------
5 |
6 | ### Changed Rules
7 |
8 | Rule ID | New Category | New Severity | Old Category | Old Severity | Notes
9 | --------|--------------|--------------|--------------|--------------|-------
10 | MCTC001 | Initialization | Error | Usage | Error | UseCommunityToolkitCameraInitializationAnalyzer
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Camera.Analyzers/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | [assembly: System.Resources.NeutralResourcesLanguage("en")]
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Camera/AssemblyInfo.shared.cs:
--------------------------------------------------------------------------------
1 | [assembly: XmlnsDefinition(Constants.XamlNamespace, Constants.CommunityToolkitNamespacePrefix + nameof(CommunityToolkit.Maui.Views))]
2 | [assembly: XmlnsDefinition(Constants.XamlNamespace, Constants.CommunityToolkitNamespace)]
3 |
4 | [assembly: Microsoft.Maui.Controls.XmlnsPrefix(Constants.XamlNamespace, "toolkit")]
5 |
6 | static class Constants
7 | {
8 | public const string XamlNamespace = "http://schemas.microsoft.com/dotnet/2022/maui/toolkit";
9 | public const string CommunityToolkitNamespace = $"{nameof(CommunityToolkit)}.{nameof(CommunityToolkit.Maui)}";
10 | public const string CommunityToolkitNamespacePrefix = $"{CommunityToolkitNamespace}.";
11 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Camera/CommunityToolkit.Maui.Camera.nuspec:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Camera/Extensions/CameraView.net.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Extensions;
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Camera/Extensions/CameraViewExtensions.tizen.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Extensions;
2 |
3 | static class CameraViewExtensions
4 | {
5 | // Dummy implementation intentionally left blank
6 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Camera/Interfaces/IAsynchronouseHandler.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Camera;
2 |
3 | ///
4 | /// Interface that allows asynchronous completion of .NET MAUI Handlers
5 | ///
6 | public interface IAsynchronousHandler
7 | {
8 | ///
9 | /// A to provide Handlers an asynchronous way to complete
10 | ///
11 | TaskCompletionSource HandlerCompleteTCS { get; }
12 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Camera/Primitives/CameraException.shared.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Core;
2 |
3 | ///
4 | /// that can be thrown when the implementation
5 | /// experiences a critical error.
6 | ///
7 | /// The specific error message indicating what error has occurred.
8 | public class CameraException(string message) : Exception(message)
9 | {
10 |
11 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Camera/Primitives/CameraFlashMode.shared.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Core.Primitives;
2 |
3 | ///
4 | /// Enumeration of the possible flash modes supported by the camera.
5 | ///
6 | public enum CameraFlashMode
7 | {
8 | ///
9 | /// Flash is off and will not be used.
10 | ///
11 | Off,
12 |
13 | ///
14 | /// Flash is on and will always be used.
15 | ///
16 | On,
17 |
18 | ///
19 | /// Flash will automatically be used based on the lighting conditions.
20 | ///
21 | Auto
22 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Camera/Primitives/CameraPosition.shared.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Core.Primitives;
2 |
3 | ///
4 | /// Enumeration of the possible positions that a camera can be placed.
5 | ///
6 | public enum CameraPosition
7 | {
8 | ///
9 | /// The camera is in an unknown position.
10 | ///
11 | Unknown,
12 |
13 | ///
14 | /// The camera is located at the rear of the device.
15 | ///
16 | ///
17 | /// This is typically the better quality camera.
18 | ///
19 | Rear,
20 |
21 | ///
22 | /// The camera is located at the front of the device.
23 | ///
24 | Front
25 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Camera/Primitives/MediaCaptureFailedEventArgs.shared.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Views;
2 |
3 | ///
4 | /// Event args containing all contextual information related to a media capture failure event.
5 | ///
6 | ///
7 | /// Creates a new instance of .
8 | ///
9 | /// A string containing the reason why the capture attempt failed.
10 | public class MediaCaptureFailedEventArgs(string failureReason) : EventArgs
11 | {
12 | ///
13 | /// Gets the reason why the capture attempt failed.
14 | ///
15 | public string FailureReason { get; } = failureReason;
16 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Camera/Primitives/MediaCapturedEventArgs.shared.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Views;
2 |
3 | ///
4 | /// Event args containing all contextual information related to media capture event.
5 | ///
6 | /// The pointing to the newly captured media.
7 | public class MediaCapturedEventArgs(Stream stream) : EventArgs
8 | {
9 | ///
10 | /// Gets the pointing to the newly captured media.
11 | ///
12 | public Stream Media { get; } = stream;
13 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Camera/Providers/CameraProvider.net.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Core;
2 |
3 | partial class CameraProvider
4 | {
5 | public partial ValueTask RefreshAvailableCameras(CancellationToken token) => throw new NotSupportedException();
6 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Camera/Providers/CameraProvider.shared.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Core;
2 |
3 | ///
4 | /// Implementation that provides the ability to discover cameras that are attached to the current device.
5 | ///
6 | partial class CameraProvider : ICameraProvider
7 | {
8 | ///
9 | public IReadOnlyList? AvailableCameras { get; private set; }
10 |
11 | ///
12 | public partial ValueTask RefreshAvailableCameras(CancellationToken token);
13 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Camera/Providers/CameraProvider.tizen.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Core;
2 |
3 | partial class CameraProvider
4 | {
5 | public partial ValueTask RefreshAvailableCameras(CancellationToken token) => throw new NotSupportedException();
6 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Camera/linker.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/.editorconfig:
--------------------------------------------------------------------------------
1 | [*.cs]
2 |
3 | # Missing XML comment for publicly visible type or member
4 | dotnet_diagnostic.CS1591.severity = error
5 |
6 | # String comparison preferences
7 | dotnet_diagnostic.CA1307.severity = error
8 | dotnet_diagnostic.CA1309.severity = error
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Essentials/AndroidRequestCode.android.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Storage;
2 |
3 | enum AndroidRequestCode
4 | {
5 | RequestCodeFolderPicker = 2000,
6 | RequestCodeSaveFilePicker = 2001
7 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Essentials/AndroidStorageConstants.android.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Core.Essentials;
2 |
3 | static class AndroidStorageConstants
4 | {
5 | public const string PrimaryStorage = "primary";
6 | public const string Storage = "storage";
7 | public const string ExternalStorageBaseUrl = "content://com.android.externalstorage.documents/document/primary%3A";
8 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Essentials/Badge/Android/BadgeImplementation.android.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.ApplicationModel;
2 |
3 | ///
4 | public class BadgeImplementation : IBadge
5 | {
6 | ///
7 | public void SetCount(uint count)
8 | {
9 | var badgeProvider = BadgeFactory.GetBadgeProvider();
10 | badgeProvider.SetCount(count);
11 | }
12 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Essentials/Badge/Android/IBadgeProvider.android.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.ApplicationModel;
2 |
3 | ///
4 | /// Android badge provider
5 | ///
6 | public interface IBadgeProvider
7 | {
8 | ///
9 | /// Set count for badge
10 | ///
11 | void SetCount(uint count);
12 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Essentials/Badge/Badge.shared.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.ApplicationModel;
2 |
3 | ///
4 | public static class Badge
5 | {
6 | static Lazy defaultImplementationHolder = new(() => new BadgeImplementation());
7 |
8 | ///
9 | public static IBadge Default => defaultImplementationHolder.Value;
10 |
11 | ///
12 | public static void SetCount(uint count)
13 | {
14 | Default.SetCount(count);
15 | }
16 |
17 | internal static void SetDefault(IBadge implementation) =>
18 | defaultImplementationHolder = new(implementation);
19 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Essentials/Badge/BadgeImplementation.net.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.ApplicationModel;
2 |
3 | ///
4 | public class BadgeImplementation : IBadge
5 | {
6 | ///
7 | public void SetCount(uint count)
8 | {
9 | throw new NotSupportedException($"{nameof(IBadge)} requires a platform-specific implementation of .NET");
10 | }
11 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Essentials/Badge/BadgeImplementation.tizen.cs:
--------------------------------------------------------------------------------
1 | using Tizen.Applications;
2 | using Tizen.NUI;
3 |
4 | namespace CommunityToolkit.Maui.ApplicationModel;
5 |
6 | ///
7 | public class BadgeImplementation : IBadge
8 | {
9 | ///
10 | public void SetCount(uint count)
11 | {
12 | var appId = Application.Current.ApplicationInfo.ApplicationId;
13 | if (count is 0)
14 | {
15 | BadgeControl.Remove(appId);
16 | return;
17 | }
18 |
19 | var badge = BadgeControl.Find(appId);
20 | if (badge is null)
21 | {
22 | badge = new Tizen.Applications.Badge(appId, (int)count);
23 | BadgeControl.Add(badge);
24 | }
25 | else
26 | {
27 | badge.Count = (int)count;
28 | BadgeControl.Update(badge);
29 | }
30 | }
31 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Essentials/Badge/IBadge.shared.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.ApplicationModel;
2 |
3 | ///
4 | /// Badge
5 | ///
6 | public interface IBadge
7 | {
8 | ///
9 | /// Set the badge count
10 | ///
11 | /// Badge count
12 | void SetCount(uint count);
13 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Essentials/FileSaver/FileSaveException.shared.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Storage;
2 |
3 | ///
4 | /// Exception occurred if the file is not saved
5 | ///
6 | ///
7 | /// Initializes a new instance of
8 | ///
9 | public sealed class FileSaveException(string message) : Exception(message)
10 | {
11 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Essentials/FileSaver/FileSaverImplementation.net.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Storage;
2 |
3 | ///
4 | public sealed partial class FileSaverImplementation : IFileSaver
5 | {
6 | Task InternalSaveAsync(string initialPath, string fileName, Stream stream, IProgress? progress, CancellationToken cancellationToken)
7 | {
8 | throw new NotImplementedException();
9 | }
10 |
11 | Task InternalSaveAsync(string fileName, Stream stream, IProgress? progress, CancellationToken cancellationToken)
12 | {
13 | throw new NotImplementedException();
14 | }
15 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Essentials/FolderPicker/FolderPickerException.shared.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Storage;
2 |
3 | ///
4 | /// Exception occurred if error has occurred during picking the folder
5 | ///
6 | public sealed class FolderPickerException : Exception
7 | {
8 | ///
9 | /// Initializes a new instance of
10 | ///
11 | public FolderPickerException(string message) : base(message)
12 | {
13 |
14 | }
15 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Essentials/FolderPicker/FolderPickerImplementation.net.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Core.Primitives;
2 |
3 | namespace CommunityToolkit.Maui.Storage;
4 |
5 | ///
6 | public sealed partial class FolderPickerImplementation : IFolderPicker
7 | {
8 | Task InternalPickAsync(string initialPath, CancellationToken cancellationToken) => throw new NotImplementedException();
9 |
10 | Task InternalPickAsync(CancellationToken cancellationToken) => throw new NotImplementedException();
11 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Essentials/SpeechToText/Events/SpeechToTextRecognitionResultCompletedEventArgs.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Media;
2 |
3 | ///
4 | /// for
5 | ///
6 | public class SpeechToTextRecognitionResultCompletedEventArgs : EventArgs
7 | {
8 | ///
9 | /// Initialize a new instance of
10 | ///
11 | public SpeechToTextRecognitionResultCompletedEventArgs(SpeechToTextResult recognitionResult)
12 | {
13 | RecognitionResult = recognitionResult;
14 | }
15 |
16 | ///
17 | /// Speech recognition result
18 | ///
19 | public SpeechToTextResult RecognitionResult { get; }
20 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Essentials/SpeechToText/Events/SpeechToTextRecognitionResultUpdatedEventArgs.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Media;
2 |
3 | ///
4 | /// for
5 | ///
6 | public class SpeechToTextRecognitionResultUpdatedEventArgs : EventArgs
7 | {
8 | ///
9 | /// Initialize a new instance of
10 | ///
11 | public SpeechToTextRecognitionResultUpdatedEventArgs(string recognitionResult)
12 | {
13 | RecognitionResult = recognitionResult;
14 | }
15 |
16 | ///
17 | /// Speech recognition result
18 | ///
19 | public string RecognitionResult { get; }
20 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Essentials/SpeechToText/Events/SpeechToTextStateChangedEventArgs.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Media;
2 |
3 | ///
4 | /// for
5 | ///
6 | public class SpeechToTextStateChangedEventArgs : EventArgs
7 | {
8 | ///
9 | /// Initialize a new instance of
10 | ///
11 | public SpeechToTextStateChangedEventArgs(SpeechToTextState state)
12 | {
13 | State = state;
14 | }
15 |
16 | ///
17 | /// Speech To Text State
18 | ///
19 | public SpeechToTextState State { get; }
20 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Essentials/SpeechToText/OfflineSpeechToTextImplementation.net.cs:
--------------------------------------------------------------------------------
1 | using System.Globalization;
2 |
3 | namespace CommunityToolkit.Maui.Media;
4 |
5 | ///
6 | public sealed partial class OfflineSpeechToTextImplementation
7 | {
8 | ///
9 | public ValueTask DisposeAsync()
10 | {
11 | return ValueTask.CompletedTask;
12 | }
13 |
14 | Task InternalStartListening(SpeechToTextOptions options, CancellationToken token = default)
15 | {
16 | throw new NotSupportedException();
17 | }
18 |
19 | void InternalStopListening()
20 | {
21 | throw new NotSupportedException();
22 | }
23 |
24 | ///
25 | public SpeechToTextState CurrentState { get; } = SpeechToTextState.Stopped;
26 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Essentials/SpeechToText/SpeechToTextImplementation.net.cs:
--------------------------------------------------------------------------------
1 | using System.Globalization;
2 |
3 | namespace CommunityToolkit.Maui.Media;
4 |
5 | ///
6 | public sealed partial class SpeechToTextImplementation
7 | {
8 | ///
9 | public ValueTask DisposeAsync()
10 | {
11 | return ValueTask.CompletedTask;
12 | }
13 |
14 | Task InternalStartListeningAsync(SpeechToTextOptions options, CancellationToken cancellationToken)
15 | {
16 | throw new NotSupportedException();
17 | }
18 |
19 | Task InternalStopListeningAsync(CancellationToken cancellationToken)
20 | {
21 | throw new NotSupportedException();
22 | }
23 |
24 | ///
25 | public SpeechToTextState CurrentState { get; } = SpeechToTextState.Stopped;
26 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Essentials/SpeechToText/SpeechToTextOptions.cs:
--------------------------------------------------------------------------------
1 | using System.Globalization;
2 |
3 | namespace CommunityToolkit.Maui.Media;
4 |
5 | ///
6 | /// Options for configuring speech recognition.
7 | ///
8 | public class SpeechToTextOptions
9 | {
10 | ///
11 | /// The culture to use for speech recognition.
12 | ///
13 | public required CultureInfo Culture { get; init; }
14 |
15 | ///
16 | /// Include partial recognition results.
17 | ///
18 | public bool ShouldReportPartialResults { get; init; } = true;
19 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Essentials/SpeechToText/SpeechToTextState.shared.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Media;
2 |
3 | ///
4 | /// Speech To Text listening state
5 | ///
6 | public enum SpeechToTextState
7 | {
8 | ///
9 | /// Listening is stopped
10 | ///
11 | Stopped,
12 |
13 | ///
14 | /// Listening is active
15 | ///
16 | Listening,
17 |
18 | ///
19 | /// Listening is active, but no sound is detected
20 | ///
21 | Silence
22 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Extensions/BrushExtensions.windows.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Maui.Platform;
2 | using Microsoft.UI.Xaml.Media;
3 |
4 | namespace CommunityToolkit.Maui.Core.Extensions;
5 |
6 | ///
7 | /// Extensions for
8 | ///
9 | public static class BrushExtensions
10 | {
11 | ///
12 | /// Convert to
13 | ///
14 | public static Color? ToColor(this Brush brush)
15 | {
16 | if (brush is SolidColorBrush solidColorBrush)
17 | {
18 | return solidColorBrush.Color.ToColor();
19 | }
20 |
21 | return null;
22 | }
23 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Extensions/MathExtensions.shared.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Core.Extensions;
2 |
3 | ///
4 | /// Extension methods to help with Math.
5 | ///
6 | public static class MathExtensions
7 | {
8 | ///
9 | /// Check if the number is zero or NaN.
10 | ///
11 | /// The that you want to check.
12 | /// A value that indicates if the number is zero or NaN.
13 | public static bool IsZeroOrNaN(this double number) => number is 0 or Double.NaN;
14 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Extensions/NullableExtensions.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Core.Extensions;
2 |
3 | static class NullableExtensions
4 | {
5 | public static bool IsNullable(this Type type)
6 | {
7 | if (!type.IsValueType)
8 | {
9 | return true; // ref-type
10 | }
11 |
12 | if (Nullable.GetUnderlyingType(type) is not null)
13 | {
14 | return true; // Nullable
15 | }
16 |
17 | return false; // value-type
18 | }
19 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Extensions/ObservableCollectionExtensions.shared.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.ObjectModel;
2 |
3 | namespace CommunityToolkit.Maui.Core.Extensions;
4 |
5 | ///
6 | /// extensions
7 | ///
8 | public static class ObservableCollectionExtensions
9 | {
10 | ///
11 | /// Create new from
12 | ///
13 | public static ObservableCollection ToObservableCollection(this IEnumerable collection)
14 | {
15 | return new ObservableCollection(collection);
16 | }
17 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/GlobalUsings.shared.cs:
--------------------------------------------------------------------------------
1 | global using Microsoft.Maui;
2 | global using Microsoft.Maui.Devices;
3 | global using Microsoft.Maui.Graphics;
4 | global using Microsoft.Maui.Hosting;
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Handlers/DrawingView/IDrawingLineAdapter.shared.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Core.Views;
2 |
3 | namespace CommunityToolkit.Maui.Core.Handlers;
4 |
5 | ///
6 | /// DrawingLine Adapter
7 | ///
8 | public interface IDrawingLineAdapter
9 | {
10 | ///
11 | /// Convert to .
12 | ///
13 | ///
14 | IDrawingLine ConvertMauiDrawingLine(MauiDrawingLine mauiDrawingLine);
15 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Handlers/DrawingView/IDrawingViewHandler.shared.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Core.Handlers;
2 |
3 | ///
4 | /// handler.
5 | ///
6 | public interface IDrawingViewHandler
7 | {
8 | ///
9 | /// Set .
10 | ///
11 | ///
12 | void SetDrawingLineAdapter(IDrawingLineAdapter drawingLineAdapter);
13 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Handlers/SemanticOrderView/SemanticOrderViewHandler.android.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Core.Views;
2 | using Microsoft.Maui.Platform;
3 |
4 | namespace CommunityToolkit.Maui.Core.Handlers;
5 |
6 | public partial class SemanticOrderViewHandler
7 | {
8 | ///
9 | protected override ContentViewGroup CreatePlatformView()
10 | {
11 | if (MauiContext?.Context is null)
12 | {
13 | throw new InvalidOperationException("Android Context is null, please ensure your MauiApplication is initialized.");
14 | }
15 |
16 | return new MauiSemanticOrderView(MauiContext.Context);
17 | }
18 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Handlers/SemanticOrderView/SemanticOrderViewHandler.macios.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Core.Views;
2 | using Microsoft.Maui.Platform;
3 |
4 | namespace CommunityToolkit.Maui.Core.Handlers;
5 |
6 | public partial class SemanticOrderViewHandler
7 | {
8 | ///
9 | protected override ContentView CreatePlatformView() => new MauiSemanticOrderView();
10 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Handlers/SemanticOrderView/SemanticOrderViewHandler.net.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Core.Handlers;
2 |
3 | public partial class SemanticOrderViewHandler
4 | {
5 | ///
6 | protected override object CreatePlatformView() => throw new NotSupportedException();
7 |
8 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Handlers/SemanticOrderView/SemanticOrderViewHandler.tizen.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Core.Views;
2 | using Microsoft.Maui.Platform;
3 |
4 | namespace CommunityToolkit.Maui.Core.Handlers;
5 |
6 | public partial class SemanticOrderViewHandler
7 | {
8 | ///
9 | protected override ContentViewGroup CreatePlatformView() => new MauiSemanticOrderView(VirtualView);
10 | }
11 |
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Handlers/SemanticOrderView/SemanticOrderViewHandler.windows.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Core.Views;
2 | using Microsoft.Maui.Platform;
3 |
4 | namespace CommunityToolkit.Maui.Core.Handlers;
5 |
6 | public partial class SemanticOrderViewHandler
7 | {
8 | ///
9 | protected override ContentPanel CreatePlatformView() => new MauiSemanticOrderView();
10 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Interfaces/IAlert.shared.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Core;
2 |
3 | ///
4 | /// Alert
5 | ///
6 | public interface IAlert : IDisposable
7 | {
8 | ///
9 | /// Message text
10 | ///
11 | string Text { get; }
12 |
13 | ///
14 | /// Dismiss the alert
15 | ///
16 | Task Dismiss(CancellationToken token = default);
17 |
18 | ///
19 | /// Show the alert
20 | ///
21 | Task Show(CancellationToken token = default);
22 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Interfaces/IAsynchronousHandler.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Core;
2 |
3 | ///
4 | /// Interface that allows asynchronous completion of .NET MAUI Handlers
5 | ///
6 | public interface IAsynchronousHandler
7 | {
8 | ///
9 | /// A to provide Handlers an asynchronous way to complete
10 | ///
11 | TaskCompletionSource HandlerCompleteTCS { get; }
12 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Interfaces/IAvatarView.shared.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Core;
2 |
3 | /// Avatar view interface.
4 | public interface IAvatarView : IBorderView, ILabel, Microsoft.Maui.IImage, IImageSource
5 | {
6 | /// Gets a value indicating the avatar border colour.
7 | Color BorderColor { get; }
8 |
9 | /// Gets a value indicating the avatar border width.
10 | double BorderWidth { get; }
11 |
12 | /// Gets a value indicating the avatar corner radius .
13 | CornerRadius CornerRadius { get; }
14 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Interfaces/IExpander.shared.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Core;
2 |
3 | ///
4 | /// Allows collapse and expand content.
5 | ///
6 | public interface IExpander : IContentView
7 | {
8 | ///
9 | /// Expander header.
10 | ///
11 | IView? Header { get; }
12 |
13 | ///
14 | /// Gets or sets expand direction.
15 | ///
16 | ExpandDirection Direction { get; }
17 |
18 | ///
19 | /// Gets or sets Expander collapsible state.
20 | ///
21 | bool IsExpanded { get; set; }
22 |
23 | ///
24 | /// Action when changes
25 | ///
26 | void ExpandedChanged(bool isExpanded);
27 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Interfaces/ISemanticOrderView.shared.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Core;
2 |
3 | ///
4 | /// Allows users to specify the semantic order of child views.
5 | ///
6 | public interface ISemanticOrderView : IContentView
7 | {
8 | ///
9 | /// The semantic order to traverse child views
10 | ///
11 | IEnumerable ViewOrder { get; }
12 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Interfaces/IToast.shared.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Core;
2 |
3 | ///
4 | /// Toast
5 | ///
6 | public interface IToast : IAlert
7 | {
8 | ///
9 | /// Toast duration
10 | ///
11 | ToastDuration Duration { get; }
12 |
13 | ///
14 | /// Toast font size
15 | ///
16 | double TextSize { get; }
17 | }
18 |
19 | ///
20 | /// Toast duration
21 | ///
22 | public enum ToastDuration
23 | {
24 | ///
25 | /// Displays Toast for a short time (~2 seconds).
26 | ///
27 | Short,
28 |
29 | ///
30 | /// Displays Toast for a long time (~3.5 seconds).
31 | ///
32 | Long
33 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Interfaces/IUniformItemsLayout.shared.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Core;
2 |
3 | ///
4 | /// Uniform Items Layout Control
5 | ///
6 | public interface IUniformItemsLayout : ILayout
7 | {
8 | ///
9 | /// Max rows
10 | ///
11 | int MaxRows { get; }
12 |
13 | ///
14 | /// Max columns
15 | ///
16 | int MaxColumns { get; }
17 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Options.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Core;
2 |
3 | ///
4 | /// .NET MAUI Community Toolkit Core Options.
5 | ///
6 | public class Options
7 | {
8 | internal static bool ShouldUseStatusBarBehaviorOnAndroidModalPage { get; private set; }
9 |
10 | ///
11 | /// Enables the use of the DialogFragment Lifecycle service for Android.
12 | ///
13 | /// true if yes or false if you want to implement your own.
14 | ///
15 | /// Default value is fasle.
16 | ///
17 | public void SetShouldUseStatusBarBehaviorOnAndroidModalPage(bool value) => ShouldUseStatusBarBehaviorOnAndroidModalPage = value;
18 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Platform/KeyboardExtensions/KeyboardExtensions.ios.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Core.Platform;
2 |
3 | public static partial class KeyboardExtensions
4 | {
5 | static bool HideKeyboard(this UIView inputView) => inputView.ResignFirstResponder();
6 |
7 | static bool ShowKeyboard(this UIView inputView) => inputView.BecomeFirstResponder();
8 |
9 | static bool IsSoftKeyboardShowing(this UIView inputView) => inputView.IsFirstResponder;
10 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Platform/KeyboardExtensions/KeyboardExtensions.macos.cs:
--------------------------------------------------------------------------------
1 | using System.Runtime.Versioning;
2 |
3 | namespace CommunityToolkit.Maui.Core.Platform;
4 |
5 | [UnsupportedOSPlatform("MacCatalyst")]
6 | public static partial class KeyboardExtensions
7 | {
8 | static bool HideKeyboard(this UIView inputView) => throw new NotSupportedException("MacOS does not currently support opening the SoftKeyboard");
9 |
10 | static bool ShowKeyboard(this UIView inputView) => throw new NotSupportedException("MacOS does not currently support opening the SoftKeyboard");
11 |
12 | static bool IsSoftKeyboardShowing(this UIView inputView) => throw new NotSupportedException("MacOS does not currently support opening the SoftKeyboard");
13 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Platform/KeyboardExtensions/KeyboardExtensions.net.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Core.Platform;
2 |
3 | public static partial class KeyboardExtensions
4 | {
5 | static bool HideKeyboard(this object _) => throw new NotSupportedException();
6 |
7 | static bool ShowKeyboard(this object _) => throw new NotSupportedException();
8 |
9 | static bool IsSoftKeyboardShowing(this object _) => throw new NotSupportedException();
10 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Platform/KeyboardExtensions/KeyboardExtensions.tizen.cs:
--------------------------------------------------------------------------------
1 | using Tizen.NUI.BaseComponents;
2 |
3 | namespace CommunityToolkit.Maui.Core.Platform;
4 |
5 | public static partial class KeyboardExtensions
6 | {
7 | static bool HideKeyboard(this View view) => SetKeyInputFocus(view, false);
8 |
9 | static bool ShowKeyboard(this View view) => SetKeyInputFocus(view, true);
10 |
11 | static bool IsSoftKeyboardShowing(this View view)
12 | {
13 | return view.KeyInputFocus;
14 | }
15 |
16 | static bool SetKeyInputFocus(View view, bool isShow)
17 | {
18 | view.KeyInputFocus = isShow;
19 |
20 | return view.KeyInputFocus;
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Platform/StatusBar/StatusBar.macos.cs:
--------------------------------------------------------------------------------
1 | using System.Runtime.Versioning;
2 |
3 | namespace CommunityToolkit.Maui.Core.Platform;
4 |
5 | [UnsupportedOSPlatform("MacCatalyst"), UnsupportedOSPlatform("MacOS")]
6 | static partial class StatusBar
7 | {
8 | static void PlatformSetColor(Color color)
9 | {
10 | throw new NotSupportedException("MacCatalyst does not currently support changing the macOS status bar color");
11 | }
12 |
13 | static void PlatformSetStyle(StatusBarStyle style)
14 | {
15 | throw new NotSupportedException("MacCatalyst does not currently support changing the macOS status bar color");
16 | }
17 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Platform/StatusBar/StatusBar.net.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Core.Platform;
2 |
3 | static partial class StatusBar
4 | {
5 | static void PlatformSetColor(Color color) => throw new NotSupportedException($"{nameof(PlatformSetColor)} is only supported on iOS and Android 23 and later");
6 |
7 | static void PlatformSetStyle(StatusBarStyle statusBarStyle) => throw new NotSupportedException($"{nameof(PlatformSetStyle)} is only supported on iOS and Android 23 and later");
8 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Platform/StatusBar/StatusBar.tizen.cs:
--------------------------------------------------------------------------------
1 | using System.Runtime.Versioning;
2 | using Microsoft.Maui.Platform;
3 |
4 | namespace CommunityToolkit.Maui.Core.Platform;
5 |
6 | [UnsupportedOSPlatform("Tizen")]
7 | static partial class StatusBar
8 | {
9 | static void PlatformSetColor(Color color)
10 | {
11 | throw new NotSupportedException("Tizen does not currently support changing the status bar color");
12 | }
13 |
14 | static void PlatformSetStyle(StatusBarStyle style)
15 | {
16 | throw new NotSupportedException("Tizen does not currently support changing the status bar color");
17 | }
18 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Platform/StatusBar/StatusBar.windows.cs:
--------------------------------------------------------------------------------
1 | using System.Runtime.Versioning;
2 |
3 | namespace CommunityToolkit.Maui.Core.Platform;
4 |
5 | [UnsupportedOSPlatform("Windows")]
6 | static partial class StatusBar
7 | {
8 | static void PlatformSetColor(Color color)
9 | {
10 | throw new NotSupportedException("WinUI does not currently support changing the Windows status bar color");
11 | }
12 |
13 | static void PlatformSetStyle(StatusBarStyle style)
14 | {
15 | throw new NotSupportedException("WinUI does not currently support changing the Windows status bar color");
16 | }
17 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Primitives/AlertViewVisualOptions.macios.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Core;
2 |
3 | ///
4 | /// Visual Options for
5 | ///
6 | public class AlertViewVisualOptions
7 | {
8 | ///
9 | /// Border Corner Radius
10 | ///
11 | public CGRect CornerRadius { get; set; }
12 |
13 | ///
14 | /// Background Color
15 | ///
16 | public UIColor BackgroundColor { get; set; } = UIColor.Gray;
17 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Primitives/DockPosition.shared.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Core;
2 |
3 | ///
4 | /// Docking position for a view in .
5 | ///
6 | public enum DockPosition
7 | {
8 | ///
9 | /// Do not dock.
10 | ///
11 | None = 0,
12 |
13 | ///
14 | /// Dock at the top.
15 | ///
16 | Top = 1,
17 |
18 | ///
19 | /// Dock to the left.
20 | ///
21 | Left = 2,
22 |
23 | ///
24 | /// Dock to the right.
25 | ///
26 | Right = 3,
27 |
28 | ///
29 | /// Dock at the bottom.
30 | ///
31 | Bottom = 4
32 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Primitives/DrawingLineCompletedEventArgs.shared.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Core;
2 |
3 | ///
4 | /// Contains last drawing line
5 | ///
6 | ///
7 | /// Initialize a new instance of
8 | ///
9 | /// Last drawing line
10 | public class DrawingLineCompletedEventArgs(IDrawingLine lastDrawingLine) : EventArgs
11 | {
12 | ///
13 | /// Last drawing line
14 | ///
15 | public IDrawingLine LastDrawingLine { get; } = lastDrawingLine;
16 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Primitives/DrawingLineStartedEventArgs.shared.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Core;
2 |
3 | ///
4 | /// Contains last drawing point
5 | ///
6 | ///
7 | /// Initialize a new instance of
8 | ///
9 | ///
10 | public class DrawingLineStartedEventArgs(PointF point) : EventArgs
11 | {
12 | ///
13 | /// Last drawing point
14 | ///
15 | public PointF Point { get; } = point;
16 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Primitives/DrawingViewOutputOption.shared.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Core;
2 |
3 | ///
4 | /// Enumeration of the options available when generating an image stream using the DrawingView.
5 | ///
6 | public enum DrawingViewOutputOption
7 | {
8 | ///
9 | /// Outputs the area covered by the top-left to the bottom-right most points.
10 | ///
11 | Lines,
12 |
13 | ///
14 | /// Outputs the full area displayed within the drawing view.
15 | ///
16 | FullCanvas
17 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Primitives/ExpandDirection.shared.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Core;
2 |
3 | ///
4 | /// Direction of expansion
5 | ///
6 | public enum ExpandDirection
7 | {
8 | ///
9 | /// Expander expands down
10 | ///
11 | Down,
12 |
13 | ///
14 | /// Expander expands up
15 | ///
16 | Up
17 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Primitives/ExpandedChangedEventArgs.shared.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Core;
2 |
3 | ///
4 | /// Contains Expander IsExpanded state.
5 | ///
6 | ///
7 | /// Initialize a new instance of
8 | ///
9 | public class ExpandedChangedEventArgs(bool isExpanded) : EventArgs
10 | {
11 | ///
12 | /// True if Is Expanded.
13 | ///
14 | public bool IsExpanded { get; } = isExpanded;
15 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Primitives/Folder.shared.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Core.Primitives;
2 |
3 | ///
4 | /// Represents a folder in the file system.
5 | ///
6 | /// Folder path.
7 | /// Folder name.
8 | public record Folder(string Path, string Name);
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Primitives/HoverState.shared.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Core;
2 |
3 | ///
4 | ///
5 | ///
6 | public enum HoverState
7 | {
8 | ///
9 | /// The pointer is not over the element.
10 | ///
11 | Default,
12 | ///
13 | /// The pointer is over the element.
14 | ///
15 | Hovered
16 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Primitives/HoverStateChangedEventArgs.shared.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Core;
2 |
3 | ///
4 | ///
5 | ///
6 | public class HoverStateChangedEventArgs(HoverState state) : EventArgs
7 | {
8 | ///
9 | /// Gets the new of the element.
10 | ///
11 | public HoverState State { get; } = state;
12 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Primitives/HoverStatus.shared.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Core;
2 |
3 | ///
4 | ///
5 | ///
6 | public enum HoverStatus
7 | {
8 | ///
9 | /// The pointer has entered the element.
10 | ///
11 | Entered,
12 | ///
13 | /// The pointer has exited the element.
14 | ///
15 | Exited
16 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Primitives/HoverStatusChangedEventArgs.shared.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Core;
2 |
3 | ///
4 | ///
5 | ///
6 | public class HoverStatusChangedEventArgs(HoverStatus status) : EventArgs
7 | {
8 | ///
9 | /// Gets the new of the element.
10 | ///
11 | public HoverStatus Status { get; } = status;
12 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Primitives/LongPressCompletedEventArgs.shared.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Core;
2 |
3 | ///
4 | ///
5 | ///
6 | public class LongPressCompletedEventArgs(object? longPressCommandParameter) : EventArgs
7 | {
8 | ///
9 | /// Parameter
10 | ///
11 | public object? LongPressCommandParameter { get; } = longPressCommandParameter;
12 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Primitives/MauiDrawingLineCompletedEventArgs.shared.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Core.Views;
2 |
3 | namespace CommunityToolkit.Maui.Core;
4 |
5 | ///
6 | /// Contains last drawing line
7 | ///
8 | ///
9 | /// Initializes last drawing line
10 | ///
11 | /// Last drawing line
12 | public class MauiDrawingLineCompletedEventArgs(MauiDrawingLine line) : EventArgs
13 | {
14 | ///
15 | /// Last drawing line
16 | ///
17 | public MauiDrawingLine Line { get; } = line;
18 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Primitives/MauiDrawingStartedEventArgs.shared.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Core;
2 |
3 | ///
4 | /// Contains last drawing point
5 | ///
6 | ///
7 | /// Initializes last drawing point
8 | ///
9 | /// Last drawing point
10 | public class MauiDrawingStartedEventArgs(PointF point) : EventArgs
11 | {
12 | ///
13 | /// Last drawing point
14 | ///
15 | public PointF Point { get; } = point;
16 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Primitives/MauiOnDrawingEventArgs.shared.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Core;
2 |
3 | ///
4 | /// Contains last drawing point
5 | ///
6 | ///
7 | /// Initializes last drawing point
8 | ///
9 | /// Last drawing point
10 | public class MauiOnDrawingEventArgs(PointF point) : EventArgs
11 | {
12 | ///
13 | /// Last drawing point
14 | ///
15 | public PointF Point { get; } = point;
16 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Primitives/NavigationBarStyle.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Core;
2 |
3 | ///
4 | /// Represents the style of the navigation bar on Android.
5 | ///
6 | public enum NavigationBarStyle
7 | {
8 | ///
9 | /// The default navigation bar style.
10 | ///
11 | Default = 0,
12 |
13 | ///
14 | /// The light content navigation bar style.
15 | ///
16 | LightContent = 1,
17 |
18 | ///
19 | /// The dark content navigation bar style.
20 | ///
21 | DarkContent = 2
22 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Primitives/PointDrawnEventArgs.shared.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Core;
2 |
3 | ///
4 | /// Contains last drawing point
5 | ///
6 | ///
7 | /// Initialize a new instance of
8 | ///
9 | ///
10 | public class PointDrawnEventArgs(PointF point) : EventArgs
11 | {
12 | ///
13 | /// Last drawing point
14 | ///
15 | public PointF Point { get; } = point;
16 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Primitives/RatingChangedEventArgs.shared.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Core;
2 |
3 | /// Event args containing all contextual information related to rating changed event.
4 | /// The new rating value.
5 | public class RatingChangedEventArgs(double rating) : EventArgs
6 | {
7 | /// Gets the rating for the rating changed event.
8 | public double Rating { get; } = rating;
9 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Primitives/RatingViewFillOption.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Core;
2 |
3 | /// RatingView selection determining which element of the RatingView Shape to fill when tapped
4 | public enum RatingViewFillOption
5 | {
6 | /// Fill the RatingView shape
7 | Shape,
8 |
9 | /// Fill the background behind the RatingView shape
10 | Background
11 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Primitives/RatingViewShapes.shared.cs:
--------------------------------------------------------------------------------
1 | // Ignore Spelling: color
2 | namespace CommunityToolkit.Maui.Core;
3 |
4 | /// Rating view shape enumerator.
5 | public enum RatingViewShape
6 | {
7 | /// A star rating shape.
8 | Star,
9 |
10 | /// A heart rating shape.
11 | Heart,
12 |
13 | /// A circle rating shape.
14 | Circle,
15 |
16 | /// A like/thumbs up rating shape.
17 | Like,
18 |
19 | /// A dislike/thumbs down rating shape.
20 | Dislike,
21 |
22 | /// A custom rating shape.
23 | Custom
24 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Primitives/StatusBarStyle.shared.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Core;
2 |
3 | ///
4 | /// Enum that represents the possible style values for the device
5 | ///
6 | public enum StatusBarStyle
7 | {
8 | ///
9 | /// The default style value
10 | ///
11 | Default = 0,
12 | ///
13 | /// Light style value
14 | ///
15 | LightContent = 1,
16 | ///
17 | /// Dark style value
18 | ///
19 | DarkContent = 2
20 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Primitives/TouchCompletedEventArgs.shared.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Core;
2 |
3 | ///
4 | ///
5 | ///
6 | public class TouchGestureCompletedEventArgs(object? touchCommandParameter) : EventArgs
7 | {
8 | ///
9 | /// Gets the parameter associated with the touch event.
10 | ///
11 | public object? TouchCommandParameter { get; } = touchCommandParameter;
12 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Primitives/TouchInteractionStatus.shared.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Core;
2 |
3 | ///
4 | ///
5 | ///
6 | public enum TouchInteractionStatus
7 | {
8 | ///
9 | /// The touch interaction has started.
10 | ///
11 | Started,
12 |
13 | ///
14 | /// The touch interaction has completed.
15 | ///
16 | Completed
17 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Primitives/TouchInteractionStatusChangedEventArgs.shared.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Core;
2 |
3 | ///
4 | ///
5 | ///
6 | public class TouchInteractionStatusChangedEventArgs(TouchInteractionStatus touchInteractionStatus) : EventArgs
7 | {
8 | ///
9 | /// Gets the current touch interaction status.
10 | ///
11 | public TouchInteractionStatus TouchInteractionStatus { get; } = touchInteractionStatus;
12 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Primitives/TouchState.shared.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Core;
2 |
3 | ///
4 | ///
5 | ///
6 | public enum TouchState
7 | {
8 | ///
9 | /// The pointer is not over the element.
10 | ///
11 | Default,
12 |
13 | ///
14 | /// The pointer is over the element.
15 | ///
16 | Pressed
17 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Primitives/TouchStateChangedEventArgs.shared.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Core;
2 |
3 | ///
4 | ///
5 | ///
6 | public class TouchStateChangedEventArgs(TouchState state) : EventArgs
7 | {
8 | ///
9 | /// Gets the current state of the touch event.
10 | ///
11 | public TouchState State { get; } = state;
12 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Primitives/TouchStatus.shared.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Core;
2 |
3 | ///
4 | ///
5 | ///
6 | public enum TouchStatus
7 | {
8 | ///
9 | /// The touch interaction has started.
10 | ///
11 | Started,
12 |
13 | ///
14 | /// The touch interaction has completed.
15 | ///
16 | Completed,
17 |
18 | ///
19 | /// The touch interaction has been canceled.
20 | ///
21 | Canceled
22 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Primitives/TouchStatusChangedEventArgs.shared.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Core;
2 |
3 | ///
4 | ///
5 | ///
6 | public class TouchStatusChangedEventArgs(TouchStatus status) : EventArgs
7 | {
8 | ///
9 | /// Gets the current touch status.
10 | ///
11 | public TouchStatus Status { get; } = status;
12 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/Services/DialogFragmentService.shared.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel;
2 | using System.Runtime.Versioning;
3 |
4 | namespace CommunityToolkit.Maui.Core.Services;
5 |
6 | ///
7 | /// An Android-specific service to support on modal pages
8 | ///
9 | [EditorBrowsable(EditorBrowsableState.Never)]
10 | [SupportedOSPlatform("Android")]
11 | public sealed partial class DialogFragmentService
12 | {
13 |
14 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Core/readme.txt:
--------------------------------------------------------------------------------
1 | .NET MAUI Community Toolkit
2 |
3 | ## Initializing
4 |
5 | In order to use the .NET MAUI Community Toolkit you need to call the extension method in your `MauiProgram.cs` file as follows:
6 |
7 | ```csharp
8 | using CommunityToolkit.Maui.Core;
9 |
10 | public static MauiApp CreateMauiApp()
11 | {
12 | var builder = MauiApp.CreateBuilder();
13 |
14 | // Initialise the toolkit
15 | builder.UseMauiApp().UseMauiCommunityToolkitCore();
16 |
17 | // the rest of your logic...
18 | }
19 | ```
20 |
21 | ## Further information
22 |
23 | For more information please visit:
24 |
25 | - Our documentation site: https://docs.microsoft.com/dotnet/communitytoolkit/maui
26 |
27 | - Our GitHub repository: https://github.com/CommunityToolkit/Maui
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Maps/Handler/Map/Bounds.shared.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Maps.Handlers;
2 |
3 | class Bounds
4 | {
5 | public Center? Center { get; set; }
6 | public double Width { get; set; }
7 | public double Height { get; set; }
8 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Maps/Handler/Map/Center.shared.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Maps.Handlers;
2 |
3 | class Center
4 | {
5 | public double Latitude { get; set; }
6 | public double Longitude { get; set; }
7 | public int Altitude { get; set; }
8 | public int AltitudeReference { get; set; }
9 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Maps/Handler/Map/EventIdentifier.shared.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Maps.Handlers;
2 |
3 | enum EventIdentifier
4 | {
5 | Unknown,
6 | InfoWindowClicked,
7 | BoundsChanged,
8 | MapClicked,
9 | PinClicked,
10 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Maps/Handler/Map/EventMessage.shared.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Maps.Handlers;
2 |
3 | class EventMessage
4 | {
5 | public string Id { get; set; } = string.Empty;
6 |
7 | public object? Payload { get; set; }
8 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Maps/Handler/Map/InfoWindow.shared.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Maps.Handlers;
2 |
3 | class InfoWindow
4 | {
5 | public string InfoWindowMarkerId { get; set; } = string.Empty;
6 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.Maps/Handler/Map/SerializerContext.shared.cs:
--------------------------------------------------------------------------------
1 | using System.Text.Json.Serialization;
2 | using Microsoft.Maui.Controls.Maps;
3 |
4 | namespace CommunityToolkit.Maui.Maps.Handlers;
5 |
6 | [JsonSourceGenerationOptions(PropertyNameCaseInsensitive = true)]
7 | [JsonSerializable(typeof(EventMessage))]
8 | [JsonSerializable(typeof(Pin))]
9 | [JsonSerializable(typeof(Location))]
10 | [JsonSerializable(typeof(Bounds))]
11 | [JsonSerializable(typeof(InfoWindow))]
12 | sealed partial class SerializerContext : JsonSerializerContext;
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.MediaElement.Analyzers.CodeFixes/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | [assembly: System.Resources.NeutralResourcesLanguage("en")]
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.MediaElement.Analyzers/AnalyzerReleases.Shipped.md:
--------------------------------------------------------------------------------
1 | ## Release 1.0.0
2 |
3 | ### New Rules
4 |
5 | Rule ID | Category | Severity | Notes
6 | --------|----------|----------|--------------------
7 | MCTME001| Usage | Error | `.UseMauiCommunityToolkitMediaElement()` Not Found on MauiAppBuilder
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.MediaElement.Analyzers/AnalyzerReleases.Unshipped.md:
--------------------------------------------------------------------------------
1 | ### New Rules
2 |
3 | Rule ID | Category | Severity | Notes
4 | --------|----------|----------|--------------------
5 |
6 | ### Changed Rules
7 |
8 | Rule ID | New Category | New Severity | Old Category | Old Severity | Notes
9 | --------|--------------|--------------|--------------|--------------|-------
10 | MCTME001 | Initialization | Error | Usage | Error | UseCommunityToolkitMediaElementInitializationAnalyzer
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.MediaElement.Analyzers/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | [assembly: System.Resources.NeutralResourcesLanguage("en")]
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.MediaElement/Interfaces/IAsynchronousMediaElementHandler.shared.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Core;
2 |
3 | ///
4 | /// Interface that allows asynchronous completion of .NET MAUI Handlers
5 | ///
6 | public interface IAsynchronousMediaElementHandler
7 | {
8 | ///
9 | /// A to provide Handlers an asynchronous way to complete
10 | ///
11 | TaskCompletionSource SeekCompletedTCS { get; }
12 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.MediaElement/Platforms/Android/Resources/layout/textureview.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.MediaElement/Primitives/AndroidViewType.shared.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Views;
2 |
3 | namespace CommunityToolkit.Maui.Core;
4 |
5 | ///
6 | /// Enum for view type on Android
7 | ///
8 | public enum AndroidViewType
9 | {
10 | ///
11 | /// Create MediaElement on Android using SurfaceView
12 | ///
13 | SurfaceView,
14 |
15 | ///
16 | /// Create MediaElement on Android using TextureView
17 | ///
18 | TextureView
19 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.MediaElement/Primitives/MediaFailedEventArgs.shared.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Core;
2 |
3 | ///
4 | /// Represents event data for when media has failed loading or playing.
5 | ///
6 | ///
7 | /// Initializes a new instance of the class.
8 | ///
9 | /// An error message providing more information for this event.
10 | public sealed class MediaFailedEventArgs(string errorMessage) : EventArgs
11 | {
12 | ///
13 | /// Gets a description of why the media failed to load and/or play.
14 | ///
15 | public string ErrorMessage { get; } = errorMessage;
16 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.MediaElement/Primitives/MediaPositionChangedEventArgs.shared.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Core;
2 |
3 | ///
4 | /// Represents event data for when media position has changed.
5 | ///
6 | ///
7 | /// Initializes a new instance of the class.
8 | ///
9 | /// The position associated to this event.
10 | public sealed class MediaPositionChangedEventArgs(TimeSpan position) : EventArgs
11 | {
12 | ///
13 | /// Gets the position the media has progressed to.
14 | ///
15 | public TimeSpan Position { get; } = position;
16 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.MediaElement/Primitives/PlayerViewChangedEventArgs.android.cs:
--------------------------------------------------------------------------------
1 | using AndroidX.Media3.UI;
2 |
3 | namespace CommunityToolkit.Maui.Core;
4 |
5 | public sealed class PlayerViewChangedEventArgs(PlayerView playerView) : EventArgs
6 | {
7 | public PlayerView UpdatedPlayerView { get; } = playerView;
8 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.MediaElement/Primitives/SeekRequestedEventArgs.shared.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.Core;
2 |
3 | ///
4 | /// Represents event data for when a seek operation is requested on media.
5 | ///
6 | ///
7 | /// Initializes a new instance of the class.
8 | ///
9 | /// The requested position to seek to.
10 | sealed class MediaSeekRequestedEventArgs(TimeSpan requestedPosition) : EventArgs
11 | {
12 | ///
13 | /// Gets the requested position to seek to.
14 | ///
15 | public TimeSpan RequestedPosition { get; } = requestedPosition;
16 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.MediaElement/Services/BoundServiceBinder.android.cs:
--------------------------------------------------------------------------------
1 | using Android.OS;
2 | using CommunityToolkit.Maui.Media.Services;
3 |
4 | namespace CommunityToolkit.Maui.Services;
5 |
6 | sealed class BoundServiceBinder(MediaControlsService mediaControlsService) : Binder
7 | {
8 | public MediaControlsService Service { get; } = mediaControlsService;
9 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.SourceGenerators.Internal/AnalyzerReleases.Shipped.md:
--------------------------------------------------------------------------------
1 | ## Release 1.0.0
2 |
3 | ### New Rules
4 |
5 | Rule ID | Category | Severity | Notes
6 | --------|----------|----------|-----------------------------------------------------
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.SourceGenerators.Internal/AnalyzerReleases.Unshipped.md:
--------------------------------------------------------------------------------
1 | ### New Rules
2 |
3 | Rule ID | Category | Severity | Notes
4 | --------|----------|----------|--------------------
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.SourceGenerators/AnalyzerReleases.Unshipped.md:
--------------------------------------------------------------------------------
1 | ### New Rules
2 |
3 | Rule ID | Category | Severity | Notes
4 | --------|----------|----------|--------------------
5 |
6 | ### Changed Rules
7 |
8 | Rule ID | New Category | New Severity | Old Category | Old Severity | Notes
9 | --------|--------------|--------------|--------------|--------------|-------
10 | MCTSG001 | TextColorTo | Warning | Usage | Warning | TextColorToDiagnostic
11 | MCTSG002 | TextColorTo | Error | Usage | Error | TextColorToDiagnostic
12 | MCTSG003 | TextColorTo | Info | Usage | Info | TextColorToDiagnostic
13 | MCTSG004 | TextColorTo | Info | Usage | Info | TextColorToDiagnostic
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.SourceGenerators/CommunityToolkit.Maui.SourceGenerators.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netstandard2.0
5 | false
6 | true
7 |
8 |
9 | true
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.SourceGenerators/Extensions/CompilationExtensions.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.CodeAnalysis;
2 | using Microsoft.CodeAnalysis.CSharp.Syntax;
3 |
4 | namespace CommunityToolkit.Maui.SourceGenerators.Extensions;
5 |
6 | static class CompilationExtensions
7 | {
8 | public static TSymbol? GetSymbol(this Compilation compilation, BaseTypeDeclarationSyntax declarationSyntax)
9 | where TSymbol : ISymbol
10 | {
11 | var model = compilation.GetSemanticModel(declarationSyntax.SyntaxTree);
12 | return (TSymbol?)model.GetDeclaredSymbol(declarationSyntax);
13 | }
14 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.SourceGenerators/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "profiles": {
3 | "CommunityToolkit.Maui.SourceGenerators": {
4 | "commandName": "DebugRoslynComponent",
5 | "targetProject": "..\\CommunityToolkit.Maui.UnitTests\\CommunityToolkit.Maui.UnitTests.csproj"
6 | }
7 | }
8 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.SourceGenerators/Services/SourceStringService.cs:
--------------------------------------------------------------------------------
1 | using System.Text;
2 | using Microsoft.CodeAnalysis;
3 | using Microsoft.CodeAnalysis.CSharp;
4 | using Microsoft.CodeAnalysis.Text;
5 |
6 | namespace CommunityToolkit.Maui.SourceGenerators.Helpers;
7 |
8 | static class SourceStringService
9 | {
10 | public static void FormatText(ref string classSource, CSharpParseOptions? options = null)
11 | {
12 | options ??= CSharpParseOptions.Default;
13 |
14 | var sourceCode = CSharpSyntaxTree.ParseText(SourceText.From(classSource, Encoding.UTF8), options);
15 | var formattedRoot = (CSharpSyntaxNode)sourceCode.GetRoot().NormalizeWhitespace();
16 | classSource = CSharpSyntaxTree.Create(formattedRoot).ToString();
17 | }
18 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.UnitTests/Essentials/BadgeTests.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.ApplicationModel;
2 | using CommunityToolkit.Maui.UnitTests.Mocks;
3 | using FluentAssertions;
4 | using Xunit;
5 |
6 | namespace CommunityToolkit.Maui.UnitTests.Essentials;
7 |
8 | public class BadgeTests : BaseTest
9 | {
10 | [Fact]
11 | public void BadgeTestsSetDefaultUpdatesInstance()
12 | {
13 | var badgeImplementationMock = new BadgeImplementationMock();
14 | Badge.SetDefault(badgeImplementationMock);
15 | var badge = Badge.Default;
16 | badge.Should().BeSameAs(badgeImplementationMock);
17 | }
18 |
19 | [Fact]
20 | public void SetBadgeFailsOnNet()
21 | {
22 | Badge.SetDefault(new BadgeImplementation());
23 | Assert.Throws(() => Badge.SetCount(1));
24 | }
25 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.UnitTests/Extensions/MathExtensionsTests.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Core.Extensions;
2 | using Xunit;
3 | namespace CommunityToolkit.Maui.UnitTests.Extensions;
4 |
5 | public class MathExtensionsTests : BaseTest
6 | {
7 | [Theory]
8 | [InlineData(0.0, true)]
9 | [InlineData(double.NaN, true)]
10 | [InlineData(100.0, false)]
11 | [InlineData(0.001, false)]
12 | public void CheckIfNumberIsNaNOrZero(double number, bool expected)
13 | {
14 | var result = number.IsZeroOrNaN();
15 | Assert.Equal(expected, result);
16 | }
17 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.UnitTests/GlobalUsings.cs:
--------------------------------------------------------------------------------
1 | using Xunit;
2 |
3 | [assembly: CollectionBehavior(CollectionBehavior.CollectionPerAssembly, DisableTestParallelization = true, MaxParallelThreads = 1)]
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.UnitTests/Mocks/BadgeImplementationMock.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.ApplicationModel;
2 |
3 | namespace CommunityToolkit.Maui.UnitTests.Mocks;
4 |
5 | class BadgeImplementationMock : IBadge
6 | {
7 | public void SetCount(uint count)
8 | {
9 | throw new NotImplementedException();
10 | }
11 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.UnitTests/Mocks/HandlersContextStub.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.UnitTests.Mocks;
2 |
3 | class HandlersContextStub : IMauiContext
4 | {
5 | public HandlersContextStub(IServiceProvider services)
6 | {
7 | Services = services;
8 | Handlers = Services.GetRequiredService();
9 | }
10 |
11 | public IServiceProvider Services { get; }
12 |
13 | public IMauiHandlersFactory Handlers { get; }
14 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.UnitTests/Mocks/MockAppInfo.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.UnitTests.Mocks;
2 |
3 | public class MockAppInfo : IAppInfo
4 | {
5 | public string PackageName { get; set; } = string.Empty;
6 |
7 | public string Name { get; set; } = string.Empty;
8 |
9 | public string VersionString { get; set; } = string.Empty;
10 |
11 | public string BuildString { get; set; } = string.Empty;
12 |
13 | public Version Version { get; set; } = new Version(1, 0);
14 |
15 | public LayoutDirection RequestedLayoutDirection { get; set; }
16 |
17 | public AppTheme RequestedTheme { get; set; }
18 |
19 | public AppPackagingModel PackagingModel { get; set; }
20 |
21 | public void ShowSettingsUI()
22 | {
23 | }
24 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.UnitTests/Mocks/MockCameraProvider.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Core;
2 | using CommunityToolkit.Maui.Core.Primitives;
3 |
4 | namespace CommunityToolkit.Maui.UnitTests.Mocks;
5 |
6 | public class MockCameraProvider : ICameraProvider
7 | {
8 | public IReadOnlyList? AvailableCameras { get; private set; }
9 |
10 | public ValueTask RefreshAvailableCameras(CancellationToken token)
11 | {
12 | AvailableCameras =
13 | [
14 | new CameraInfo("Test Camera",
15 | Guid.NewGuid().ToString(),
16 | CameraPosition.Front,
17 | false,
18 | 1.0f,
19 | 5.0f,
20 | [
21 | new Size(1920, 1080)
22 | ])
23 | ];
24 |
25 | return ValueTask.CompletedTask;
26 | }
27 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.UnitTests/Mocks/MockDispatcherProvider.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.UnitTests.Mocks;
2 |
3 | // Inspired by https://github.com/dotnet/maui/blob/main/src/Core/tests/UnitTests/TestClasses/DispatcherStub.cs
4 | sealed class MockDispatcherProvider : IDispatcherProvider, IDisposable
5 | {
6 | static readonly MockDispatcher dispatcherMock = new();
7 |
8 | readonly ThreadLocal dispatcherInstance = new(() => dispatcherMock);
9 |
10 | public IDispatcher GetForCurrentThread() => dispatcherInstance.Value ?? throw new InvalidOperationException();
11 |
12 | void IDisposable.Dispose() => dispatcherInstance.Dispose();
13 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.UnitTests/Mocks/MockOneWayConverter.cs:
--------------------------------------------------------------------------------
1 | using System.Globalization;
2 | using CommunityToolkit.Maui.Converters;
3 |
4 | namespace CommunityToolkit.Maui.UnitTests.Mocks;
5 |
6 | public class MockOneWayConverter(string[] quotes) : BaseConverterOneWay
7 | {
8 | public override string DefaultConvertReturnValue { get; set; } = string.Empty;
9 |
10 | public override string ConvertFrom(int value, CultureInfo? culture)
11 | {
12 | return value < quotes.Length ? quotes[value] : DefaultConvertReturnValue;
13 | }
14 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.UnitTests/Mocks/MockPage.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.UnitTests.Mocks;
2 |
3 | class MockPage : ContentPage
4 | {
5 | public MockPage(MockPageViewModel viewModel)
6 | {
7 | BindingContext = viewModel;
8 | }
9 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.UnitTests/Mocks/MockPageHandler.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Maui.Handlers;
2 |
3 | namespace CommunityToolkit.Maui.UnitTests.Mocks;
4 |
5 | public class MockPageHandler : ViewHandler
6 | {
7 | public MockPageHandler() : base(new PropertyMapper())
8 | {
9 |
10 | }
11 |
12 |
13 | public MockPageHandler(IPropertyMapper mapper) : base(mapper)
14 | {
15 |
16 | }
17 |
18 | protected override object CreatePlatformView()
19 | {
20 | return new object();
21 | }
22 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.UnitTests/Mocks/MockPageRouteFactory.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.UnitTests.Mocks;
2 |
3 | public class MockPageRouteFactory : RouteFactory
4 | {
5 | public bool WasInvoked { get; set; }
6 |
7 | public override Element GetOrCreate()
8 | {
9 | return new Page();
10 | }
11 |
12 | public override Element GetOrCreate(IServiceProvider services)
13 | {
14 | WasInvoked = true;
15 | return services.GetService() ?? throw new InvalidOperationException($"{nameof(MockPage)} has not been added to `IServiceCollection`");
16 | }
17 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.UnitTests/Mocks/MockPageViewModel.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Maui.Core;
2 |
3 | namespace CommunityToolkit.Maui.UnitTests.Mocks;
4 |
5 | public class MockPageViewModel : BindableObject
6 | {
7 | public bool HasLoaded { get; set; }
8 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.UnitTests/Mocks/MockResourceManager.cs:
--------------------------------------------------------------------------------
1 | using System.Globalization;
2 | using System.Resources;
3 |
4 | namespace CommunityToolkit.Maui.UnitTests.Mocks;
5 |
6 | public class MockResourceManager : ResourceManager
7 | {
8 | public override string GetString(string name, CultureInfo? culture) => culture?.EnglishName ?? string.Empty;
9 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.UnitTests/Mocks/MockResourcesProvider.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Maui.Controls.Internals;
2 | namespace CommunityToolkit.Maui.UnitTests.Mocks;
3 |
4 | // Inspired by https://github.com/dotnet/maui/blob/79695fbb7ba6517a334c795ecf0a1d6358ef309a/src/Controls/Foldable/test/MockPlatformServices.cs#L145-L176
5 |
6 | #pragma warning disable CS0612 // Type or member is obsolete
7 | class MockResourcesProvider : ISystemResourcesProvider
8 | #pragma warning restore CS0612 // Type or member is obsolete
9 | {
10 | readonly ResourceDictionary dictionary = [];
11 |
12 | public IResourceDictionary GetSystemResources() => dictionary;
13 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.UnitTests/Mocks/MockShell.cs:
--------------------------------------------------------------------------------
1 | namespace CommunityToolkit.Maui.UnitTests.Mocks;
2 |
3 | public class MockShell : Shell
4 | {
5 | public MockShell(List shellPages)
6 | {
7 | foreach (var page in shellPages)
8 | {
9 | Items.Add(page);
10 | }
11 | }
12 | }
--------------------------------------------------------------------------------
/src/CommunityToolkit.Maui.UnitTests/Mocks/MockValueConverter.cs:
--------------------------------------------------------------------------------
1 | using System.Globalization;
2 |
3 | namespace CommunityToolkit.Maui.UnitTests.Mocks;
4 |
5 | class MockValueConverter : IValueConverter
6 | {
7 | readonly Func