From 1c17375aad8d63fe3e10435cf2d11ea06eba0b48 Mon Sep 17 00:00:00 2001 From: Gerald Versluis Date: Mon, 28 Oct 2024 10:34:05 +0100 Subject: [PATCH 1/6] Fix toggle including sample content in template --- .../.template.config/dotnetcli.host.json | 6 +-- .../localize/templatestrings.cs.json | 1 - .../localize/templatestrings.de.json | 1 - .../localize/templatestrings.en.json | 1 - .../localize/templatestrings.es.json | 1 - .../localize/templatestrings.fr.json | 1 - .../localize/templatestrings.it.json | 1 - .../localize/templatestrings.ja.json | 1 - .../localize/templatestrings.json | 1 - .../localize/templatestrings.ko.json | 1 - .../localize/templatestrings.pl.json | 1 - .../localize/templatestrings.pt-BR.json | 1 - .../localize/templatestrings.ru.json | 1 - .../localize/templatestrings.tr.json | 1 - .../localize/templatestrings.zh-Hans.json | 1 - .../localize/templatestrings.zh-Hant.json | 1 - .../.template.config/template.json | 14 +------ .../src/templates/maui-mobile/App.xaml | 2 +- .../src/templates/maui-mobile/AppShell.xaml | 8 ++-- .../templates/maui-mobile/AppShell.xaml.cs | 4 +- .../templates/maui-mobile/MauiApp.1.csproj | 4 +- .../src/templates/maui-mobile/MauiProgram.cs | 12 +++--- .../maui-mobile/Resources/Styles/Colors.xaml | 2 +- .../maui-mobile/Resources/Styles/Styles.xaml | 38 +++++++++---------- 24 files changed, 39 insertions(+), 66 deletions(-) diff --git a/src/Templates/src/templates/maui-mobile/.template.config/dotnetcli.host.json b/src/Templates/src/templates/maui-mobile/.template.config/dotnetcli.host.json index 197aeeb0f8..b70f3b8eaf 100644 --- a/src/Templates/src/templates/maui-mobile/.template.config/dotnetcli.host.json +++ b/src/Templates/src/templates/maui-mobile/.template.config/dotnetcli.host.json @@ -4,11 +4,9 @@ "Framework": { "longName": "framework" }, - "Empty": { - "longName": "empty" - }, "IncludeSampleContent": { - "isHidden": true + "longName": "samplecontent", + "shortName": "sc" }, "skipRestore": { "longName": "no-restore", diff --git a/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.cs.json b/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.cs.json index 8558880c08..7c80c01235 100644 --- a/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.cs.json +++ b/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.cs.json @@ -10,6 +10,5 @@ "symbols/Framework/choices/DOTNET_TFM_VALUE/description": "Target DOTNET_TFM_VALUE", "symbols/IncludeSampleContent/displayName": "_Include sample content", "symbols/IncludeSampleContent/description": "Configures whether to add sample pages and functionality to demonstrate basic usage patterns.", - "symbols/Empty/description": "Configures whether to omit sample pages and styling that demonstrate basic usage patterns.", "symbols/skipRestore/description": "If specified, skips the automatic restore of the project on create." } \ No newline at end of file diff --git a/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.de.json b/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.de.json index 1715f1032f..eba6e9e472 100644 --- a/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.de.json +++ b/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.de.json @@ -10,6 +10,5 @@ "symbols/Framework/choices/DOTNET_TFM_VALUE/description": "Target DOTNET_TFM_VALUE", "symbols/IncludeSampleContent/displayName": "_Include sample content", "symbols/IncludeSampleContent/description": "Configures whether to add sample pages and functionality to demonstrate basic usage patterns.", - "symbols/Empty/description": "Configures whether to omit sample pages and styling that demonstrate basic usage patterns.", "symbols/skipRestore/description": "If specified, skips the automatic restore of the project on create." } \ No newline at end of file diff --git a/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.en.json b/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.en.json index 04a21b340c..b195588e3b 100644 --- a/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.en.json +++ b/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.en.json @@ -10,6 +10,5 @@ "symbols/Framework/choices/DOTNET_TFM_VALUE/description": "Target DOTNET_TFM_VALUE", "symbols/IncludeSampleContent/displayName": "_Include sample content", "symbols/IncludeSampleContent/description": "Configures whether to add sample pages and functionality to demonstrate basic usage patterns.", - "symbols/Empty/description": "Configures whether to omit sample pages and styling that demonstrate basic usage patterns.", "symbols/skipRestore/description": "If specified, skips the automatic restore of the project on create." } \ No newline at end of file diff --git a/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.es.json b/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.es.json index ded244439c..86860527a2 100644 --- a/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.es.json +++ b/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.es.json @@ -10,6 +10,5 @@ "symbols/Framework/choices/DOTNET_TFM_VALUE/description": "Target DOTNET_TFM_VALUE", "symbols/IncludeSampleContent/displayName": "_Include sample content", "symbols/IncludeSampleContent/description": "Configures whether to add sample pages and functionality to demonstrate basic usage patterns.", - "symbols/Empty/description": "Configures whether to omit sample pages and styling that demonstrate basic usage patterns.", "symbols/skipRestore/description": "If specified, skips the automatic restore of the project on create." } \ No newline at end of file diff --git a/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.fr.json b/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.fr.json index a2c956adb0..d7db91cbaa 100644 --- a/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.fr.json +++ b/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.fr.json @@ -10,6 +10,5 @@ "symbols/Framework/choices/DOTNET_TFM_VALUE/description": "Target DOTNET_TFM_VALUE", "symbols/IncludeSampleContent/displayName": "_Include sample content", "symbols/IncludeSampleContent/description": "Configures whether to add sample pages and functionality to demonstrate basic usage patterns.", - "symbols/Empty/description": "Configures whether to omit sample pages and styling that demonstrate basic usage patterns.", "symbols/skipRestore/description": "If specified, skips the automatic restore of the project on create." } \ No newline at end of file diff --git a/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.it.json b/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.it.json index e1eb6df426..198ca8d133 100644 --- a/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.it.json +++ b/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.it.json @@ -10,6 +10,5 @@ "symbols/Framework/choices/DOTNET_TFM_VALUE/description": "Target DOTNET_TFM_VALUE", "symbols/IncludeSampleContent/displayName": "_Include sample content", "symbols/IncludeSampleContent/description": "Configures whether to add sample pages and functionality to demonstrate basic usage patterns.", - "symbols/Empty/description": "Configures whether to omit sample pages and styling that demonstrate basic usage patterns.", "symbols/skipRestore/description": "If specified, skips the automatic restore of the project on create." } \ No newline at end of file diff --git a/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.ja.json b/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.ja.json index 7a8cc6a1ea..f99b968103 100644 --- a/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.ja.json +++ b/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.ja.json @@ -10,6 +10,5 @@ "symbols/Framework/choices/DOTNET_TFM_VALUE/description": "Target DOTNET_TFM_VALUE", "symbols/IncludeSampleContent/displayName": "_Include sample content", "symbols/IncludeSampleContent/description": "Configures whether to add sample pages and functionality to demonstrate basic usage patterns.", - "symbols/Empty/description": "Configures whether to omit sample pages and styling that demonstrate basic usage patterns.", "symbols/skipRestore/description": "If specified, skips the automatic restore of the project on create." } \ No newline at end of file diff --git a/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.json b/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.json index 04a21b340c..b195588e3b 100644 --- a/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.json +++ b/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.json @@ -10,6 +10,5 @@ "symbols/Framework/choices/DOTNET_TFM_VALUE/description": "Target DOTNET_TFM_VALUE", "symbols/IncludeSampleContent/displayName": "_Include sample content", "symbols/IncludeSampleContent/description": "Configures whether to add sample pages and functionality to demonstrate basic usage patterns.", - "symbols/Empty/description": "Configures whether to omit sample pages and styling that demonstrate basic usage patterns.", "symbols/skipRestore/description": "If specified, skips the automatic restore of the project on create." } \ No newline at end of file diff --git a/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.ko.json b/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.ko.json index 4314f84e14..476142b989 100644 --- a/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.ko.json +++ b/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.ko.json @@ -10,6 +10,5 @@ "symbols/Framework/choices/DOTNET_TFM_VALUE/description": "Target DOTNET_TFM_VALUE", "symbols/IncludeSampleContent/displayName": "_Include sample content", "symbols/IncludeSampleContent/description": "Configures whether to add sample pages and functionality to demonstrate basic usage patterns.", - "symbols/Empty/description": "Configures whether to omit sample pages and styling that demonstrate basic usage patterns.", "symbols/skipRestore/description": "If specified, skips the automatic restore of the project on create." } \ No newline at end of file diff --git a/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.pl.json b/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.pl.json index 19f4cabbca..387f31f663 100644 --- a/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.pl.json +++ b/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.pl.json @@ -10,6 +10,5 @@ "symbols/Framework/choices/DOTNET_TFM_VALUE/description": "Target DOTNET_TFM_VALUE", "symbols/IncludeSampleContent/displayName": "_Include sample content", "symbols/IncludeSampleContent/description": "Configures whether to add sample pages and functionality to demonstrate basic usage patterns.", - "symbols/Empty/description": "Configures whether to omit sample pages and styling that demonstrate basic usage patterns.", "symbols/skipRestore/description": "If specified, skips the automatic restore of the project on create." } \ No newline at end of file diff --git a/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.pt-BR.json b/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.pt-BR.json index b162711818..ae65eeae20 100644 --- a/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.pt-BR.json +++ b/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.pt-BR.json @@ -10,6 +10,5 @@ "symbols/Framework/choices/DOTNET_TFM_VALUE/description": "Target DOTNET_TFM_VALUE", "symbols/IncludeSampleContent/displayName": "_Include sample content", "symbols/IncludeSampleContent/description": "Configures whether to add sample pages and functionality to demonstrate basic usage patterns.", - "symbols/Empty/description": "Configures whether to omit sample pages and styling that demonstrate basic usage patterns.", "symbols/skipRestore/description": "If specified, skips the automatic restore of the project on create." } \ No newline at end of file diff --git a/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.ru.json b/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.ru.json index c91060e166..2082be4975 100644 --- a/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.ru.json +++ b/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.ru.json @@ -10,6 +10,5 @@ "symbols/Framework/choices/DOTNET_TFM_VALUE/description": "Target DOTNET_TFM_VALUE", "symbols/IncludeSampleContent/displayName": "_Include sample content", "symbols/IncludeSampleContent/description": "Configures whether to add sample pages and functionality to demonstrate basic usage patterns.", - "symbols/Empty/description": "Configures whether to omit sample pages and styling that demonstrate basic usage patterns.", "symbols/skipRestore/description": "If specified, skips the automatic restore of the project on create." } \ No newline at end of file diff --git a/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.tr.json b/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.tr.json index be11b123fb..9c283d6f35 100644 --- a/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.tr.json +++ b/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.tr.json @@ -10,6 +10,5 @@ "symbols/Framework/choices/DOTNET_TFM_VALUE/description": "Target DOTNET_TFM_VALUE", "symbols/IncludeSampleContent/displayName": "_Include sample content", "symbols/IncludeSampleContent/description": "Configures whether to add sample pages and functionality to demonstrate basic usage patterns.", - "symbols/Empty/description": "Configures whether to omit sample pages and styling that demonstrate basic usage patterns.", "symbols/skipRestore/description": "If specified, skips the automatic restore of the project on create." } \ No newline at end of file diff --git a/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.zh-Hans.json b/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.zh-Hans.json index dcddd255a3..3a6d64abf5 100644 --- a/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.zh-Hans.json +++ b/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.zh-Hans.json @@ -10,6 +10,5 @@ "symbols/Framework/choices/DOTNET_TFM_VALUE/description": "Target DOTNET_TFM_VALUE", "symbols/IncludeSampleContent/displayName": "_Include sample content", "symbols/IncludeSampleContent/description": "Configures whether to add sample pages and functionality to demonstrate basic usage patterns.", - "symbols/Empty/description": "Configures whether to omit sample pages and styling that demonstrate basic usage patterns.", "symbols/skipRestore/description": "If specified, skips the automatic restore of the project on create." } \ No newline at end of file diff --git a/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.zh-Hant.json b/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.zh-Hant.json index 526bff7159..dd1e32c433 100644 --- a/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.zh-Hant.json +++ b/src/Templates/src/templates/maui-mobile/.template.config/localize/templatestrings.zh-Hant.json @@ -10,6 +10,5 @@ "symbols/Framework/choices/DOTNET_TFM_VALUE/description": "Target DOTNET_TFM_VALUE", "symbols/IncludeSampleContent/displayName": "_Include sample content", "symbols/IncludeSampleContent/description": "Configures whether to add sample pages and functionality to demonstrate basic usage patterns.", - "symbols/Empty/description": "Configures whether to omit sample pages and styling that demonstrate basic usage patterns.", "symbols/skipRestore/description": "If specified, skips the automatic restore of the project on create." } \ No newline at end of file diff --git a/src/Templates/src/templates/maui-mobile/.template.config/template.json b/src/Templates/src/templates/maui-mobile/.template.config/template.json index 426ffd454d..3e50e9e59a 100644 --- a/src/Templates/src/templates/maui-mobile/.template.config/template.json +++ b/src/Templates/src/templates/maui-mobile/.template.config/template.json @@ -58,7 +58,7 @@ "copyOnly": [ "**/*.svg", "**/*.ttf" ], "modifiers": [ { - "condition": "(!SampleContent)", + "condition": "(!IncludeSampleContent)", "exclude": [ "Data/**", "GlobalUsings.cs", @@ -75,7 +75,7 @@ ] }, { - "condition": "(SampleContent)", + "condition": "(IncludeSampleContent)", "exclude": [ "MainPage.xaml", "MainPage.xaml.cs" @@ -180,16 +180,6 @@ "defaultValue": "false", "displayName": "_Include sample content", "description": "Configures whether to add sample pages and functionality to demonstrate basic usage patterns." - }, - "Empty": { - "type": "parameter", - "datatype": "bool", - "defaultValue": "true", - "description": "Configures whether to omit sample pages and styling that demonstrate basic usage patterns." - }, - "SampleContent": { - "type": "computed", - "value": "((IncludeSampleContent && (HostIdentifier == \"dotnetcli\" || HostIdentifier == \"dotnetcli-preview\")))" }, "skipRestore": { "type": "parameter", diff --git a/src/Templates/src/templates/maui-mobile/App.xaml b/src/Templates/src/templates/maui-mobile/App.xaml index aca300ca53..3ce414cbca 100644 --- a/src/Templates/src/templates/maui-mobile/App.xaml +++ b/src/Templates/src/templates/maui-mobile/App.xaml @@ -8,7 +8,7 @@ - + diff --git a/src/Templates/src/templates/maui-mobile/AppShell.xaml b/src/Templates/src/templates/maui-mobile/AppShell.xaml index 6ed645662d..ea7ef65b81 100644 --- a/src/Templates/src/templates/maui-mobile/AppShell.xaml +++ b/src/Templates/src/templates/maui-mobile/AppShell.xaml @@ -3,23 +3,23 @@ x:Class="MauiApp._1.AppShell" xmlns="http://schemas.microsoft.com/dotnet/2021/maui" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" - + xmlns:sf="clr-namespace:Syncfusion.Maui.Toolkit.SegmentedControl;assembly=Syncfusion.Maui.Toolkit" xmlns:pages="clr-namespace:MauiApp._1.Pages" - + xmlns:local="clr-namespace:MauiApp._1" Shell.FlyoutBehavior="Flyout" Title="MauiApp._1"> - + - + true enable enable - + XC0103 true @@ -69,7 +69,7 @@ - + diff --git a/src/Templates/src/templates/maui-mobile/MauiProgram.cs b/src/Templates/src/templates/maui-mobile/MauiProgram.cs index da81318ec5..3419fd4cd0 100644 --- a/src/Templates/src/templates/maui-mobile/MauiProgram.cs +++ b/src/Templates/src/templates/maui-mobile/MauiProgram.cs @@ -1,8 +1,8 @@ -#if (SampleContent) +#if (IncludeSampleContent) using CommunityToolkit.Maui; #endif using Microsoft.Extensions.Logging; -#if (SampleContent) +#if (IncludeSampleContent) using Syncfusion.Maui.Toolkit.Hosting; #endif @@ -15,7 +15,7 @@ public static class MauiProgram var builder = MauiApp.CreateBuilder(); builder .UseMauiApp() -#if (SampleContent) +#if (IncludeSampleContent) .UseMauiCommunityToolkit() .ConfigureSyncfusionToolkit() .ConfigureMauiHandlers(handlers => @@ -29,7 +29,7 @@ public static class MauiProgram { fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular"); fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold"); -#if (SampleContent) +#if (IncludeSampleContent) fonts.AddFont("SegoeUI-Semibold.ttf", "SegoeSemibold"); fonts.AddFont("FluentSystemIcons-Regular.ttf", FluentUI.FontFamily); #endif @@ -39,14 +39,14 @@ public static class MauiProgram #if DEBUG builder.Logging.AddDebug(); //+:cnd:noEmit -#if (SampleContent) +#if (IncludeSampleContent) builder.Services.AddLogging(configure => configure.AddDebug()); #endif //-:cnd:noEmit #endif //+:cnd:noEmit -#if (SampleContent) +#if (IncludeSampleContent) builder.Services.AddSingleton(); builder.Services.AddSingleton(); builder.Services.AddSingleton(); diff --git a/src/Templates/src/templates/maui-mobile/Resources/Styles/Colors.xaml b/src/Templates/src/templates/maui-mobile/Resources/Styles/Colors.xaml index 7bb974f6b9..47eee4433f 100644 --- a/src/Templates/src/templates/maui-mobile/Resources/Styles/Colors.xaml +++ b/src/Templates/src/templates/maui-mobile/Resources/Styles/Colors.xaml @@ -13,7 +13,7 @@ #9880e5 #2B0B98 - + #17171a #C3C3C3 #F2F2F2 diff --git a/src/Templates/src/templates/maui-mobile/Resources/Styles/Styles.xaml b/src/Templates/src/templates/maui-mobile/Resources/Styles/Styles.xaml index 2185e2edff..1d465aaf9e 100644 --- a/src/Templates/src/templates/maui-mobile/Resources/Styles/Styles.xaml +++ b/src/Templates/src/templates/maui-mobile/Resources/Styles/Styles.xaml @@ -2,11 +2,11 @@ + xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:shimmer="clr-namespace:Syncfusion.Maui.Toolkit.Shimmer;assembly=Syncfusion.Maui.Toolkit"> - + xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"> @@ -30,19 +30,19 @@ - +