├── .github └── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── .gitignore ├── CraftUI.sln ├── README.md ├── global.json └── src ├── CraftUI.Demo.Application ├── Cities │ └── CityVm.cs ├── Common │ ├── Interfaces │ │ ├── Infrastructure │ │ │ ├── IDisplayService.cs │ │ │ ├── INavigationService.cs │ │ │ └── IToastService.cs │ │ └── Services │ │ │ ├── ICityService.cs │ │ │ └── ICountryService.cs │ └── LinkMenuItem.cs ├── Countries │ └── CountryVm.cs └── CraftUI.Demo.Application.csproj ├── CraftUI.Demo.Infrastructure ├── CraftUI.Demo.Infrastructure.csproj ├── DependencyInjection.cs ├── Displays │ └── DisplayService.cs ├── Navigation │ └── NavigationService.cs └── Toasts │ └── ToastService.cs ├── CraftUI.Demo.Services ├── Cities │ └── CityService.cs ├── Countries │ └── CountryService.cs ├── CraftUI.Demo.Services.csproj └── DependencyInjection.cs ├── CraftUI.Demo ├── App.xaml ├── App.xaml.cs ├── AppShell.xaml ├── AppShell.xaml.cs ├── CraftUI.Demo.csproj ├── MauiProgram.cs ├── Platforms │ ├── Android │ │ ├── AndroidManifest.xml │ │ ├── MainActivity.cs │ │ ├── MainApplication.cs │ │ └── Resources │ │ │ └── values │ │ │ └── colors.xml │ ├── MacCatalyst │ │ ├── AppDelegate.cs │ │ ├── Entitlements.plist │ │ ├── Info.plist │ │ └── Program.cs │ ├── Windows │ │ ├── App.xaml │ │ ├── App.xaml.cs │ │ ├── Package.appxmanifest │ │ └── app.manifest │ └── iOS │ │ ├── AppDelegate.cs │ │ ├── Info.plist │ │ └── Program.cs ├── Presentation │ ├── Common │ │ ├── ContentPageBase.cs │ │ ├── RouteConstants.cs │ │ └── ViewModelBase.cs │ └── Pages │ │ ├── Controls │ │ ├── Buttons │ │ │ ├── ButtonPage.xaml │ │ │ ├── ButtonPage.xaml.cs │ │ │ └── ButtonPageViewModel.cs │ │ ├── ControlsList.xaml │ │ ├── ControlsList.xaml.cs │ │ ├── ControlsListViewModel.cs │ │ ├── DatePickers │ │ │ ├── DatePickerPage.xaml │ │ │ ├── DatePickerPage.xaml.cs │ │ │ └── DatePickerPageViewModel.cs │ │ ├── Entries │ │ │ ├── EntryPage.xaml │ │ │ ├── EntryPage.xaml.cs │ │ │ ├── EntryPageViewModel.cs │ │ │ └── EntryPageViewModelValidator.cs │ │ ├── Pickers │ │ │ ├── MultiPickerPopupPage.xaml │ │ │ ├── MultiPickerPopupPage.xaml.cs │ │ │ ├── PickerPage.xaml │ │ │ ├── PickerPage.xaml.cs │ │ │ ├── PickerPageViewModel.cs │ │ │ ├── PickerPopupPage.xaml │ │ │ └── PickerPopupPage.xaml.cs │ │ └── ProgressBars │ │ │ ├── ProgressBarPage.xaml │ │ │ ├── ProgressBarPage.xaml.cs │ │ │ └── ProgressBarPageViewModel.cs │ │ ├── Settings │ │ ├── SettingsPage.xaml │ │ ├── SettingsPage.xaml.cs │ │ └── SettingsPageViewModel.cs │ │ └── UseCases │ │ ├── UseCasesList.xaml │ │ ├── UseCasesList.xaml.cs │ │ └── UseCasesListViewModel.cs ├── Properties │ └── launchSettings.json └── Resources │ ├── AppIcon │ ├── appicon.svg │ └── appiconfg.svg │ ├── Fonts │ ├── OpenSans-Regular.ttf │ └── OpenSans-Semibold.ttf │ ├── Images │ ├── chevron_bottom.svg │ ├── close.svg │ ├── demo_code.svg │ ├── demo_cog.svg │ ├── demo_date_picker.svg │ ├── demo_hand_click.svg │ ├── demo_info.svg │ ├── demo_input.svg │ ├── demo_new_window.svg │ ├── demo_picker.svg │ ├── demo_progress_bar.svg │ ├── demo_use_cases.svg │ └── demo_work_in_progress.svg │ ├── Raw │ └── AboutAssets.txt │ ├── Splash │ └── splash.svg │ └── Styles │ ├── Buttons.xaml │ ├── Colors.xaml │ ├── CustomControls.xaml │ ├── Layouts.xaml │ └── Styles.xaml └── CraftUI.Library.Maui ├── Common ├── Extensions │ ├── BaseLabelExtension.cs │ └── ObjectExtension.cs ├── Helpers │ ├── ResourceHelper.cs │ └── ViewHelper.cs ├── LabelBase.xaml ├── LabelBase.xaml.cs └── Resources │ └── ColorResources.cs ├── Controls ├── CfButton.xaml ├── CfButton.xaml.cs ├── CfDatePicker.xaml ├── CfDatePicker.xaml.cs ├── CfDatePickerInternal.cs ├── CfEntry.xaml ├── CfEntry.xaml.cs ├── CfMultiPickerPopup.xaml ├── CfMultiPickerPopup.xaml.cs ├── CfPicker.xaml ├── CfPicker.xaml.cs ├── CfPickerPopup.xaml ├── CfPickerPopup.xaml.cs ├── Popups │ ├── CfCollectionMultiSelectionPopup.xaml │ ├── CfCollectionMultiSelectionPopup.xaml.cs │ ├── CfCollectionSingleSelectionPopup.xaml │ └── CfCollectionSingleSelectionPopup.xaml.cs └── ProgressBars │ ├── CfProgressBar.cs │ └── CfProgressBarHandler.cs ├── Converters ├── SelectedItemsContainsConverter.cs └── ShowErrorConverter.cs ├── CraftUI.Library.Maui.csproj ├── DependencyInjection.cs └── MarkupExtensions └── GutterMarkupExtension.cs /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please complete the following information):** 27 | - OS: [e.g. iOS] 28 | - Browser [e.g. chrome, safari] 29 | - Version [e.g. 22] 30 | 31 | **Smartphone (please complete the following information):** 32 | - Device: [e.g. iPhone6] 33 | - OS: [e.g. iOS8.1] 34 | - Browser [e.g. stock browser, safari] 35 | - Version [e.g. 22] 36 | 37 | **Additional context** 38 | Add any other context about the problem here. 39 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /CraftUI.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CraftUI.Demo", "src\CraftUI.Demo\CraftUI.Demo.csproj", "{350C190D-BE1F-4998-B849-47C79B8407E4}" 4 | EndProject 5 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CraftUI.Library.Maui", "src\CraftUI.Library.Maui\CraftUI.Library.Maui.csproj", "{050FEBD3-B53F-414B-9AFC-5E5C2F202858}" 6 | EndProject 7 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CraftUI.Demo.Application", "src\CraftUI.Demo.Application\CraftUI.Demo.Application.csproj", "{91F72502-ADC1-499A-B8C4-712FA1E3D726}" 8 | EndProject 9 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CraftUI.Demo.Infrastructure", "src\CraftUI.Demo.Infrastructure\CraftUI.Demo.Infrastructure.csproj", "{E542540F-7368-41DA-AD64-C1AA5568ECED}" 10 | EndProject 11 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CraftUI.Demo.Services", "src\CraftUI.Demo.Services\CraftUI.Demo.Services.csproj", "{21809B72-515E-40C7-B850-B43FB95B397F}" 12 | EndProject 13 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{94BD610A-F683-4377-AEB4-5434EFB981A5}" 14 | EndProject 15 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "demo", "demo", "{FA8E676E-4901-48EB-A97F-57B761D60841}" 16 | EndProject 17 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "library", "library", "{62919E63-BA59-40EC-ABA2-42D6BA079954}" 18 | EndProject 19 | Global 20 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 21 | Debug|Any CPU = Debug|Any CPU 22 | Release|Any CPU = Release|Any CPU 23 | EndGlobalSection 24 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 25 | {350C190D-BE1F-4998-B849-47C79B8407E4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 26 | {350C190D-BE1F-4998-B849-47C79B8407E4}.Debug|Any CPU.Build.0 = Debug|Any CPU 27 | {350C190D-BE1F-4998-B849-47C79B8407E4}.Release|Any CPU.ActiveCfg = Release|Any CPU 28 | {350C190D-BE1F-4998-B849-47C79B8407E4}.Release|Any CPU.Build.0 = Release|Any CPU 29 | {350C190D-BE1F-4998-B849-47C79B8407E4}.Debug|Any CPU.Deploy.0 = Debug|Any CPU 30 | {050FEBD3-B53F-414B-9AFC-5E5C2F202858}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 31 | {050FEBD3-B53F-414B-9AFC-5E5C2F202858}.Debug|Any CPU.Build.0 = Debug|Any CPU 32 | {050FEBD3-B53F-414B-9AFC-5E5C2F202858}.Release|Any CPU.ActiveCfg = Release|Any CPU 33 | {050FEBD3-B53F-414B-9AFC-5E5C2F202858}.Release|Any CPU.Build.0 = Release|Any CPU 34 | {91F72502-ADC1-499A-B8C4-712FA1E3D726}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 35 | {91F72502-ADC1-499A-B8C4-712FA1E3D726}.Debug|Any CPU.Build.0 = Debug|Any CPU 36 | {91F72502-ADC1-499A-B8C4-712FA1E3D726}.Release|Any CPU.ActiveCfg = Release|Any CPU 37 | {91F72502-ADC1-499A-B8C4-712FA1E3D726}.Release|Any CPU.Build.0 = Release|Any CPU 38 | {E542540F-7368-41DA-AD64-C1AA5568ECED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 39 | {E542540F-7368-41DA-AD64-C1AA5568ECED}.Debug|Any CPU.Build.0 = Debug|Any CPU 40 | {E542540F-7368-41DA-AD64-C1AA5568ECED}.Release|Any CPU.ActiveCfg = Release|Any CPU 41 | {E542540F-7368-41DA-AD64-C1AA5568ECED}.Release|Any CPU.Build.0 = Release|Any CPU 42 | {21809B72-515E-40C7-B850-B43FB95B397F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 43 | {21809B72-515E-40C7-B850-B43FB95B397F}.Debug|Any CPU.Build.0 = Debug|Any CPU 44 | {21809B72-515E-40C7-B850-B43FB95B397F}.Release|Any CPU.ActiveCfg = Release|Any CPU 45 | {21809B72-515E-40C7-B850-B43FB95B397F}.Release|Any CPU.Build.0 = Release|Any CPU 46 | EndGlobalSection 47 | GlobalSection(NestedProjects) = preSolution 48 | {FA8E676E-4901-48EB-A97F-57B761D60841} = {94BD610A-F683-4377-AEB4-5434EFB981A5} 49 | {62919E63-BA59-40EC-ABA2-42D6BA079954} = {94BD610A-F683-4377-AEB4-5434EFB981A5} 50 | {350C190D-BE1F-4998-B849-47C79B8407E4} = {FA8E676E-4901-48EB-A97F-57B761D60841} 51 | {91F72502-ADC1-499A-B8C4-712FA1E3D726} = {FA8E676E-4901-48EB-A97F-57B761D60841} 52 | {E542540F-7368-41DA-AD64-C1AA5568ECED} = {FA8E676E-4901-48EB-A97F-57B761D60841} 53 | {21809B72-515E-40C7-B850-B43FB95B397F} = {FA8E676E-4901-48EB-A97F-57B761D60841} 54 | {050FEBD3-B53F-414B-9AFC-5E5C2F202858} = {62919E63-BA59-40EC-ABA2-42D6BA079954} 55 | EndGlobalSection 56 | EndGlobal 57 | -------------------------------------------------------------------------------- /global.json: -------------------------------------------------------------------------------- 1 | { 2 | "sdk": { 3 | "version": "9.0.0", 4 | "rollForward": "latestMajor", 5 | "allowPrerelease": true 6 | } 7 | } -------------------------------------------------------------------------------- /src/CraftUI.Demo.Application/Cities/CityVm.cs: -------------------------------------------------------------------------------- 1 | namespace CraftUI.Demo.Application.Cities; 2 | 3 | public record CityVm(int Id, int CountryId, string Name); 4 | -------------------------------------------------------------------------------- /src/CraftUI.Demo.Application/Common/Interfaces/Infrastructure/IDisplayService.cs: -------------------------------------------------------------------------------- 1 | namespace CraftUI.Demo.Application.Common.Interfaces.Infrastructure; 2 | 3 | public interface IDisplayService 4 | { 5 | Task ShowPopupAsync(string title, string message, string accept = "OK"); 6 | } -------------------------------------------------------------------------------- /src/CraftUI.Demo.Application/Common/Interfaces/Infrastructure/INavigationService.cs: -------------------------------------------------------------------------------- 1 | namespace CraftUI.Demo.Application.Common.Interfaces.Infrastructure; 2 | 3 | public interface INavigationService 4 | { 5 | /// 6 | /// Performs hierarchical navigation to a specific page using a registered navigation route. 7 | /// Can optionally pass named route parameters to be used for processing in the destination page. 8 | /// 9 | /// Name of the page 10 | /// Dictionary of parameters 11 | Task NavigateToAsync(string route, IDictionary? routeParameters = null); 12 | 13 | /// 14 | /// Returns to the previous page in the navigation stack. 15 | /// 16 | Task GoBackAsync(); 17 | } -------------------------------------------------------------------------------- /src/CraftUI.Demo.Application/Common/Interfaces/Infrastructure/IToastService.cs: -------------------------------------------------------------------------------- 1 | using CommunityToolkit.Maui.Core; 2 | 3 | namespace CraftUI.Demo.Application.Common.Interfaces.Infrastructure; 4 | 5 | public interface IToastService 6 | { 7 | Task ShowAsync(string message, ToastDuration duration = ToastDuration.Short, double textSize = 14.0); 8 | } -------------------------------------------------------------------------------- /src/CraftUI.Demo.Application/Common/Interfaces/Services/ICityService.cs: -------------------------------------------------------------------------------- 1 | using CraftUI.Demo.Application.Cities; 2 | 3 | namespace CraftUI.Demo.Application.Common.Interfaces.Services; 4 | 5 | public interface ICityService 6 | { 7 | Task> GetAllCitiesAsync(CancellationToken cancellationToken = default); 8 | Task> GetCitiesAsync(int countryId, CancellationToken cancellationToken = default); 9 | } -------------------------------------------------------------------------------- /src/CraftUI.Demo.Application/Common/Interfaces/Services/ICountryService.cs: -------------------------------------------------------------------------------- 1 | using CraftUI.Demo.Application.Countries; 2 | 3 | namespace CraftUI.Demo.Application.Common.Interfaces.Services; 4 | 5 | public interface ICountryService 6 | { 7 | Task> GetAllCountriesAsync(CancellationToken cancellationToken = default); 8 | } -------------------------------------------------------------------------------- /src/CraftUI.Demo.Application/Common/LinkMenuItem.cs: -------------------------------------------------------------------------------- 1 | namespace CraftUI.Demo.Application.Common; 2 | 3 | public record LinkMenuItem(string Title, string Image, string RoutePage); -------------------------------------------------------------------------------- /src/CraftUI.Demo.Application/Countries/CountryVm.cs: -------------------------------------------------------------------------------- 1 | namespace CraftUI.Demo.Application.Countries; 2 | 3 | public record CountryVm(int Id, string Name); -------------------------------------------------------------------------------- /src/CraftUI.Demo.Application/CraftUI.Demo.Application.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net9.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/CraftUI.Demo.Infrastructure/CraftUI.Demo.Infrastructure.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net9.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/CraftUI.Demo.Infrastructure/DependencyInjection.cs: -------------------------------------------------------------------------------- 1 | using CraftUI.Demo.Application.Common.Interfaces.Infrastructure; 2 | using CraftUI.Demo.Infrastructure.Displays; 3 | using CraftUI.Demo.Infrastructure.Navigation; 4 | using CraftUI.Demo.Infrastructure.Toasts; 5 | using Microsoft.Extensions.DependencyInjection; 6 | 7 | namespace CraftUI.Demo.Infrastructure; 8 | 9 | public static class DependencyInjection 10 | { 11 | public static IServiceCollection AddInfrastructure(this IServiceCollection services) 12 | { 13 | services.AddSingleton(); 14 | services.AddSingleton(); 15 | services.AddSingleton(); 16 | 17 | return services; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/CraftUI.Demo.Infrastructure/Displays/DisplayService.cs: -------------------------------------------------------------------------------- 1 | using CraftUI.Demo.Application.Common.Interfaces.Infrastructure; 2 | 3 | namespace CraftUI.Demo.Infrastructure.Displays; 4 | 5 | public class DisplayService : IDisplayService 6 | { 7 | public Task ShowPopupAsync(string title, string message, string accept = "OK") 8 | { 9 | return Microsoft.Maui.Controls.Application.Current!.Windows[0].Page!.DisplayAlert(title, message, accept); 10 | } 11 | } -------------------------------------------------------------------------------- /src/CraftUI.Demo.Infrastructure/Navigation/NavigationService.cs: -------------------------------------------------------------------------------- 1 | using CraftUI.Demo.Application.Common.Interfaces.Infrastructure; 2 | 3 | namespace CraftUI.Demo.Infrastructure.Navigation; 4 | 5 | // Read more about navigation : https://learn.microsoft.com/fr-fr/dotnet/architecture/maui/navigation 6 | 7 | public class NavigationService : INavigationService 8 | { 9 | public Task NavigateToAsync(string route, IDictionary? routeParameters = null) 10 | { 11 | return routeParameters != null 12 | ? Shell.Current.GoToAsync(route, routeParameters) 13 | : Shell.Current.GoToAsync(route); 14 | } 15 | 16 | public Task GoBackAsync() 17 | { 18 | return Shell.Current.GoToAsync(".."); 19 | } 20 | } -------------------------------------------------------------------------------- /src/CraftUI.Demo.Infrastructure/Toasts/ToastService.cs: -------------------------------------------------------------------------------- 1 | using CraftUI.Demo.Application.Common.Interfaces.Infrastructure; 2 | using CommunityToolkit.Maui.Alerts; 3 | using CommunityToolkit.Maui.Core; 4 | 5 | namespace CraftUI.Demo.Infrastructure.Toasts; 6 | 7 | public class ToastService : IToastService 8 | { 9 | public Task ShowAsync(string message, ToastDuration duration = ToastDuration.Short, double textSize = 14.0) 10 | { 11 | return Toast.Make(message, duration, textSize).Show(); 12 | } 13 | } -------------------------------------------------------------------------------- /src/CraftUI.Demo.Services/Countries/CountryService.cs: -------------------------------------------------------------------------------- 1 | using CraftUI.Demo.Application.Common.Interfaces.Services; 2 | using CraftUI.Demo.Application.Countries; 3 | 4 | namespace CraftUI.Demo.Services.Countries; 5 | 6 | public class CountryService : ICountryService 7 | { 8 | public async Task> GetAllCountriesAsync(CancellationToken cancellationToken = default) 9 | { 10 | var countries = new List 11 | { 12 | new (1, "France"), 13 | new (2, "United States"), 14 | new (3, "Japan"), 15 | new (4, "United Kingdom"), 16 | new (5, "Australia"), 17 | new (6, "Canada"), 18 | new (7, "Germany"), 19 | new (8, "Italy"), 20 | new (9, "Spain"), 21 | new (10, "Brazil"), 22 | new (11, "China"), 23 | new (12, "India"), 24 | new (13, "Mexico"), 25 | new (14, "Russia"), 26 | new (15, "South Korea"), 27 | new (16, "Netherlands"), 28 | new (17, "Sweden"), 29 | new (18, "Norway"), 30 | new (19, "Denmark"), 31 | new (20, "Finland"), 32 | new (21, "Argentina"), 33 | new (22, "Belgium"), 34 | new (23, "Chile"), 35 | new (24, "Colombia"), 36 | new (25, "New Zealand"), 37 | new (26, "South Africa"), 38 | new (27, "Ireland"), 39 | new (28, "Portugal"), 40 | new (29, "Greece"), 41 | new (30, "Turkey"), 42 | new (31, "Saudi Arabia"), 43 | new (32, "Israel"), 44 | new (33, "Poland"), 45 | new (34, "Switzerland"), 46 | new (35, "Austria"), 47 | new (36, "Hungary"), 48 | new (37, "Czech Republic"), 49 | new (38, "Ukraine"), 50 | new (39, "Vietnam"), 51 | new (40, "Thailand"), 52 | new (41, "Malaysia"), 53 | new (42, "Philippines"), 54 | new (43, "Indonesia"), 55 | new (44, "Singapore"), 56 | new (45, "Pakistan"), 57 | new (46, "Bangladesh"), 58 | new (47, "Sri Lanka"), 59 | new (48, "Nepal"), 60 | new (49, "Afghanistan"), 61 | new (50, "Kazakhstan"), 62 | new (51, "Uzbekistan"), 63 | new (52, "Azerbaijan"), 64 | new (53, "Armenia"), 65 | new (54, "Georgia"), 66 | new (55, "Morocco"), 67 | new (56, "Tunisia"), 68 | new (57, "Egypt"), 69 | new (58, "Kenya"), 70 | new (59, "Nigeria"), 71 | new (60, "Ghana"), 72 | new (61, "Ivory Coast"), 73 | new (62, "Senegal"), 74 | new (63, "Uganda"), 75 | new (64, "Ethiopia"), 76 | new (65, "Tanzania"), 77 | new (66, "Zambia"), 78 | new (67, "Zimbabwe"), 79 | new (68, "Algeria"), 80 | new (69, "Libya"), 81 | new (70, "Sudan"), 82 | new (71, "Angola"), 83 | new (72, "Mozambique"), 84 | new (73, "Botswana"), 85 | new (74, "Namibia"), 86 | new (75, "Madagascar"), 87 | new (76, "Mauritius"), 88 | new (77, "Seychelles"), 89 | new (78, "Malawi"), 90 | new (79, "Rwanda"), 91 | new (80, "Burundi"), 92 | new (81, "Mali"), 93 | new (82, "Niger"), 94 | new (83, "Chad"), 95 | new (84, "Central African Republic"), 96 | new (85, "Democratic Republic of the Congo"), 97 | new (86, "Republic of the Congo"), 98 | new (87, "Gabon"), 99 | new (88, "Equatorial Guinea"), 100 | new (89, "Sao Tome and Principe"), 101 | new (90, "Togo"), 102 | new (91, "Benin"), 103 | new (92, "Sierra Leone"), 104 | new (93, "Liberia"), 105 | new (94, "Cameroon"), 106 | new (95, "Burkina Faso"), 107 | new (96, "Lesotho"), 108 | new (97, "Eswatini"), 109 | new (98, "Somalia"), 110 | new (99, "Djibouti"), 111 | new (100, "Eritrea") 112 | }; 113 | 114 | await Task.Delay(2000, cancellationToken); 115 | 116 | return countries.AsReadOnly(); 117 | } 118 | } -------------------------------------------------------------------------------- /src/CraftUI.Demo.Services/CraftUI.Demo.Services.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net9.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/CraftUI.Demo.Services/DependencyInjection.cs: -------------------------------------------------------------------------------- 1 | using CraftUI.Demo.Application.Common.Interfaces.Services; 2 | using CraftUI.Demo.Services.Cities; 3 | using CraftUI.Demo.Services.Countries; 4 | using Microsoft.Extensions.DependencyInjection; 5 | 6 | namespace CraftUI.Demo.Services; 7 | 8 | public static class DependencyInjection 9 | { 10 | public static IServiceCollection AddServices(this IServiceCollection services) 11 | { 12 | services.AddSingleton(); 13 | services.AddSingleton(); 14 | 15 | return services; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/CraftUI.Demo/App.xaml: -------------------------------------------------------------------------------- 1 |  2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/CraftUI.Demo/App.xaml.cs: -------------------------------------------------------------------------------- 1 | namespace CraftUI.Demo; 2 | 3 | public partial class App 4 | { 5 | public App() 6 | { 7 | InitializeComponent(); 8 | } 9 | 10 | protected override Window CreateWindow(IActivationState? activationState) 11 | { 12 | return new Window(new AppShell()); 13 | } 14 | } -------------------------------------------------------------------------------- /src/CraftUI.Demo/AppShell.xaml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 17 | 18 | 19 | 23 | 24 | 25 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /src/CraftUI.Demo/AppShell.xaml.cs: -------------------------------------------------------------------------------- 1 | using CraftUI.Library.Maui.Common.Helpers; 2 | 3 | namespace CraftUI.Demo; 4 | 5 | public partial class AppShell 6 | { 7 | public AppShell() 8 | { 9 | InitializeComponent(); 10 | SetBackgroundColor(this, ResourceHelper.GetResource("Primary")); 11 | SetTitleColor(this, ResourceHelper.GetResource("White")); 12 | } 13 | } -------------------------------------------------------------------------------- /src/CraftUI.Demo/CraftUI.Demo.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net9.0-android;net9.0-ios;net9.0-maccatalyst 5 | $(TargetFrameworks);net9.0-windows10.0.19041.0 6 | 7 | 8 | 9 | 14 | 15 | 16 | Exe 17 | true 18 | true 19 | enable 20 | enable 21 | 22 | 23 | CraftUI Demo 24 | 25 | 26 | com.stephanarnas.blog_maui_components 27 | 28 | 29 | 1.0 30 | 1 31 | 32 | 15.0 33 | 15.0 34 | 21.0 35 | 10.0.17763.0 36 | 10.0.17763.0 37 | 38 | 39 | 40 | SdkOnly 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | Designer 73 | 74 | 75 | Designer 76 | 77 | 78 | Designer 79 | 80 | 81 | Designer 82 | 83 | 84 | Designer 85 | 86 | 87 | Designer 88 | 89 | 90 | Designer 91 | 92 | 93 | 94 | 95 | 96 | EntryLabel.xaml 97 | Code 98 | 99 | 100 | EntryLabelBacis.xaml 101 | Code 102 | 103 | 104 | LabelBase.xaml 105 | Code 106 | 107 | 108 | CitySearchPage.xaml 109 | Code 110 | 111 | 112 | CountrySearchPage.xaml 113 | Code 114 | 115 | 116 | UseCasesList.xaml 117 | Code 118 | 119 | 120 | MultiPickerPopupPage.xaml 121 | Code 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | -------------------------------------------------------------------------------- /src/CraftUI.Demo/MauiProgram.cs: -------------------------------------------------------------------------------- 1 | using CraftUI.Demo.Infrastructure; 2 | using CraftUI.Library.Maui; 3 | using CraftUI.Demo.Services; 4 | using CommunityToolkit.Maui; 5 | using Microsoft.Extensions.Logging; 6 | using Microsoft.Maui.Handlers; 7 | using CraftUI.Demo.Presentation.Common; 8 | using CraftUI.Demo.Presentation.Pages.Controls; 9 | using CraftUI.Demo.Presentation.Pages.Controls.Buttons; 10 | using CraftUI.Demo.Presentation.Pages.Controls.DatePickers; 11 | using CraftUI.Demo.Presentation.Pages.Controls.Entries; 12 | using CraftUI.Demo.Presentation.Pages.Controls.Pickers; 13 | using CraftUI.Demo.Presentation.Pages.Controls.ProgressBars; 14 | using CraftUI.Demo.Presentation.Pages.Settings; 15 | using CraftUI.Demo.Presentation.Pages.UseCases; 16 | 17 | namespace CraftUI.Demo; 18 | 19 | public static class MauiProgram 20 | { 21 | public static MauiApp CreateMauiApp() 22 | { 23 | var builder = MauiApp.CreateBuilder(); 24 | builder 25 | .UseMauiApp() 26 | .AddBlogComponents() 27 | .UseMauiCommunityToolkit() 28 | .ConfigureFonts(fonts => 29 | { 30 | fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular"); 31 | fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold"); 32 | }); 33 | 34 | #if DEBUG 35 | builder.Logging.AddDebug(); 36 | #endif 37 | 38 | builder.Services.AddInfrastructure(); 39 | builder.Services.AddServices(); 40 | 41 | ApplyStyleCustomization(); 42 | 43 | // Register your pages. 44 | builder.Services.AddTransient(); 45 | builder.Services.AddTransientWithShellRoute(RouteConstants.ButtonPage); 46 | builder.Services.AddTransientWithShellRoute(RouteConstants.EntryPage); 47 | builder.Services.AddTransientWithShellRoute(RouteConstants.DatePickerPage); 48 | builder.Services.AddTransientWithShellRoute(RouteConstants.PickerPage); 49 | builder.Services.AddTransientWithShellRoute(RouteConstants.PickerPopupPage); 50 | builder.Services.AddTransientWithShellRoute(RouteConstants.MultiPickerPopupPage); 51 | builder.Services.AddTransientWithShellRoute(RouteConstants.ProgressBarPage); 52 | 53 | builder.Services.AddTransient(); 54 | builder.Services.AddTransient(); 55 | 56 | return builder.Build(); 57 | } 58 | 59 | private static void ApplyStyleCustomization() 60 | { 61 | EntryHandler.Mapper.AppendToMapping("NoUnderline", (handler, view) => 62 | { 63 | #if ANDROID 64 | // Remove the underline from the EditText 65 | handler.PlatformView.SetBackgroundColor(Android.Graphics.Color.Transparent); 66 | #endif 67 | }); 68 | 69 | EntryHandler.Mapper.AppendToMapping("SetUpEntry", (handler, _) => 70 | { 71 | #if ANDROID 72 | 73 | #elif IOS || MACCATALYST 74 | // Remove outline from the UITextField 75 | handler.PlatformView.BorderStyle = UIKit.UITextBorderStyle.None; 76 | #elif WINDOWS 77 | 78 | #endif 79 | }); 80 | 81 | PickerHandler.Mapper.AppendToMapping("NoUnderline", (handler, _) => 82 | { 83 | #if ANDROID 84 | // Remove the underline from the Spinner (Picker) 85 | handler.PlatformView.Background = null; 86 | #endif 87 | }); 88 | 89 | PickerHandler.Mapper.AppendToMapping("SetUpPicker", (handler, _) => 90 | { 91 | #if ANDROID 92 | // Set the background to transparent 93 | handler.PlatformView.Background = null; 94 | #elif IOS || MACCATALYST 95 | // Remove border for the UITextField (Picker) 96 | if (handler.PlatformView is UIKit.UITextField textField) 97 | { 98 | textField.BorderStyle = UIKit.UITextBorderStyle.None; 99 | } 100 | #elif WINDOWS 101 | 102 | #endif 103 | }); 104 | 105 | DatePickerHandler.Mapper.AppendToMapping("Borderless", (handler, view) => 106 | { 107 | #if ANDROID 108 | handler.PlatformView.Background = null; 109 | #elif IOS || MACCATALYST 110 | handler.PlatformView.BackgroundColor = UIKit.UIColor.Clear; 111 | handler.PlatformView.Layer.BorderWidth = 0; 112 | handler.PlatformView.BorderStyle = UIKit.UITextBorderStyle.None; 113 | #endif 114 | }); 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /src/CraftUI.Demo/Platforms/Android/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/CraftUI.Demo/Platforms/Android/MainActivity.cs: -------------------------------------------------------------------------------- 1 | using Android.App; 2 | using Android.Content.PM; 3 | using Android.OS; 4 | 5 | namespace CraftUI.Demo; 6 | 7 | [Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, 8 | ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | 9 | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)] 10 | public class MainActivity : MauiAppCompatActivity 11 | { 12 | } -------------------------------------------------------------------------------- /src/CraftUI.Demo/Platforms/Android/MainApplication.cs: -------------------------------------------------------------------------------- 1 | using Android.App; 2 | using Android.Runtime; 3 | 4 | namespace CraftUI.Demo; 5 | 6 | [Application] 7 | public class MainApplication : MauiApplication 8 | { 9 | public MainApplication(IntPtr handle, JniHandleOwnership ownership) 10 | : base(handle, ownership) 11 | { 12 | } 13 | 14 | protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); 15 | } -------------------------------------------------------------------------------- /src/CraftUI.Demo/Platforms/Android/Resources/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #512BD4 4 | #2B0B98 5 | #2B0B98 6 | -------------------------------------------------------------------------------- /src/CraftUI.Demo/Platforms/MacCatalyst/AppDelegate.cs: -------------------------------------------------------------------------------- 1 | using Foundation; 2 | 3 | namespace CraftUI.Demo; 4 | 5 | [Register("AppDelegate")] 6 | public class AppDelegate : MauiUIApplicationDelegate 7 | { 8 | protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); 9 | } -------------------------------------------------------------------------------- /src/CraftUI.Demo/Platforms/MacCatalyst/Entitlements.plist: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | com.apple.security.app-sandbox 8 | 9 | 10 | com.apple.security.network.client 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/CraftUI.Demo/Platforms/MacCatalyst/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | UIDeviceFamily 15 | 16 | 2 17 | 18 | UIRequiredDeviceCapabilities 19 | 20 | arm64 21 | 22 | UISupportedInterfaceOrientations 23 | 24 | UIInterfaceOrientationPortrait 25 | UIInterfaceOrientationLandscapeLeft 26 | UIInterfaceOrientationLandscapeRight 27 | 28 | UISupportedInterfaceOrientations~ipad 29 | 30 | UIInterfaceOrientationPortrait 31 | UIInterfaceOrientationPortraitUpsideDown 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | XSAppIconAssets 36 | Assets.xcassets/appicon.appiconset 37 | 38 | 39 | -------------------------------------------------------------------------------- /src/CraftUI.Demo/Platforms/MacCatalyst/Program.cs: -------------------------------------------------------------------------------- 1 | using ObjCRuntime; 2 | using UIKit; 3 | 4 | namespace CraftUI.Demo; 5 | 6 | public class Program 7 | { 8 | // This is the main entry point of the application. 9 | static void Main(string[] args) 10 | { 11 | // if you want to use a different Application Delegate class from "AppDelegate" 12 | // you can specify it here. 13 | UIApplication.Main(args, null, typeof(AppDelegate)); 14 | } 15 | } -------------------------------------------------------------------------------- /src/CraftUI.Demo/Platforms/Windows/App.xaml: -------------------------------------------------------------------------------- 1 |  7 | 8 | 9 | -------------------------------------------------------------------------------- /src/CraftUI.Demo/Platforms/Windows/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.UI.Xaml; 2 | 3 | // To learn more about WinUI, the WinUI project structure, 4 | // and more about our project templates, see: http://aka.ms/winui-project-info. 5 | 6 | namespace StephanArnas.Controls.WinUI; 7 | 8 | /// 9 | /// Provides application-specific behavior to supplement the default Application class. 10 | /// 11 | public partial class App : MauiWinUIApplication 12 | { 13 | /// 14 | /// Initializes the singleton application object. This is the first line of authored code 15 | /// executed, and as such is the logical equivalent of main() or WinMain(). 16 | /// 17 | public App() 18 | { 19 | this.InitializeComponent(); 20 | } 21 | 22 | protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); 23 | } -------------------------------------------------------------------------------- /src/CraftUI.Demo/Platforms/Windows/Package.appxmanifest: -------------------------------------------------------------------------------- 1 |  2 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | $placeholder$ 15 | User Name 16 | $placeholder$.png 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /src/CraftUI.Demo/Platforms/Windows/app.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 11 | true/PM 12 | PerMonitorV2, PerMonitor 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/CraftUI.Demo/Platforms/iOS/AppDelegate.cs: -------------------------------------------------------------------------------- 1 | using Foundation; 2 | 3 | namespace CraftUI.Demo; 4 | 5 | [Register("AppDelegate")] 6 | public class AppDelegate : MauiUIApplicationDelegate 7 | { 8 | protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); 9 | } -------------------------------------------------------------------------------- /src/CraftUI.Demo/Platforms/iOS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | LSRequiresIPhoneOS 6 | 7 | UIDeviceFamily 8 | 9 | 1 10 | 2 11 | 12 | UIRequiredDeviceCapabilities 13 | 14 | arm64 15 | 16 | UISupportedInterfaceOrientations 17 | 18 | UIInterfaceOrientationPortrait 19 | UIInterfaceOrientationLandscapeLeft 20 | UIInterfaceOrientationLandscapeRight 21 | 22 | UISupportedInterfaceOrientations~ipad 23 | 24 | UIInterfaceOrientationPortrait 25 | UIInterfaceOrientationPortraitUpsideDown 26 | UIInterfaceOrientationLandscapeLeft 27 | UIInterfaceOrientationLandscapeRight 28 | 29 | XSAppIconAssets 30 | Assets.xcassets/appicon.appiconset 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/CraftUI.Demo/Platforms/iOS/Program.cs: -------------------------------------------------------------------------------- 1 | using UIKit; 2 | 3 | namespace CraftUI.Demo; 4 | 5 | public class Program 6 | { 7 | // This is the main entry point of the application. 8 | static void Main(string[] args) 9 | { 10 | // if you want to use a different Application Delegate class from "AppDelegate" 11 | // you can specify it here. 12 | UIApplication.Main(args, null, typeof(AppDelegate)); 13 | } 14 | } -------------------------------------------------------------------------------- /src/CraftUI.Demo/Presentation/Common/ContentPageBase.cs: -------------------------------------------------------------------------------- 1 | namespace CraftUI.Demo.Presentation.Common; 2 | 3 | public class ContentPageBase : ContentPage 4 | { 5 | protected override void OnAppearing() 6 | { 7 | base.OnAppearing(); 8 | 9 | ((ViewModelBase) BindingContext)?.OnAppearing(); 10 | } 11 | 12 | protected override void OnDisappearing() 13 | { 14 | base.OnDisappearing(); 15 | 16 | ((ViewModelBase) BindingContext)?.OnDisappearing(); 17 | } 18 | } -------------------------------------------------------------------------------- /src/CraftUI.Demo/Presentation/Common/RouteConstants.cs: -------------------------------------------------------------------------------- 1 | namespace CraftUI.Demo.Presentation.Common; 2 | 3 | public static class RouteConstants 4 | { 5 | public const string ControlsListPage = "ControlsListPage"; 6 | public const string ButtonPage = "ButtonPage"; 7 | public const string EntryPage = "EntryPage"; 8 | public const string DatePickerPage = "DatePickerPage"; 9 | public const string PickerPage = "PikerPage"; 10 | public const string PickerPopupPage = "PickerPopupPage"; 11 | public const string MultiPickerPopupPage = "MultiPickerPopupPage"; 12 | public const string ProgressBarPage = "ProgressBarPage"; 13 | 14 | public const string UseCasesListPage = "UseCasesListPage"; 15 | public const string SettingsPage = "SettingsPage"; 16 | } -------------------------------------------------------------------------------- /src/CraftUI.Demo/Presentation/Common/ViewModelBase.cs: -------------------------------------------------------------------------------- 1 | using CommunityToolkit.Mvvm.ComponentModel; 2 | 3 | namespace CraftUI.Demo.Presentation.Common; 4 | 5 | public abstract class ViewModelBase : ObservableObject, IQueryAttributable 6 | { 7 | protected bool IsAppearingFromDetailPage; 8 | 9 | protected ViewModelBase() { } 10 | 11 | public virtual void ApplyQueryAttributes(IDictionary query) 12 | { 13 | query.Clear(); 14 | } 15 | 16 | public virtual void OnAppearing() 17 | { 18 | IsAppearingFromDetailPage = false; 19 | } 20 | 21 | public virtual void OnDisappearing() { } 22 | } -------------------------------------------------------------------------------- /src/CraftUI.Demo/Presentation/Pages/Controls/Buttons/ButtonPage.xaml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | 17 | 18 | 22 | 23 | 25 | 26 | 29 | 30 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /src/CraftUI.Demo/Presentation/Pages/Controls/Buttons/ButtonPage.xaml.cs: -------------------------------------------------------------------------------- 1 | namespace CraftUI.Demo.Presentation.Pages.Controls.Buttons; 2 | 3 | public partial class ButtonPage 4 | { 5 | public ButtonPage(ButtonPageViewModel viewModel) 6 | { 7 | InitializeComponent(); 8 | BindingContext = viewModel; 9 | } 10 | } -------------------------------------------------------------------------------- /src/CraftUI.Demo/Presentation/Pages/Controls/Buttons/ButtonPageViewModel.cs: -------------------------------------------------------------------------------- 1 | using CraftUI.Demo.Presentation.Common; 2 | using Microsoft.Extensions.Logging; 3 | using Sharpnado.TaskLoaderView; 4 | 5 | namespace CraftUI.Demo.Presentation.Pages.Controls.Buttons; 6 | 7 | public class ButtonPageViewModel : ViewModelBase 8 | { 9 | private readonly ILogger _logger; 10 | 11 | public TaskLoaderCommand DemoOneCommand { get; } 12 | 13 | public ButtonPageViewModel( 14 | ILogger logger) 15 | { 16 | _logger = logger; 17 | 18 | DemoOneCommand = new TaskLoaderCommand(DemoOneAsync); 19 | 20 | _logger.LogInformation("Building ButtonPageViewModel"); 21 | } 22 | 23 | private async Task DemoOneAsync() 24 | { 25 | _logger.LogInformation("DemoOne()"); 26 | 27 | await Task.Delay(5000); 28 | } 29 | } -------------------------------------------------------------------------------- /src/CraftUI.Demo/Presentation/Pages/Controls/ControlsList.xaml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 18 | 19 | 20 | 21 | 25 | 26 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/CraftUI.Demo/Presentation/Pages/Controls/ControlsList.xaml.cs: -------------------------------------------------------------------------------- 1 | namespace CraftUI.Demo.Presentation.Pages.Controls; 2 | 3 | public partial class ControlsList 4 | { 5 | public ControlsList(ControlsListViewModel viewModel) 6 | { 7 | InitializeComponent(); 8 | BindingContext = viewModel; 9 | } 10 | 11 | protected override void OnAppearing() 12 | { 13 | ItemsCollectionView.SelectedItem = null; 14 | base.OnAppearing(); 15 | } 16 | } -------------------------------------------------------------------------------- /src/CraftUI.Demo/Presentation/Pages/Controls/ControlsListViewModel.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.ObjectModel; 2 | using CommunityToolkit.Mvvm.ComponentModel; 3 | using CommunityToolkit.Mvvm.Input; 4 | using CraftUI.Demo.Application.Common; 5 | using CraftUI.Demo.Application.Common.Interfaces.Infrastructure; 6 | using CraftUI.Demo.Presentation.Common; 7 | using CraftUI.Demo.Presentation.Pages.Controls.Pickers; 8 | using Microsoft.Extensions.Logging; 9 | 10 | namespace CraftUI.Demo.Presentation.Pages.Controls; 11 | 12 | public partial class ControlsListViewModel : ViewModelBase 13 | { 14 | private readonly ILogger _logger; 15 | private readonly INavigationService _navigationService; 16 | 17 | [ObservableProperty] 18 | private ObservableCollection _items; 19 | 20 | public ControlsListViewModel( 21 | ILogger logger, 22 | INavigationService navigationService) 23 | { 24 | _logger = logger; 25 | _navigationService = navigationService; 26 | 27 | InitializeItems(); 28 | 29 | _logger.LogInformation("Building ControlsListViewModel"); 30 | } 31 | 32 | public override void ApplyQueryAttributes(IDictionary query) 33 | { 34 | _logger.LogInformation("ApplyQueryAttributes( query: {Query} )", query); 35 | 36 | base.ApplyQueryAttributes(query); 37 | } 38 | 39 | public override void OnAppearing() 40 | { 41 | _logger.LogInformation("OnAppearing()"); 42 | 43 | base.OnAppearing(); 44 | } 45 | 46 | public override void OnDisappearing() 47 | { 48 | _logger.LogInformation("OnDisappearing()"); 49 | 50 | base.OnDisappearing(); 51 | } 52 | 53 | [RelayCommand] 54 | private async Task NavigateToPage(LinkMenuItem? item) 55 | { 56 | _logger.LogInformation("NavigateToPage( item: {Item} )", item); 57 | 58 | if (item is not null) 59 | { 60 | await _navigationService.NavigateToAsync(item.RoutePage); 61 | } 62 | } 63 | 64 | private void InitializeItems() 65 | { 66 | Items = 67 | [ 68 | new LinkMenuItem("Button", "demo_hand_click.png", RouteConstants.ButtonPage), 69 | new LinkMenuItem("Entry", "demo_input.png", RouteConstants.EntryPage), 70 | new LinkMenuItem("Date Picker", "demo_date_picker.png", RouteConstants.DatePickerPage), 71 | new LinkMenuItem("Native Picker", "demo_picker.png", RouteConstants.PickerPage), 72 | new LinkMenuItem("Popup Picker", "demo_picker.png", RouteConstants.PickerPopupPage), 73 | new LinkMenuItem("Mutli Popup Picker", "demo_picker.png", RouteConstants.MultiPickerPopupPage), 74 | new LinkMenuItem("Progress Bar", "demo_progress_bar.png", RouteConstants.ProgressBarPage) 75 | ]; 76 | } 77 | } -------------------------------------------------------------------------------- /src/CraftUI.Demo/Presentation/Pages/Controls/DatePickers/DatePickerPage.xaml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 12 | 13 | 14 | 15 | 18 | 19 | 23 | 24 | 28 | 29 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /src/CraftUI.Demo/Presentation/Pages/Controls/DatePickers/DatePickerPage.xaml.cs: -------------------------------------------------------------------------------- 1 | namespace CraftUI.Demo.Presentation.Pages.Controls.DatePickers; 2 | 3 | public partial class DatePickerPage 4 | { 5 | public DatePickerPage(DatePickerPageViewModel viewModel) 6 | { 7 | InitializeComponent(); 8 | BindingContext = viewModel; 9 | } 10 | } -------------------------------------------------------------------------------- /src/CraftUI.Demo/Presentation/Pages/Controls/DatePickers/DatePickerPageViewModel.cs: -------------------------------------------------------------------------------- 1 | using CommunityToolkit.Mvvm.ComponentModel; 2 | using CraftUI.Demo.Presentation.Common; 3 | using Microsoft.Extensions.Logging; 4 | 5 | namespace CraftUI.Demo.Presentation.Pages.Controls.DatePickers; 6 | 7 | public partial class DatePickerPageViewModel : ViewModelBase 8 | { 9 | private readonly ILogger _logger; 10 | 11 | [ObservableProperty] 12 | private DateTime _date; 13 | 14 | [ObservableProperty] 15 | private DateTime? _dateNullable; 16 | 17 | [ObservableProperty] 18 | private DateTime? _rangeDateNullable; 19 | 20 | [ObservableProperty] 21 | private DateTime _minimumDate; 22 | 23 | [ObservableProperty] 24 | private DateTime _maximumDate; 25 | 26 | public DatePickerPageViewModel( 27 | ILogger logger) 28 | { 29 | _logger = logger; 30 | 31 | MinimumDate = DateTime.Now.AddDays(-1); 32 | MaximumDate = DateTime.Now.AddDays(30); 33 | 34 | _logger.LogInformation("Building DatePickerPageViewModel"); 35 | } 36 | 37 | public override void OnAppearing() 38 | { 39 | _logger.LogInformation("OnAppearing()"); 40 | 41 | Date = DateTime.Now; 42 | DateNullable = null; 43 | RangeDateNullable = null; 44 | 45 | base.OnAppearing(); 46 | } 47 | } -------------------------------------------------------------------------------- /src/CraftUI.Demo/Presentation/Pages/Controls/Entries/EntryPage.xaml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | 15 | 18 | 19 | 29 | 30 | 40 | 41 | 48 | 49 | 53 | 54 | 55 | 56 | 57 | 58 |