From 3d4dbb2ea6a10ea770235260055b61728b2d0f33 Mon Sep 17 00:00:00 2001 From: Pierre Barjon Date: Tue, 19 Nov 2024 15:16:03 +0100 Subject: [PATCH 01/17] Update to .NET 9 --- .../.template.config/template.json | 26 +++++++++--- .../UnmarshalledJavaScriptExecutionHandler.cs | 42 ------------------- .../OpenSilverApplication.Browser.csproj | 7 ++-- .../Pages/Index.cs | 19 ++------- .../OpenSilverApplication.Browser/Program.cs | 15 ------- .../Properties/launchSettings.json | 9 ---- .../.template.config/template.json | 28 ++++++++++--- .../UnmarshalledJavaScriptExecutionHandler.cs | 42 ------------------- ...enSilverBusinessApplication.Browser.csproj | 7 ++-- .../Pages/Index.cs | 19 ++------- .../Program.cs | 15 ------- .../.template.config/template.json | 2 +- .../.template.config/template.json | 26 +++++++++--- .../UnmarshalledJavaScriptExecutionHandler.cs | 42 ------------------- .../OpenSilverApplication.Browser.csproj | 7 ++-- .../Pages/Index.cs | 19 ++------- .../OpenSilverApplication.Browser/Program.cs | 15 ------- .../Properties/launchSettings.json | 9 ---- .../.template.config/template.json | 2 +- .../OpenSilver.CLI.Templates.csproj | 4 +- .../.template.config/template.json | 26 +++++++++--- .../UnmarshalledJavaScriptExecutionHandler.cs | 42 ------------------- .../OpenSilverApplication.Browser.csproj | 7 ++-- .../Pages/Index.cs | 19 ++------- .../OpenSilverApplication.Browser/Program.cs | 15 ------- .../Properties/launchSettings.json | 9 ---- .../.template.config/template.json | 28 ++++++++++--- .../UnmarshalledJavaScriptExecutionHandler.cs | 42 ------------------- ...enSilverBusinessApplication.Browser.csproj | 7 ++-- .../Pages/Index.cs | 19 ++------- .../Program.cs | 15 ------- .../.template.config/template.json | 2 +- .../AppConfigurationWindow.xaml | 8 ++-- .../AppConfigurationWindow.xaml.cs | 6 +-- .../AppCustomizationWindow/DotNetVersion.cs | 4 +- .../AppCustomizationWizard.cs | 30 ++++--------- .../source.extension.vsixmanifest | 2 +- .../UnmarshalledJavaScriptExecutionHandler.cs | 42 ------------------- .../OpenSilverApplication.Browser.csproj | 5 +-- .../OpenSilverApplication.Browser.vstemplate | 3 -- .../Pages/Index.cs | 19 ++------- .../OpenSilverApplication.Browser/Program.cs | 17 +------- .../OpenSilverApplication.csproj | 2 +- .../OpenSilverApplication.vstemplate | 3 -- .../Properties/launchSettings.json | 9 ---- .../UnmarshalledJavaScriptExecutionHandler.cs | 42 ------------------- ...enSilverBusinessApplication.Browser.csproj | 5 +-- ...lverBusinessApplication.Browser.vstemplate | 3 -- .../Pages/Index.cs | 19 ++------- .../Program.cs | 15 ------- .../UnmarshalledJavaScriptExecutionHandler.cs | 42 ------------------- ...enSilverBusinessApplication.Browser.csproj | 5 +-- ...lverBusinessApplication.Browser.vstemplate | 3 -- .../Pages/Index.cs | 19 ++------- .../Program.cs | 15 ------- .../OpenSilverClassLibrary.csproj | 2 +- .../UnmarshalledJavaScriptExecutionHandler.cs | 42 ------------------- .../OpenSilverApplication.Browser.csproj | 5 +-- .../OpenSilverApplication.Browser.vstemplate | 3 -- .../Pages/Index.cs | 19 ++------- .../Program.cs | 17 +------- .../OpenSilverApplication.fsproj | 2 +- .../OpenSilverApplication.vstemplate | 3 -- .../Properties/launchSettings.json | 9 ---- .../OpenSilverClassLibrary.fsproj | 2 +- .../UnmarshalledJavaScriptExecutionHandler.cs | 42 ------------------- .../OpenSilverApplication.Browser.csproj | 5 +-- .../OpenSilverApplication.Browser.vstemplate | 3 -- .../Pages/Index.cs | 19 ++------- .../Program.cs | 17 +------- .../OpenSilverApplication.vbproj | 2 +- .../OpenSilverApplication.vstemplate | 3 -- .../Properties/launchSettings.json | 9 ---- .../OpenSilverClassLibrary.vbproj | 2 +- 74 files changed, 194 insertions(+), 916 deletions(-) delete mode 100644 src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication.Browser/Interop/UnmarshalledJavaScriptExecutionHandler.cs delete mode 100644 src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication/Properties/launchSettings.json delete mode 100644 src/OpenSilver.CLI/C#/OpenSilverBusinessApplication/OpenSilverBusinessApplication.Browser/Interop/UnmarshalledJavaScriptExecutionHandler.cs delete mode 100644 src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication.Browser/Interop/UnmarshalledJavaScriptExecutionHandler.cs delete mode 100644 src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication/Properties/launchSettings.json delete mode 100644 src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication.Browser/Interop/UnmarshalledJavaScriptExecutionHandler.cs delete mode 100644 src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication/Properties/launchSettings.json delete mode 100644 src/OpenSilver.CLI/VB/OpenSilverBusinessApplication/OpenSilverBusinessApplication.Browser/Interop/UnmarshalledJavaScriptExecutionHandler.cs delete mode 100644 src/OpenSilverApplicationTemplate/OpenSilverApplication.Browser/Interop/UnmarshalledJavaScriptExecutionHandler.cs delete mode 100644 src/OpenSilverApplicationTemplate/OpenSilverApplication/Properties/launchSettings.json delete mode 100644 src/OpenSilverBusinessApplicationTemplate/OpenSilverBusinessApplication.Browser/Interop/UnmarshalledJavaScriptExecutionHandler.cs delete mode 100644 src/OpenSilverBusinessVBApplicationTemplate/OpenSilverBusinessApplication.Browser/Interop/UnmarshalledJavaScriptExecutionHandler.cs delete mode 100644 src/OpenSilverFSApplicationTemplate/OpenSilverFSApplication.Browser/Interop/UnmarshalledJavaScriptExecutionHandler.cs delete mode 100644 src/OpenSilverFSApplicationTemplate/OpenSilverFSApplication/Properties/launchSettings.json delete mode 100644 src/OpenSilverVBApplicationTemplate/OpenSilverVBApplication.Browser/Interop/UnmarshalledJavaScriptExecutionHandler.cs delete mode 100644 src/OpenSilverVBApplicationTemplate/OpenSilverVBApplication/Properties/launchSettings.json diff --git a/src/OpenSilver.CLI/C#/OpenSilverApplication/.template.config/template.json b/src/OpenSilver.CLI/C#/OpenSilverApplication/.template.config/template.json index 3b85877..97cbdb3 100644 --- a/src/OpenSilver.CLI/C#/OpenSilverApplication/.template.config/template.json +++ b/src/OpenSilver.CLI/C#/OpenSilverApplication/.template.config/template.json @@ -53,9 +53,9 @@ "targetFramework": { "type": "parameter", "datatype": "string", - "description": "Sets the target .NET framework, must be net7.0 or net8.0", - "defaultValue": "net8.0", - "replaces": "net8.0", + "description": "Sets the target .NET framework, must be net7.0, net8.0 or net9.0", + "defaultValue": "net9.0", + "replaces": "net9.0", "choices": [ { "choice": "net7.0", @@ -64,6 +64,10 @@ { "choice": "net8.0", "description": "Use .NET 8.0" + }, + { + "choice": "net9.0", + "description": "Use .NET 9.0" } ] }, @@ -72,7 +76,7 @@ "generator": "constant", "replaces": "OpenSilverPackageVersion", "parameters": { - "value": "3.0.1" + "value": "3.1.0" } }, "openSilverSimulatorPackageVersion": { @@ -80,7 +84,15 @@ "generator": "constant", "replaces": "OpenSilverSimulatorPackageVersion", "parameters": { - "value": "3.0.0" + "value": "3.1.0" + } + }, + "openSilverWebAssemblyPackageVersion": { + "type": "generated", + "generator": "constant", + "replaces": "OpenSilverWebAssemblyPackageVersion", + "parameters": { + "value": "3.1.0" } }, "webAssemblyPackageVersion": { @@ -98,6 +110,10 @@ { "condition": "(targetFramework == 'net8.0')", "value": "8.0.0" + }, + { + "condition": "(targetFramework == 'net9.0')", + "value": "9.0.0" } ] } diff --git a/src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication.Browser/Interop/UnmarshalledJavaScriptExecutionHandler.cs b/src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication.Browser/Interop/UnmarshalledJavaScriptExecutionHandler.cs deleted file mode 100644 index 9aa1185..0000000 --- a/src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication.Browser/Interop/UnmarshalledJavaScriptExecutionHandler.cs +++ /dev/null @@ -1,42 +0,0 @@ -using DotNetForHtml5; -using Microsoft.JSInterop; -using Microsoft.JSInterop.WebAssembly; - -namespace OpenSilverApplication.Browser.Interop -{ - public class UnmarshalledJavaScriptExecutionHandler : IWebAssemblyExecutionHandler - { - private const string MethodName = "callJSUnmarshalled_v2"; - private readonly WebAssemblyJSRuntime _runtime; - - public UnmarshalledJavaScriptExecutionHandler(IJSRuntime runtime) - { - _runtime = runtime as WebAssemblyJSRuntime; - } - - public void ExecuteJavaScript(string javaScriptToExecute) - { - _runtime.InvokeUnmarshalled(MethodName, javaScriptToExecute); - } - - public object ExecuteJavaScriptWithResult(string javaScriptToExecute) - { - return _runtime.InvokeUnmarshalled(MethodName, javaScriptToExecute); - } - - public TResult InvokeUnmarshalled(string identifier, T0 arg0) - { - return _runtime.InvokeUnmarshalled(identifier, arg0); - } - - public TResult InvokeUnmarshalled(string identifier, T0 arg0, T1 arg1) - { - return _runtime.InvokeUnmarshalled(identifier, arg0, arg1); - } - - public TResult InvokeUnmarshalled(string identifier, T0 arg0, T1 arg1, T2 arg2) - { - return _runtime.InvokeUnmarshalled(identifier, arg0, arg1, arg2); - } - } -} \ No newline at end of file diff --git a/src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication.Browser/OpenSilverApplication.Browser.csproj b/src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication.Browser/OpenSilverApplication.Browser.csproj index 95d6566..f8c97ee 100644 --- a/src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication.Browser/OpenSilverApplication.Browser.csproj +++ b/src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication.Browser/OpenSilverApplication.Browser.csproj @@ -1,9 +1,8 @@  - net8.0 - True - 6 + net9.0 + 7 true false @@ -13,7 +12,7 @@ - + diff --git a/src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication.Browser/Pages/Index.cs b/src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication.Browser/Pages/Index.cs index 18a8b70..b9ba02e 100644 --- a/src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication.Browser/Pages/Index.cs +++ b/src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication.Browser/Pages/Index.cs @@ -1,10 +1,7 @@ -using DotNetForHtml5; -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components.Rendering; -using Microsoft.JSInterop; -using OpenSilverApplication.Browser.Interop; -using System; using System.Threading.Tasks; +using OpenSilver.WebAssembly; namespace OpenSilverApplication.Browser.Pages { @@ -18,17 +15,7 @@ protected override void BuildRenderTree(RenderTreeBuilder __builder) protected async override Task OnInitializedAsync() { await base.OnInitializedAsync(); - - if (!await JSRuntime.InvokeAsync("getOSFilesLoadedPromise")) - { - throw new InvalidOperationException("Failed to initialize OpenSilver. Check your browser's console for error details."); - } - - Cshtml5Initializer.Initialize(new UnmarshalledJavaScriptExecutionHandler(JSRuntime)); - Program.RunApplication(); + await Runner.RunApplicationAsync(); } - - [Inject] - private IJSRuntime JSRuntime { get; set; } } } \ No newline at end of file diff --git a/src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication.Browser/Program.cs b/src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication.Browser/Program.cs index 6bdf067..a654b19 100644 --- a/src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication.Browser/Program.cs +++ b/src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication.Browser/Program.cs @@ -1,9 +1,5 @@ using Microsoft.AspNetCore.Components.WebAssembly.Hosting; -using Microsoft.Extensions.DependencyInjection; -using System; -using System.Net.Http; using System.Threading.Tasks; -using System.Windows; namespace OpenSilverApplication.Browser { @@ -13,19 +9,8 @@ public static async Task Main(string[] args) { var builder = WebAssemblyHostBuilder.CreateDefault(args); builder.RootComponents.Add("#app"); - - builder.Services.AddTransient(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); - var host = builder.Build(); await host.RunAsync(); } - - public static void RunApplication() - { - Application.RunApplication(() => - { - var app = new OpenSilverApplication.App(); - }); - } } } diff --git a/src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication/Properties/launchSettings.json b/src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication/Properties/launchSettings.json deleted file mode 100644 index 2199f6e..0000000 --- a/src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication/Properties/launchSettings.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "profiles": { - "OpenSilverApplication": { - "commandName": "Executable", - "executablePath": "cmd", - "commandLineArgs": "/c start \"\" \"http://www.opensilver.net/permalinks/wrong_startup_project.aspx\"" - } - } -} \ No newline at end of file diff --git a/src/OpenSilver.CLI/C#/OpenSilverBusinessApplication/.template.config/template.json b/src/OpenSilver.CLI/C#/OpenSilverBusinessApplication/.template.config/template.json index f677723..e52e2cd 100644 --- a/src/OpenSilver.CLI/C#/OpenSilverBusinessApplication/.template.config/template.json +++ b/src/OpenSilver.CLI/C#/OpenSilverBusinessApplication/.template.config/template.json @@ -39,9 +39,9 @@ "targetFramework": { "type": "parameter", "datatype": "string", - "description": "Sets the target .NET framework, must be net7.0 or net8.0", - "defaultValue": "net8.0", - "replaces": "net8.0", + "description": "Sets the target .NET framework, must be net7.0, net8.0 or net9.0", + "defaultValue": "net9.0", + "replaces": "net9.0", "choices": [ { "choice": "net7.0", @@ -50,6 +50,10 @@ { "choice": "net8.0", "description": "Use .NET 8.0" + }, + { + "choice": "net9.0", + "description": "Use .NET 9.0" } ] }, @@ -58,7 +62,7 @@ "generator": "constant", "replaces": "OpenSilverPackageVersion", "parameters": { - "value": "3.0.1" + "value": "3.1.0" } }, "openSilverSimulatorPackageVersion": { @@ -66,7 +70,15 @@ "generator": "constant", "replaces": "OpenSilverSimulatorPackageVersion", "parameters": { - "value": "3.0.0" + "value": "3.1.0" + } + }, + "openSilverWebAssemblyPackageVersion": { + "type": "generated", + "generator": "constant", + "replaces": "OpenSilverWebAssemblyPackageVersion", + "parameters": { + "value": "3.1.0" } }, "openSilverOpenRiaPackageVersion": { @@ -74,7 +86,7 @@ "generator": "constant", "replaces": "OpenSilverOpenRiaPackageVersion", "parameters": { - "value": "3.0.0" + "value": "3.1.0" } }, "webAssemblyPackageVersion": { @@ -92,6 +104,10 @@ { "condition": "(targetFramework == 'net8.0')", "value": "8.0.0" + }, + { + "condition": "(targetFramework == 'net9.0')", + "value": "9.0.0" } ] } diff --git a/src/OpenSilver.CLI/C#/OpenSilverBusinessApplication/OpenSilverBusinessApplication.Browser/Interop/UnmarshalledJavaScriptExecutionHandler.cs b/src/OpenSilver.CLI/C#/OpenSilverBusinessApplication/OpenSilverBusinessApplication.Browser/Interop/UnmarshalledJavaScriptExecutionHandler.cs deleted file mode 100644 index 38c6b1f..0000000 --- a/src/OpenSilver.CLI/C#/OpenSilverBusinessApplication/OpenSilverBusinessApplication.Browser/Interop/UnmarshalledJavaScriptExecutionHandler.cs +++ /dev/null @@ -1,42 +0,0 @@ -using DotNetForHtml5; -using Microsoft.JSInterop; -using Microsoft.JSInterop.WebAssembly; - -namespace OpenSilverBusinessApplication.Browser.Interop -{ - public class UnmarshalledJavaScriptExecutionHandler : IWebAssemblyExecutionHandler - { - private const string MethodName = "callJSUnmarshalled_v2"; - private readonly WebAssemblyJSRuntime _runtime; - - public UnmarshalledJavaScriptExecutionHandler(IJSRuntime runtime) - { - _runtime = runtime as WebAssemblyJSRuntime; - } - - public void ExecuteJavaScript(string javaScriptToExecute) - { - _runtime.InvokeUnmarshalled(MethodName, javaScriptToExecute); - } - - public object ExecuteJavaScriptWithResult(string javaScriptToExecute) - { - return _runtime.InvokeUnmarshalled(MethodName, javaScriptToExecute); - } - - public TResult InvokeUnmarshalled(string identifier, T0 arg0) - { - return _runtime.InvokeUnmarshalled(identifier, arg0); - } - - public TResult InvokeUnmarshalled(string identifier, T0 arg0, T1 arg1) - { - return _runtime.InvokeUnmarshalled(identifier, arg0, arg1); - } - - public TResult InvokeUnmarshalled(string identifier, T0 arg0, T1 arg1, T2 arg2) - { - return _runtime.InvokeUnmarshalled(identifier, arg0, arg1, arg2); - } - } -} \ No newline at end of file diff --git a/src/OpenSilver.CLI/C#/OpenSilverBusinessApplication/OpenSilverBusinessApplication.Browser/OpenSilverBusinessApplication.Browser.csproj b/src/OpenSilver.CLI/C#/OpenSilverBusinessApplication/OpenSilverBusinessApplication.Browser/OpenSilverBusinessApplication.Browser.csproj index edb8756..8db4489 100644 --- a/src/OpenSilver.CLI/C#/OpenSilverBusinessApplication/OpenSilverBusinessApplication.Browser/OpenSilverBusinessApplication.Browser.csproj +++ b/src/OpenSilver.CLI/C#/OpenSilverBusinessApplication/OpenSilverBusinessApplication.Browser/OpenSilverBusinessApplication.Browser.csproj @@ -1,9 +1,8 @@  - net8.0 - True - 6 + net9.0 + 7 true false @@ -13,7 +12,7 @@ - + diff --git a/src/OpenSilver.CLI/C#/OpenSilverBusinessApplication/OpenSilverBusinessApplication.Browser/Pages/Index.cs b/src/OpenSilver.CLI/C#/OpenSilverBusinessApplication/OpenSilverBusinessApplication.Browser/Pages/Index.cs index 106a7a9..3497ecf 100644 --- a/src/OpenSilver.CLI/C#/OpenSilverBusinessApplication/OpenSilverBusinessApplication.Browser/Pages/Index.cs +++ b/src/OpenSilver.CLI/C#/OpenSilverBusinessApplication/OpenSilverBusinessApplication.Browser/Pages/Index.cs @@ -1,10 +1,7 @@ -using DotNetForHtml5; -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components.Rendering; -using Microsoft.JSInterop; -using OpenSilverBusinessApplication.Browser.Interop; -using System; using System.Threading.Tasks; +using OpenSilver.WebAssembly; namespace OpenSilverBusinessApplication.Browser.Pages { @@ -18,17 +15,7 @@ protected override void BuildRenderTree(RenderTreeBuilder __builder) protected async override Task OnInitializedAsync() { await base.OnInitializedAsync(); - - if (!await JSRuntime.InvokeAsync("getOSFilesLoadedPromise")) - { - throw new InvalidOperationException("Failed to initialize OpenSilver. Check your browser's console for error details."); - } - - Cshtml5Initializer.Initialize(new UnmarshalledJavaScriptExecutionHandler(JSRuntime)); - Program.RunApplication(); + await Runner.RunApplicationAsync(); } - - [Inject] - private IJSRuntime JSRuntime { get; set; } } } \ No newline at end of file diff --git a/src/OpenSilver.CLI/C#/OpenSilverBusinessApplication/OpenSilverBusinessApplication.Browser/Program.cs b/src/OpenSilver.CLI/C#/OpenSilverBusinessApplication/OpenSilverBusinessApplication.Browser/Program.cs index d63b199..a775186 100644 --- a/src/OpenSilver.CLI/C#/OpenSilverBusinessApplication/OpenSilverBusinessApplication.Browser/Program.cs +++ b/src/OpenSilver.CLI/C#/OpenSilverBusinessApplication/OpenSilverBusinessApplication.Browser/Program.cs @@ -1,9 +1,5 @@ using Microsoft.AspNetCore.Components.WebAssembly.Hosting; -using Microsoft.Extensions.DependencyInjection; -using System; -using System.Net.Http; using System.Threading.Tasks; -using System.Windows; namespace OpenSilverBusinessApplication.Browser { @@ -13,19 +9,8 @@ public static async Task Main(string[] args) { var builder = WebAssemblyHostBuilder.CreateDefault(args); builder.RootComponents.Add("#app"); - - builder.Services.AddTransient(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); - var host = builder.Build(); await host.RunAsync(); } - - public static void RunApplication() - { - Application.RunApplication(() => - { - var app = new OpenSilverBusinessApplication.App(); - }); - } } } diff --git a/src/OpenSilver.CLI/C#/OpenSilverClassLibrary/.template.config/template.json b/src/OpenSilver.CLI/C#/OpenSilverClassLibrary/.template.config/template.json index 2a3946a..edba567 100644 --- a/src/OpenSilver.CLI/C#/OpenSilverClassLibrary/.template.config/template.json +++ b/src/OpenSilver.CLI/C#/OpenSilverClassLibrary/.template.config/template.json @@ -35,7 +35,7 @@ "generator": "constant", "replaces": "OpenSilverPackageVersion", "parameters": { - "value": "3.0.1" + "value": "3.1.0" } } }, diff --git a/src/OpenSilver.CLI/F#/OpenSilverApplication/.template.config/template.json b/src/OpenSilver.CLI/F#/OpenSilverApplication/.template.config/template.json index 72c75e0..54c82a1 100644 --- a/src/OpenSilver.CLI/F#/OpenSilverApplication/.template.config/template.json +++ b/src/OpenSilver.CLI/F#/OpenSilverApplication/.template.config/template.json @@ -53,9 +53,9 @@ "targetFramework": { "type": "parameter", "datatype": "string", - "description": "Sets the target .NET framework, must be net7.0 or net8.0", - "defaultValue": "net8.0", - "replaces": "net8.0", + "description": "Sets the target .NET framework, must be net7.0, net8.0 or net9.0", + "defaultValue": "net9.0", + "replaces": "net9.0", "choices": [ { "choice": "net7.0", @@ -64,6 +64,10 @@ { "choice": "net8.0", "description": "Use .NET 8.0" + }, + { + "choice": "net9.0", + "description": "Use .NET 9.0" } ] }, @@ -72,7 +76,7 @@ "generator": "constant", "replaces": "OpenSilverPackageVersion", "parameters": { - "value": "3.0.1" + "value": "3.1.0" } }, "openSilverSimulatorPackageVersion": { @@ -80,7 +84,15 @@ "generator": "constant", "replaces": "OpenSilverSimulatorPackageVersion", "parameters": { - "value": "3.0.0" + "value": "3.1.0" + } + }, + "openSilverWebAssemblyPackageVersion": { + "type": "generated", + "generator": "constant", + "replaces": "OpenSilverWebAssemblyPackageVersion", + "parameters": { + "value": "3.1.0" } }, "webAssemblyPackageVersion": { @@ -98,6 +110,10 @@ { "condition": "(targetFramework == 'net8.0')", "value": "8.0.0" + }, + { + "condition": "(targetFramework == 'net9.0')", + "value": "9.0.0" } ] } diff --git a/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication.Browser/Interop/UnmarshalledJavaScriptExecutionHandler.cs b/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication.Browser/Interop/UnmarshalledJavaScriptExecutionHandler.cs deleted file mode 100644 index 9aa1185..0000000 --- a/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication.Browser/Interop/UnmarshalledJavaScriptExecutionHandler.cs +++ /dev/null @@ -1,42 +0,0 @@ -using DotNetForHtml5; -using Microsoft.JSInterop; -using Microsoft.JSInterop.WebAssembly; - -namespace OpenSilverApplication.Browser.Interop -{ - public class UnmarshalledJavaScriptExecutionHandler : IWebAssemblyExecutionHandler - { - private const string MethodName = "callJSUnmarshalled_v2"; - private readonly WebAssemblyJSRuntime _runtime; - - public UnmarshalledJavaScriptExecutionHandler(IJSRuntime runtime) - { - _runtime = runtime as WebAssemblyJSRuntime; - } - - public void ExecuteJavaScript(string javaScriptToExecute) - { - _runtime.InvokeUnmarshalled(MethodName, javaScriptToExecute); - } - - public object ExecuteJavaScriptWithResult(string javaScriptToExecute) - { - return _runtime.InvokeUnmarshalled(MethodName, javaScriptToExecute); - } - - public TResult InvokeUnmarshalled(string identifier, T0 arg0) - { - return _runtime.InvokeUnmarshalled(identifier, arg0); - } - - public TResult InvokeUnmarshalled(string identifier, T0 arg0, T1 arg1) - { - return _runtime.InvokeUnmarshalled(identifier, arg0, arg1); - } - - public TResult InvokeUnmarshalled(string identifier, T0 arg0, T1 arg1, T2 arg2) - { - return _runtime.InvokeUnmarshalled(identifier, arg0, arg1, arg2); - } - } -} \ No newline at end of file diff --git a/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication.Browser/OpenSilverApplication.Browser.csproj b/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication.Browser/OpenSilverApplication.Browser.csproj index e68c8b3..2d34628 100644 --- a/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication.Browser/OpenSilverApplication.Browser.csproj +++ b/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication.Browser/OpenSilverApplication.Browser.csproj @@ -1,9 +1,8 @@  - net8.0 - True - 6 + net9.0 + 7 true false @@ -13,7 +12,7 @@ - + diff --git a/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication.Browser/Pages/Index.cs b/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication.Browser/Pages/Index.cs index 18a8b70..b9ba02e 100644 --- a/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication.Browser/Pages/Index.cs +++ b/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication.Browser/Pages/Index.cs @@ -1,10 +1,7 @@ -using DotNetForHtml5; -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components.Rendering; -using Microsoft.JSInterop; -using OpenSilverApplication.Browser.Interop; -using System; using System.Threading.Tasks; +using OpenSilver.WebAssembly; namespace OpenSilverApplication.Browser.Pages { @@ -18,17 +15,7 @@ protected override void BuildRenderTree(RenderTreeBuilder __builder) protected async override Task OnInitializedAsync() { await base.OnInitializedAsync(); - - if (!await JSRuntime.InvokeAsync("getOSFilesLoadedPromise")) - { - throw new InvalidOperationException("Failed to initialize OpenSilver. Check your browser's console for error details."); - } - - Cshtml5Initializer.Initialize(new UnmarshalledJavaScriptExecutionHandler(JSRuntime)); - Program.RunApplication(); + await Runner.RunApplicationAsync(); } - - [Inject] - private IJSRuntime JSRuntime { get; set; } } } \ No newline at end of file diff --git a/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication.Browser/Program.cs b/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication.Browser/Program.cs index 6bdf067..a654b19 100644 --- a/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication.Browser/Program.cs +++ b/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication.Browser/Program.cs @@ -1,9 +1,5 @@ using Microsoft.AspNetCore.Components.WebAssembly.Hosting; -using Microsoft.Extensions.DependencyInjection; -using System; -using System.Net.Http; using System.Threading.Tasks; -using System.Windows; namespace OpenSilverApplication.Browser { @@ -13,19 +9,8 @@ public static async Task Main(string[] args) { var builder = WebAssemblyHostBuilder.CreateDefault(args); builder.RootComponents.Add("#app"); - - builder.Services.AddTransient(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); - var host = builder.Build(); await host.RunAsync(); } - - public static void RunApplication() - { - Application.RunApplication(() => - { - var app = new OpenSilverApplication.App(); - }); - } } } diff --git a/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication/Properties/launchSettings.json b/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication/Properties/launchSettings.json deleted file mode 100644 index 2199f6e..0000000 --- a/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication/Properties/launchSettings.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "profiles": { - "OpenSilverApplication": { - "commandName": "Executable", - "executablePath": "cmd", - "commandLineArgs": "/c start \"\" \"http://www.opensilver.net/permalinks/wrong_startup_project.aspx\"" - } - } -} \ No newline at end of file diff --git a/src/OpenSilver.CLI/F#/OpenSilverClassLibrary/.template.config/template.json b/src/OpenSilver.CLI/F#/OpenSilverClassLibrary/.template.config/template.json index 7c8a62f..2be96af 100644 --- a/src/OpenSilver.CLI/F#/OpenSilverClassLibrary/.template.config/template.json +++ b/src/OpenSilver.CLI/F#/OpenSilverClassLibrary/.template.config/template.json @@ -35,7 +35,7 @@ "generator": "constant", "replaces": "OpenSilverPackageVersion", "parameters": { - "value": "3.0.1" + "value": "3.1.0" } } }, diff --git a/src/OpenSilver.CLI/OpenSilver.CLI.Templates.csproj b/src/OpenSilver.CLI/OpenSilver.CLI.Templates.csproj index e19abd9..41a737c 100644 --- a/src/OpenSilver.CLI/OpenSilver.CLI.Templates.csproj +++ b/src/OpenSilver.CLI/OpenSilver.CLI.Templates.csproj @@ -12,7 +12,7 @@ Template - 3.0.0 + 3.1.0 OpenSilver.Templates Opensilver CLI templates Userware @@ -33,7 +33,7 @@ - + diff --git a/src/OpenSilver.CLI/VB/OpenSilverApplication/.template.config/template.json b/src/OpenSilver.CLI/VB/OpenSilverApplication/.template.config/template.json index bca564b..88e2486 100644 --- a/src/OpenSilver.CLI/VB/OpenSilverApplication/.template.config/template.json +++ b/src/OpenSilver.CLI/VB/OpenSilverApplication/.template.config/template.json @@ -53,9 +53,9 @@ "targetFramework": { "type": "parameter", "datatype": "string", - "description": "Sets the target .NET framework, must be net7.0 or net8.0", - "defaultValue": "net8.0", - "replaces": "net8.0", + "description": "Sets the target .NET framework, must be net7.0, net8.0 or net9.0", + "defaultValue": "net9.0", + "replaces": "net9.0", "choices": [ { "choice": "net7.0", @@ -64,6 +64,10 @@ { "choice": "net8.0", "description": "Use .NET 8.0" + }, + { + "choice": "net9.0", + "description": "Use .NET 9.0" } ] }, @@ -72,7 +76,7 @@ "generator": "constant", "replaces": "OpenSilverPackageVersion", "parameters": { - "value": "3.0.1" + "value": "3.1.0" } }, "openSilverSimulatorPackageVersion": { @@ -80,7 +84,15 @@ "generator": "constant", "replaces": "OpenSilverSimulatorPackageVersion", "parameters": { - "value": "3.0.0" + "value": "3.1.0" + } + }, + "openSilverWebAssemblyPackageVersion": { + "type": "generated", + "generator": "constant", + "replaces": "OpenSilverWebAssemblyPackageVersion", + "parameters": { + "value": "3.1.0" } }, "webAssemblyPackageVersion": { @@ -98,6 +110,10 @@ { "condition": "(targetFramework == 'net8.0')", "value": "8.0.0" + }, + { + "condition": "(targetFramework == 'net9.0')", + "value": "9.0.0" } ] } diff --git a/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication.Browser/Interop/UnmarshalledJavaScriptExecutionHandler.cs b/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication.Browser/Interop/UnmarshalledJavaScriptExecutionHandler.cs deleted file mode 100644 index 9aa1185..0000000 --- a/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication.Browser/Interop/UnmarshalledJavaScriptExecutionHandler.cs +++ /dev/null @@ -1,42 +0,0 @@ -using DotNetForHtml5; -using Microsoft.JSInterop; -using Microsoft.JSInterop.WebAssembly; - -namespace OpenSilverApplication.Browser.Interop -{ - public class UnmarshalledJavaScriptExecutionHandler : IWebAssemblyExecutionHandler - { - private const string MethodName = "callJSUnmarshalled_v2"; - private readonly WebAssemblyJSRuntime _runtime; - - public UnmarshalledJavaScriptExecutionHandler(IJSRuntime runtime) - { - _runtime = runtime as WebAssemblyJSRuntime; - } - - public void ExecuteJavaScript(string javaScriptToExecute) - { - _runtime.InvokeUnmarshalled(MethodName, javaScriptToExecute); - } - - public object ExecuteJavaScriptWithResult(string javaScriptToExecute) - { - return _runtime.InvokeUnmarshalled(MethodName, javaScriptToExecute); - } - - public TResult InvokeUnmarshalled(string identifier, T0 arg0) - { - return _runtime.InvokeUnmarshalled(identifier, arg0); - } - - public TResult InvokeUnmarshalled(string identifier, T0 arg0, T1 arg1) - { - return _runtime.InvokeUnmarshalled(identifier, arg0, arg1); - } - - public TResult InvokeUnmarshalled(string identifier, T0 arg0, T1 arg1, T2 arg2) - { - return _runtime.InvokeUnmarshalled(identifier, arg0, arg1, arg2); - } - } -} \ No newline at end of file diff --git a/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication.Browser/OpenSilverApplication.Browser.csproj b/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication.Browser/OpenSilverApplication.Browser.csproj index 5a66e1b..96b911b 100644 --- a/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication.Browser/OpenSilverApplication.Browser.csproj +++ b/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication.Browser/OpenSilverApplication.Browser.csproj @@ -1,9 +1,8 @@  - net8.0 - True - 6 + net9.0 + 7 true false @@ -13,7 +12,7 @@ - + diff --git a/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication.Browser/Pages/Index.cs b/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication.Browser/Pages/Index.cs index 18a8b70..b9ba02e 100644 --- a/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication.Browser/Pages/Index.cs +++ b/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication.Browser/Pages/Index.cs @@ -1,10 +1,7 @@ -using DotNetForHtml5; -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components.Rendering; -using Microsoft.JSInterop; -using OpenSilverApplication.Browser.Interop; -using System; using System.Threading.Tasks; +using OpenSilver.WebAssembly; namespace OpenSilverApplication.Browser.Pages { @@ -18,17 +15,7 @@ protected override void BuildRenderTree(RenderTreeBuilder __builder) protected async override Task OnInitializedAsync() { await base.OnInitializedAsync(); - - if (!await JSRuntime.InvokeAsync("getOSFilesLoadedPromise")) - { - throw new InvalidOperationException("Failed to initialize OpenSilver. Check your browser's console for error details."); - } - - Cshtml5Initializer.Initialize(new UnmarshalledJavaScriptExecutionHandler(JSRuntime)); - Program.RunApplication(); + await Runner.RunApplicationAsync(); } - - [Inject] - private IJSRuntime JSRuntime { get; set; } } } \ No newline at end of file diff --git a/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication.Browser/Program.cs b/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication.Browser/Program.cs index 6bdf067..a654b19 100644 --- a/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication.Browser/Program.cs +++ b/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication.Browser/Program.cs @@ -1,9 +1,5 @@ using Microsoft.AspNetCore.Components.WebAssembly.Hosting; -using Microsoft.Extensions.DependencyInjection; -using System; -using System.Net.Http; using System.Threading.Tasks; -using System.Windows; namespace OpenSilverApplication.Browser { @@ -13,19 +9,8 @@ public static async Task Main(string[] args) { var builder = WebAssemblyHostBuilder.CreateDefault(args); builder.RootComponents.Add("#app"); - - builder.Services.AddTransient(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); - var host = builder.Build(); await host.RunAsync(); } - - public static void RunApplication() - { - Application.RunApplication(() => - { - var app = new OpenSilverApplication.App(); - }); - } } } diff --git a/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication/Properties/launchSettings.json b/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication/Properties/launchSettings.json deleted file mode 100644 index 2199f6e..0000000 --- a/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication/Properties/launchSettings.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "profiles": { - "OpenSilverApplication": { - "commandName": "Executable", - "executablePath": "cmd", - "commandLineArgs": "/c start \"\" \"http://www.opensilver.net/permalinks/wrong_startup_project.aspx\"" - } - } -} \ No newline at end of file diff --git a/src/OpenSilver.CLI/VB/OpenSilverBusinessApplication/.template.config/template.json b/src/OpenSilver.CLI/VB/OpenSilverBusinessApplication/.template.config/template.json index 66fec2c..4484cb4 100644 --- a/src/OpenSilver.CLI/VB/OpenSilverBusinessApplication/.template.config/template.json +++ b/src/OpenSilver.CLI/VB/OpenSilverBusinessApplication/.template.config/template.json @@ -39,9 +39,9 @@ "targetFramework": { "type": "parameter", "datatype": "string", - "description": "Sets the target .NET framework, must be net7.0 or net8.0", - "defaultValue": "net8.0", - "replaces": "net8.0", + "description": "Sets the target .NET framework, must be net7.0, net8.0 or net9.0", + "defaultValue": "net9.0", + "replaces": "net9.0", "choices": [ { "choice": "net7.0", @@ -50,6 +50,10 @@ { "choice": "net8.0", "description": "Use .NET 8.0" + }, + { + "choice": "net9.0", + "description": "Use .NET 9.0" } ] }, @@ -58,7 +62,7 @@ "generator": "constant", "replaces": "OpenSilverPackageVersion", "parameters": { - "value": "3.0.1" + "value": "3.1.0" } }, "openSilverSimulatorPackageVersion": { @@ -66,7 +70,15 @@ "generator": "constant", "replaces": "OpenSilverSimulatorPackageVersion", "parameters": { - "value": "3.0.0" + "value": "3.1.0" + } + }, + "openSilverWebAssemblyPackageVersion": { + "type": "generated", + "generator": "constant", + "replaces": "OpenSilverWebAssemblyPackageVersion", + "parameters": { + "value": "3.1.0" } }, "openSilverOpenRiaPackageVersion": { @@ -74,7 +86,7 @@ "generator": "constant", "replaces": "OpenSilverOpenRiaPackageVersion", "parameters": { - "value": "3.0.0" + "value": "3.1.0" } }, "webAssemblyPackageVersion": { @@ -92,6 +104,10 @@ { "condition": "(targetFramework == 'net8.0')", "value": "8.0.0" + }, + { + "condition": "(targetFramework == 'net9.0')", + "value": "9.0.0" } ] } diff --git a/src/OpenSilver.CLI/VB/OpenSilverBusinessApplication/OpenSilverBusinessApplication.Browser/Interop/UnmarshalledJavaScriptExecutionHandler.cs b/src/OpenSilver.CLI/VB/OpenSilverBusinessApplication/OpenSilverBusinessApplication.Browser/Interop/UnmarshalledJavaScriptExecutionHandler.cs deleted file mode 100644 index 38c6b1f..0000000 --- a/src/OpenSilver.CLI/VB/OpenSilverBusinessApplication/OpenSilverBusinessApplication.Browser/Interop/UnmarshalledJavaScriptExecutionHandler.cs +++ /dev/null @@ -1,42 +0,0 @@ -using DotNetForHtml5; -using Microsoft.JSInterop; -using Microsoft.JSInterop.WebAssembly; - -namespace OpenSilverBusinessApplication.Browser.Interop -{ - public class UnmarshalledJavaScriptExecutionHandler : IWebAssemblyExecutionHandler - { - private const string MethodName = "callJSUnmarshalled_v2"; - private readonly WebAssemblyJSRuntime _runtime; - - public UnmarshalledJavaScriptExecutionHandler(IJSRuntime runtime) - { - _runtime = runtime as WebAssemblyJSRuntime; - } - - public void ExecuteJavaScript(string javaScriptToExecute) - { - _runtime.InvokeUnmarshalled(MethodName, javaScriptToExecute); - } - - public object ExecuteJavaScriptWithResult(string javaScriptToExecute) - { - return _runtime.InvokeUnmarshalled(MethodName, javaScriptToExecute); - } - - public TResult InvokeUnmarshalled(string identifier, T0 arg0) - { - return _runtime.InvokeUnmarshalled(identifier, arg0); - } - - public TResult InvokeUnmarshalled(string identifier, T0 arg0, T1 arg1) - { - return _runtime.InvokeUnmarshalled(identifier, arg0, arg1); - } - - public TResult InvokeUnmarshalled(string identifier, T0 arg0, T1 arg1, T2 arg2) - { - return _runtime.InvokeUnmarshalled(identifier, arg0, arg1, arg2); - } - } -} \ No newline at end of file diff --git a/src/OpenSilver.CLI/VB/OpenSilverBusinessApplication/OpenSilverBusinessApplication.Browser/OpenSilverBusinessApplication.Browser.csproj b/src/OpenSilver.CLI/VB/OpenSilverBusinessApplication/OpenSilverBusinessApplication.Browser/OpenSilverBusinessApplication.Browser.csproj index a180d11..2211bc5 100644 --- a/src/OpenSilver.CLI/VB/OpenSilverBusinessApplication/OpenSilverBusinessApplication.Browser/OpenSilverBusinessApplication.Browser.csproj +++ b/src/OpenSilver.CLI/VB/OpenSilverBusinessApplication/OpenSilverBusinessApplication.Browser/OpenSilverBusinessApplication.Browser.csproj @@ -1,9 +1,8 @@  - net8.0 - True - 6 + net9.0 + 7 true false @@ -13,7 +12,7 @@ - + diff --git a/src/OpenSilver.CLI/VB/OpenSilverBusinessApplication/OpenSilverBusinessApplication.Browser/Pages/Index.cs b/src/OpenSilver.CLI/VB/OpenSilverBusinessApplication/OpenSilverBusinessApplication.Browser/Pages/Index.cs index 106a7a9..3497ecf 100644 --- a/src/OpenSilver.CLI/VB/OpenSilverBusinessApplication/OpenSilverBusinessApplication.Browser/Pages/Index.cs +++ b/src/OpenSilver.CLI/VB/OpenSilverBusinessApplication/OpenSilverBusinessApplication.Browser/Pages/Index.cs @@ -1,10 +1,7 @@ -using DotNetForHtml5; -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components.Rendering; -using Microsoft.JSInterop; -using OpenSilverBusinessApplication.Browser.Interop; -using System; using System.Threading.Tasks; +using OpenSilver.WebAssembly; namespace OpenSilverBusinessApplication.Browser.Pages { @@ -18,17 +15,7 @@ protected override void BuildRenderTree(RenderTreeBuilder __builder) protected async override Task OnInitializedAsync() { await base.OnInitializedAsync(); - - if (!await JSRuntime.InvokeAsync("getOSFilesLoadedPromise")) - { - throw new InvalidOperationException("Failed to initialize OpenSilver. Check your browser's console for error details."); - } - - Cshtml5Initializer.Initialize(new UnmarshalledJavaScriptExecutionHandler(JSRuntime)); - Program.RunApplication(); + await Runner.RunApplicationAsync(); } - - [Inject] - private IJSRuntime JSRuntime { get; set; } } } \ No newline at end of file diff --git a/src/OpenSilver.CLI/VB/OpenSilverBusinessApplication/OpenSilverBusinessApplication.Browser/Program.cs b/src/OpenSilver.CLI/VB/OpenSilverBusinessApplication/OpenSilverBusinessApplication.Browser/Program.cs index d63b199..a775186 100644 --- a/src/OpenSilver.CLI/VB/OpenSilverBusinessApplication/OpenSilverBusinessApplication.Browser/Program.cs +++ b/src/OpenSilver.CLI/VB/OpenSilverBusinessApplication/OpenSilverBusinessApplication.Browser/Program.cs @@ -1,9 +1,5 @@ using Microsoft.AspNetCore.Components.WebAssembly.Hosting; -using Microsoft.Extensions.DependencyInjection; -using System; -using System.Net.Http; using System.Threading.Tasks; -using System.Windows; namespace OpenSilverBusinessApplication.Browser { @@ -13,19 +9,8 @@ public static async Task Main(string[] args) { var builder = WebAssemblyHostBuilder.CreateDefault(args); builder.RootComponents.Add("#app"); - - builder.Services.AddTransient(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); - var host = builder.Build(); await host.RunAsync(); } - - public static void RunApplication() - { - Application.RunApplication(() => - { - var app = new OpenSilverBusinessApplication.App(); - }); - } } } diff --git a/src/OpenSilver.CLI/VB/OpenSilverClassLibrary/.template.config/template.json b/src/OpenSilver.CLI/VB/OpenSilverClassLibrary/.template.config/template.json index 96798f3..30e7179 100644 --- a/src/OpenSilver.CLI/VB/OpenSilverClassLibrary/.template.config/template.json +++ b/src/OpenSilver.CLI/VB/OpenSilverClassLibrary/.template.config/template.json @@ -35,7 +35,7 @@ "generator": "constant", "replaces": "OpenSilverPackageVersion", "parameters": { - "value": "3.0.1" + "value": "3.1.0" } } }, diff --git a/src/OpenSilver.TemplateWizards/AppCustomizationWindow/AppConfigurationWindow.xaml b/src/OpenSilver.TemplateWizards/AppCustomizationWindow/AppConfigurationWindow.xaml index 260865a..e0e8447 100644 --- a/src/OpenSilver.TemplateWizards/AppCustomizationWindow/AppConfigurationWindow.xaml +++ b/src/OpenSilver.TemplateWizards/AppCustomizationWindow/AppConfigurationWindow.xaml @@ -19,9 +19,9 @@ - .NET 6 .NET 7 - .NET 8 + .NET 8 + .NET 9 @@ -29,9 +29,9 @@ - - diff --git a/src/OpenSilver.TemplateWizards/AppCustomizationWindow/AppConfigurationWindow.xaml.cs b/src/OpenSilver.TemplateWizards/AppCustomizationWindow/AppConfigurationWindow.xaml.cs index 31eb9b2..edbb6c4 100644 --- a/src/OpenSilver.TemplateWizards/AppCustomizationWindow/AppConfigurationWindow.xaml.cs +++ b/src/OpenSilver.TemplateWizards/AppCustomizationWindow/AppConfigurationWindow.xaml.cs @@ -23,11 +23,11 @@ public DotNetVersion DotNetVersion switch (DotNetVersionComboBox.SelectedIndex) { case 0: - return DotNetVersion.Net6; - case 1: return DotNetVersion.Net7; - case 2: + case 1: return DotNetVersion.Net8; + case 2: + return DotNetVersion.Net9; default: throw new InvalidOperationException("Error retrieving selected .NET version"); } diff --git a/src/OpenSilver.TemplateWizards/AppCustomizationWindow/DotNetVersion.cs b/src/OpenSilver.TemplateWizards/AppCustomizationWindow/DotNetVersion.cs index 75fe39a..d80c69d 100644 --- a/src/OpenSilver.TemplateWizards/AppCustomizationWindow/DotNetVersion.cs +++ b/src/OpenSilver.TemplateWizards/AppCustomizationWindow/DotNetVersion.cs @@ -2,8 +2,8 @@ { public enum DotNetVersion { - Net6, Net7, - Net8 + Net8, + Net9, } } \ No newline at end of file diff --git a/src/OpenSilver.TemplateWizards/AppCustomizationWizard.cs b/src/OpenSilver.TemplateWizards/AppCustomizationWizard.cs index dcb3596..8ca3ee6 100644 --- a/src/OpenSilver.TemplateWizards/AppCustomizationWizard.cs +++ b/src/OpenSilver.TemplateWizards/AppCustomizationWizard.cs @@ -79,7 +79,6 @@ public void RunStarted(object automationObject, Dictionary repla XNamespace defaultNamespace = openSilverInfo.GetDefaultNamespace(); - string openSilverAPI = openSilverInfo.Element(defaultNamespace + "Api").Value; string openSilverType = openSilverInfo.Element(defaultNamespace + "Type").Value; @@ -95,28 +94,10 @@ public void RunStarted(object automationObject, Dictionary repla } } - if (openSilverAPI == "Silverlight") - { - switch (window.OpenSilverBuildType) - { - case OpenSilverBuildType.Stable: - replacementsDictionary.Add("$opensilverpackagename$", "OpenSilver"); - break; - } - } - else - { - throw new ArgumentNullException($"Unknown OpenSilver API '{openSilverAPI}'"); - } - if (openSilverType == "Application") { switch (window.DotNetVersion) { - case DotNetVersion.Net6: - replacementsDictionary.Add("$targetframework$", "net6.0"); - replacementsDictionary.Add("$blazorpackagesversion$", "6.0.0"); - break; case DotNetVersion.Net7: replacementsDictionary.Add("$targetframework$", "net7.0"); replacementsDictionary.Add("$blazorpackagesversion$", "7.0.0"); @@ -125,14 +106,19 @@ public void RunStarted(object automationObject, Dictionary repla replacementsDictionary.Add("$targetframework$", "net8.0"); replacementsDictionary.Add("$blazorpackagesversion$", "8.0.0"); break; + case DotNetVersion.Net9: + replacementsDictionary.Add("$targetframework$", "net9.0"); + replacementsDictionary.Add("$blazorpackagesversion$", "9.0.0"); + break; } CopyNugetConfig(replacementsDictionary); } - replacementsDictionary.Add("$opensilverpackageversion$", "3.0.1"); - replacementsDictionary.Add("$opensilversimulatorpackageversion$", "3.0.0"); - replacementsDictionary.Add("$openria46packageversion$", "3.0.0"); + replacementsDictionary.Add("$opensilverpackageversion$", "3.1.0"); + replacementsDictionary.Add("$opensilversimulatorpackageversion$", "3.1.0"); + replacementsDictionary.Add("$opensilverwebassemblypackageversion$", "3.1.0"); + replacementsDictionary.Add("$openria46packageversion$", "3.1.0"); } public bool ShouldAddProjectItem(string filePath) diff --git a/src/OpenSilver.VSIX/source.extension.vsixmanifest b/src/OpenSilver.VSIX/source.extension.vsixmanifest index 1efd65f..f68367c 100644 --- a/src/OpenSilver.VSIX/source.extension.vsixmanifest +++ b/src/OpenSilver.VSIX/source.extension.vsixmanifest @@ -1,7 +1,7 @@ - + OpenSilver Project templates and XAML Designer for creating OpenSilver applications. OpenSilver is an open-source reimplementation of Silverlight that runs on current browsers via WebAssembly. Logo_32x32.png diff --git a/src/OpenSilverApplicationTemplate/OpenSilverApplication.Browser/Interop/UnmarshalledJavaScriptExecutionHandler.cs b/src/OpenSilverApplicationTemplate/OpenSilverApplication.Browser/Interop/UnmarshalledJavaScriptExecutionHandler.cs deleted file mode 100644 index 369fd51..0000000 --- a/src/OpenSilverApplicationTemplate/OpenSilverApplication.Browser/Interop/UnmarshalledJavaScriptExecutionHandler.cs +++ /dev/null @@ -1,42 +0,0 @@ -using DotNetForHtml5; -using Microsoft.JSInterop; -using Microsoft.JSInterop.WebAssembly; - -namespace $safeprojectname$.Interop -{ - public class UnmarshalledJavaScriptExecutionHandler : IWebAssemblyExecutionHandler - { - private const string MethodName = "callJSUnmarshalled_v2"; - private readonly WebAssemblyJSRuntime _runtime; - - public UnmarshalledJavaScriptExecutionHandler(IJSRuntime runtime) - { - _runtime = runtime as WebAssemblyJSRuntime; - } - - public void ExecuteJavaScript(string javaScriptToExecute) - { - _runtime.InvokeUnmarshalled(MethodName, javaScriptToExecute); - } - - public object ExecuteJavaScriptWithResult(string javaScriptToExecute) - { - return _runtime.InvokeUnmarshalled(MethodName, javaScriptToExecute); - } - - public TResult InvokeUnmarshalled(string identifier, T0 arg0) - { - return _runtime.InvokeUnmarshalled(identifier, arg0); - } - - public TResult InvokeUnmarshalled(string identifier, T0 arg0, T1 arg1) - { - return _runtime.InvokeUnmarshalled(identifier, arg0, arg1); - } - - public TResult InvokeUnmarshalled(string identifier, T0 arg0, T1 arg1, T2 arg2) - { - return _runtime.InvokeUnmarshalled(identifier, arg0, arg1, arg2); - } - } -} \ No newline at end of file diff --git a/src/OpenSilverApplicationTemplate/OpenSilverApplication.Browser/OpenSilverApplication.Browser.csproj b/src/OpenSilverApplicationTemplate/OpenSilverApplication.Browser/OpenSilverApplication.Browser.csproj index 9e4125a..184eae0 100644 --- a/src/OpenSilverApplicationTemplate/OpenSilverApplication.Browser/OpenSilverApplication.Browser.csproj +++ b/src/OpenSilverApplicationTemplate/OpenSilverApplication.Browser/OpenSilverApplication.Browser.csproj @@ -2,8 +2,7 @@ $ext_targetframework$ - True - 6 + 7 true false @@ -13,7 +12,7 @@ - + diff --git a/src/OpenSilverApplicationTemplate/OpenSilverApplication.Browser/OpenSilverApplication.Browser.vstemplate b/src/OpenSilverApplicationTemplate/OpenSilverApplication.Browser/OpenSilverApplication.Browser.vstemplate index 3e47d5f..ff0164d 100644 --- a/src/OpenSilverApplicationTemplate/OpenSilverApplication.Browser/OpenSilverApplication.Browser.vstemplate +++ b/src/OpenSilverApplicationTemplate/OpenSilverApplication.Browser/OpenSilverApplication.Browser.vstemplate @@ -13,9 +13,6 @@ index.html loading-indicator.css - - UnmarshalledJavaScriptExecutionHandler.cs - Index.cs diff --git a/src/OpenSilverApplicationTemplate/OpenSilverApplication.Browser/Pages/Index.cs b/src/OpenSilverApplicationTemplate/OpenSilverApplication.Browser/Pages/Index.cs index f56a66b..792ce2b 100644 --- a/src/OpenSilverApplicationTemplate/OpenSilverApplication.Browser/Pages/Index.cs +++ b/src/OpenSilverApplicationTemplate/OpenSilverApplication.Browser/Pages/Index.cs @@ -1,10 +1,7 @@ -using System; -using System.Threading.Tasks; -using DotNetForHtml5; -using $safeprojectname$.Interop; +using System.Threading.Tasks; using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components.Rendering; -using Microsoft.JSInterop; +using OpenSilver.WebAssembly; namespace $safeprojectname$.Pages { @@ -18,17 +15,7 @@ protected override void BuildRenderTree(RenderTreeBuilder __builder) protected async override Task OnInitializedAsync() { await base.OnInitializedAsync(); - - if (!await JSRuntime.InvokeAsync("getOSFilesLoadedPromise")) - { - throw new InvalidOperationException("Failed to initialize OpenSilver. Check your browser's console for error details."); - } - - Cshtml5Initializer.Initialize(new UnmarshalledJavaScriptExecutionHandler(JSRuntime)); - Program.RunApplication(); + await Runner.RunApplicationAsync<$ext_safeprojectname$.App>(); } - - [Inject] - private IJSRuntime JSRuntime { get; set; } } } \ No newline at end of file diff --git a/src/OpenSilverApplicationTemplate/OpenSilverApplication.Browser/Program.cs b/src/OpenSilverApplicationTemplate/OpenSilverApplication.Browser/Program.cs index c089ce7..24b50d3 100644 --- a/src/OpenSilverApplicationTemplate/OpenSilverApplication.Browser/Program.cs +++ b/src/OpenSilverApplicationTemplate/OpenSilverApplication.Browser/Program.cs @@ -1,8 +1,4 @@ -using System.Windows; -using Microsoft.AspNetCore.Components.WebAssembly.Hosting; -using Microsoft.Extensions.DependencyInjection; -using System; -using System.Net.Http; +using Microsoft.AspNetCore.Components.WebAssembly.Hosting; using System.Threading.Tasks; namespace $safeprojectname$ @@ -13,19 +9,8 @@ public static async Task Main(string[] args) { var builder = WebAssemblyHostBuilder.CreateDefault(args); builder.RootComponents.Add("#app"); - - builder.Services.AddTransient(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); - var host = builder.Build(); await host.RunAsync(); } - - public static void RunApplication() - { - Application.RunApplication(() => - { - var app = new $ext_safeprojectname$.App(); - }); - } } } diff --git a/src/OpenSilverApplicationTemplate/OpenSilverApplication/OpenSilverApplication.csproj b/src/OpenSilverApplicationTemplate/OpenSilverApplication/OpenSilverApplication.csproj index 8fd4c07..ee82318 100644 --- a/src/OpenSilverApplicationTemplate/OpenSilverApplication/OpenSilverApplication.csproj +++ b/src/OpenSilverApplicationTemplate/OpenSilverApplication/OpenSilverApplication.csproj @@ -7,7 +7,7 @@ - + diff --git a/src/OpenSilverApplicationTemplate/OpenSilverApplication/OpenSilverApplication.vstemplate b/src/OpenSilverApplicationTemplate/OpenSilverApplication/OpenSilverApplication.vstemplate index 324c290..563562f 100644 --- a/src/OpenSilverApplicationTemplate/OpenSilverApplication/OpenSilverApplication.vstemplate +++ b/src/OpenSilverApplicationTemplate/OpenSilverApplication/OpenSilverApplication.vstemplate @@ -9,9 +9,6 @@ App.xaml.cs MainPage.xaml MainPage.xaml.cs - - launchSettings.json - \ No newline at end of file diff --git a/src/OpenSilverApplicationTemplate/OpenSilverApplication/Properties/launchSettings.json b/src/OpenSilverApplicationTemplate/OpenSilverApplication/Properties/launchSettings.json deleted file mode 100644 index c6f934e..0000000 --- a/src/OpenSilverApplicationTemplate/OpenSilverApplication/Properties/launchSettings.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "profiles": { - "$ext_safeprojectname$": { - "commandName": "Executable", - "executablePath": "cmd", - "commandLineArgs": "/c start \"\" \"http://www.opensilver.net/permalinks/wrong_startup_project.aspx\"" - } - } -} \ No newline at end of file diff --git a/src/OpenSilverBusinessApplicationTemplate/OpenSilverBusinessApplication.Browser/Interop/UnmarshalledJavaScriptExecutionHandler.cs b/src/OpenSilverBusinessApplicationTemplate/OpenSilverBusinessApplication.Browser/Interop/UnmarshalledJavaScriptExecutionHandler.cs deleted file mode 100644 index cd76284..0000000 --- a/src/OpenSilverBusinessApplicationTemplate/OpenSilverBusinessApplication.Browser/Interop/UnmarshalledJavaScriptExecutionHandler.cs +++ /dev/null @@ -1,42 +0,0 @@ -using DotNetForHtml5; -using Microsoft.JSInterop; -using Microsoft.JSInterop.WebAssembly; - -namespace $ext_safeprojectname$.Browser.Interop -{ - public class UnmarshalledJavaScriptExecutionHandler : IWebAssemblyExecutionHandler - { - private const string MethodName = "callJSUnmarshalled_v2"; - private readonly WebAssemblyJSRuntime _runtime; - - public UnmarshalledJavaScriptExecutionHandler(IJSRuntime runtime) - { - _runtime = runtime as WebAssemblyJSRuntime; - } - - public void ExecuteJavaScript(string javaScriptToExecute) - { - _runtime.InvokeUnmarshalled(MethodName, javaScriptToExecute); - } - - public object ExecuteJavaScriptWithResult(string javaScriptToExecute) - { - return _runtime.InvokeUnmarshalled(MethodName, javaScriptToExecute); - } - - public TResult InvokeUnmarshalled(string identifier, T0 arg0) - { - return _runtime.InvokeUnmarshalled(identifier, arg0); - } - - public TResult InvokeUnmarshalled(string identifier, T0 arg0, T1 arg1) - { - return _runtime.InvokeUnmarshalled(identifier, arg0, arg1); - } - - public TResult InvokeUnmarshalled(string identifier, T0 arg0, T1 arg1, T2 arg2) - { - return _runtime.InvokeUnmarshalled(identifier, arg0, arg1, arg2); - } - } -} \ No newline at end of file diff --git a/src/OpenSilverBusinessApplicationTemplate/OpenSilverBusinessApplication.Browser/OpenSilverBusinessApplication.Browser.csproj b/src/OpenSilverBusinessApplicationTemplate/OpenSilverBusinessApplication.Browser/OpenSilverBusinessApplication.Browser.csproj index 220f9ff..78bb6c0 100644 --- a/src/OpenSilverBusinessApplicationTemplate/OpenSilverBusinessApplication.Browser/OpenSilverBusinessApplication.Browser.csproj +++ b/src/OpenSilverBusinessApplicationTemplate/OpenSilverBusinessApplication.Browser/OpenSilverBusinessApplication.Browser.csproj @@ -2,8 +2,7 @@ $ext_targetframework$ - True - 6 + 7 true false @@ -13,7 +12,7 @@ - + diff --git a/src/OpenSilverBusinessApplicationTemplate/OpenSilverBusinessApplication.Browser/OpenSilverBusinessApplication.Browser.vstemplate b/src/OpenSilverBusinessApplicationTemplate/OpenSilverBusinessApplication.Browser/OpenSilverBusinessApplication.Browser.vstemplate index 4c51776..2562fc5 100644 --- a/src/OpenSilverBusinessApplicationTemplate/OpenSilverBusinessApplication.Browser/OpenSilverBusinessApplication.Browser.vstemplate +++ b/src/OpenSilverBusinessApplicationTemplate/OpenSilverBusinessApplication.Browser/OpenSilverBusinessApplication.Browser.vstemplate @@ -13,9 +13,6 @@ index.html loading-indicator.css - - UnmarshalledJavaScriptExecutionHandler.cs - Index.cs diff --git a/src/OpenSilverBusinessApplicationTemplate/OpenSilverBusinessApplication.Browser/Pages/Index.cs b/src/OpenSilverBusinessApplicationTemplate/OpenSilverBusinessApplication.Browser/Pages/Index.cs index e3267e2..0662d19 100644 --- a/src/OpenSilverBusinessApplicationTemplate/OpenSilverBusinessApplication.Browser/Pages/Index.cs +++ b/src/OpenSilverBusinessApplicationTemplate/OpenSilverBusinessApplication.Browser/Pages/Index.cs @@ -1,10 +1,7 @@ -using System; -using System.Threading.Tasks; -using DotNetForHtml5; +using System.Threading.Tasks; using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components.Rendering; -using Microsoft.JSInterop; -using $ext_safeprojectname$.Browser.Interop; +using OpenSilver.WebAssembly; namespace $ext_safeprojectname$.Browser.Pages { @@ -18,17 +15,7 @@ protected override void BuildRenderTree(RenderTreeBuilder __builder) protected async override Task OnInitializedAsync() { await base.OnInitializedAsync(); - - if (!await JSRuntime.InvokeAsync("getOSFilesLoadedPromise")) - { - throw new InvalidOperationException("Failed to initialize OpenSilver. Check your browser's console for error details."); - } - - Cshtml5Initializer.Initialize(new UnmarshalledJavaScriptExecutionHandler(JSRuntime)); - Program.RunApplication(); + await Runner.RunApplicationAsync<$ext_safeprojectname$.App>(); } - - [Inject] - private IJSRuntime JSRuntime { get; set; } } } \ No newline at end of file diff --git a/src/OpenSilverBusinessApplicationTemplate/OpenSilverBusinessApplication.Browser/Program.cs b/src/OpenSilverBusinessApplicationTemplate/OpenSilverBusinessApplication.Browser/Program.cs index 5471c82..ce58ec3 100644 --- a/src/OpenSilverBusinessApplicationTemplate/OpenSilverBusinessApplication.Browser/Program.cs +++ b/src/OpenSilverBusinessApplicationTemplate/OpenSilverBusinessApplication.Browser/Program.cs @@ -1,9 +1,5 @@ using Microsoft.AspNetCore.Components.WebAssembly.Hosting; -using Microsoft.Extensions.DependencyInjection; -using System; -using System.Net.Http; using System.Threading.Tasks; -using System.Windows; namespace $ext_safeprojectname$.Browser { @@ -13,19 +9,8 @@ public static async Task Main(string[] args) { var builder = WebAssemblyHostBuilder.CreateDefault(args); builder.RootComponents.Add("#app"); - - builder.Services.AddTransient(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); - var host = builder.Build(); await host.RunAsync(); } - - public static void RunApplication() - { - Application.RunApplication(() => - { - var app = new $ext_safeprojectname$.App(); - }); - } } } diff --git a/src/OpenSilverBusinessVBApplicationTemplate/OpenSilverBusinessApplication.Browser/Interop/UnmarshalledJavaScriptExecutionHandler.cs b/src/OpenSilverBusinessVBApplicationTemplate/OpenSilverBusinessApplication.Browser/Interop/UnmarshalledJavaScriptExecutionHandler.cs deleted file mode 100644 index cd76284..0000000 --- a/src/OpenSilverBusinessVBApplicationTemplate/OpenSilverBusinessApplication.Browser/Interop/UnmarshalledJavaScriptExecutionHandler.cs +++ /dev/null @@ -1,42 +0,0 @@ -using DotNetForHtml5; -using Microsoft.JSInterop; -using Microsoft.JSInterop.WebAssembly; - -namespace $ext_safeprojectname$.Browser.Interop -{ - public class UnmarshalledJavaScriptExecutionHandler : IWebAssemblyExecutionHandler - { - private const string MethodName = "callJSUnmarshalled_v2"; - private readonly WebAssemblyJSRuntime _runtime; - - public UnmarshalledJavaScriptExecutionHandler(IJSRuntime runtime) - { - _runtime = runtime as WebAssemblyJSRuntime; - } - - public void ExecuteJavaScript(string javaScriptToExecute) - { - _runtime.InvokeUnmarshalled(MethodName, javaScriptToExecute); - } - - public object ExecuteJavaScriptWithResult(string javaScriptToExecute) - { - return _runtime.InvokeUnmarshalled(MethodName, javaScriptToExecute); - } - - public TResult InvokeUnmarshalled(string identifier, T0 arg0) - { - return _runtime.InvokeUnmarshalled(identifier, arg0); - } - - public TResult InvokeUnmarshalled(string identifier, T0 arg0, T1 arg1) - { - return _runtime.InvokeUnmarshalled(identifier, arg0, arg1); - } - - public TResult InvokeUnmarshalled(string identifier, T0 arg0, T1 arg1, T2 arg2) - { - return _runtime.InvokeUnmarshalled(identifier, arg0, arg1, arg2); - } - } -} \ No newline at end of file diff --git a/src/OpenSilverBusinessVBApplicationTemplate/OpenSilverBusinessApplication.Browser/OpenSilverBusinessApplication.Browser.csproj b/src/OpenSilverBusinessVBApplicationTemplate/OpenSilverBusinessApplication.Browser/OpenSilverBusinessApplication.Browser.csproj index 700cd7d..35e6c4d 100644 --- a/src/OpenSilverBusinessVBApplicationTemplate/OpenSilverBusinessApplication.Browser/OpenSilverBusinessApplication.Browser.csproj +++ b/src/OpenSilverBusinessVBApplicationTemplate/OpenSilverBusinessApplication.Browser/OpenSilverBusinessApplication.Browser.csproj @@ -2,8 +2,7 @@ $ext_targetframework$ - True - 6 + 7 true false @@ -13,7 +12,7 @@ - + diff --git a/src/OpenSilverBusinessVBApplicationTemplate/OpenSilverBusinessApplication.Browser/OpenSilverBusinessApplication.Browser.vstemplate b/src/OpenSilverBusinessVBApplicationTemplate/OpenSilverBusinessApplication.Browser/OpenSilverBusinessApplication.Browser.vstemplate index 4c51776..2562fc5 100644 --- a/src/OpenSilverBusinessVBApplicationTemplate/OpenSilverBusinessApplication.Browser/OpenSilverBusinessApplication.Browser.vstemplate +++ b/src/OpenSilverBusinessVBApplicationTemplate/OpenSilverBusinessApplication.Browser/OpenSilverBusinessApplication.Browser.vstemplate @@ -13,9 +13,6 @@ index.html loading-indicator.css - - UnmarshalledJavaScriptExecutionHandler.cs - Index.cs diff --git a/src/OpenSilverBusinessVBApplicationTemplate/OpenSilverBusinessApplication.Browser/Pages/Index.cs b/src/OpenSilverBusinessVBApplicationTemplate/OpenSilverBusinessApplication.Browser/Pages/Index.cs index e3267e2..0662d19 100644 --- a/src/OpenSilverBusinessVBApplicationTemplate/OpenSilverBusinessApplication.Browser/Pages/Index.cs +++ b/src/OpenSilverBusinessVBApplicationTemplate/OpenSilverBusinessApplication.Browser/Pages/Index.cs @@ -1,10 +1,7 @@ -using System; -using System.Threading.Tasks; -using DotNetForHtml5; +using System.Threading.Tasks; using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components.Rendering; -using Microsoft.JSInterop; -using $ext_safeprojectname$.Browser.Interop; +using OpenSilver.WebAssembly; namespace $ext_safeprojectname$.Browser.Pages { @@ -18,17 +15,7 @@ protected override void BuildRenderTree(RenderTreeBuilder __builder) protected async override Task OnInitializedAsync() { await base.OnInitializedAsync(); - - if (!await JSRuntime.InvokeAsync("getOSFilesLoadedPromise")) - { - throw new InvalidOperationException("Failed to initialize OpenSilver. Check your browser's console for error details."); - } - - Cshtml5Initializer.Initialize(new UnmarshalledJavaScriptExecutionHandler(JSRuntime)); - Program.RunApplication(); + await Runner.RunApplicationAsync<$ext_safeprojectname$.App>(); } - - [Inject] - private IJSRuntime JSRuntime { get; set; } } } \ No newline at end of file diff --git a/src/OpenSilverBusinessVBApplicationTemplate/OpenSilverBusinessApplication.Browser/Program.cs b/src/OpenSilverBusinessVBApplicationTemplate/OpenSilverBusinessApplication.Browser/Program.cs index 5471c82..ce58ec3 100644 --- a/src/OpenSilverBusinessVBApplicationTemplate/OpenSilverBusinessApplication.Browser/Program.cs +++ b/src/OpenSilverBusinessVBApplicationTemplate/OpenSilverBusinessApplication.Browser/Program.cs @@ -1,9 +1,5 @@ using Microsoft.AspNetCore.Components.WebAssembly.Hosting; -using Microsoft.Extensions.DependencyInjection; -using System; -using System.Net.Http; using System.Threading.Tasks; -using System.Windows; namespace $ext_safeprojectname$.Browser { @@ -13,19 +9,8 @@ public static async Task Main(string[] args) { var builder = WebAssemblyHostBuilder.CreateDefault(args); builder.RootComponents.Add("#app"); - - builder.Services.AddTransient(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); - var host = builder.Build(); await host.RunAsync(); } - - public static void RunApplication() - { - Application.RunApplication(() => - { - var app = new $ext_safeprojectname$.App(); - }); - } } } diff --git a/src/OpenSilverClassLibraryTemplate/OpenSilverClassLibrary.csproj b/src/OpenSilverClassLibraryTemplate/OpenSilverClassLibrary.csproj index ccb40c2..93f1b7c 100644 --- a/src/OpenSilverClassLibraryTemplate/OpenSilverClassLibrary.csproj +++ b/src/OpenSilverClassLibraryTemplate/OpenSilverClassLibrary.csproj @@ -7,7 +7,7 @@ - + diff --git a/src/OpenSilverFSApplicationTemplate/OpenSilverFSApplication.Browser/Interop/UnmarshalledJavaScriptExecutionHandler.cs b/src/OpenSilverFSApplicationTemplate/OpenSilverFSApplication.Browser/Interop/UnmarshalledJavaScriptExecutionHandler.cs deleted file mode 100644 index 369fd51..0000000 --- a/src/OpenSilverFSApplicationTemplate/OpenSilverFSApplication.Browser/Interop/UnmarshalledJavaScriptExecutionHandler.cs +++ /dev/null @@ -1,42 +0,0 @@ -using DotNetForHtml5; -using Microsoft.JSInterop; -using Microsoft.JSInterop.WebAssembly; - -namespace $safeprojectname$.Interop -{ - public class UnmarshalledJavaScriptExecutionHandler : IWebAssemblyExecutionHandler - { - private const string MethodName = "callJSUnmarshalled_v2"; - private readonly WebAssemblyJSRuntime _runtime; - - public UnmarshalledJavaScriptExecutionHandler(IJSRuntime runtime) - { - _runtime = runtime as WebAssemblyJSRuntime; - } - - public void ExecuteJavaScript(string javaScriptToExecute) - { - _runtime.InvokeUnmarshalled(MethodName, javaScriptToExecute); - } - - public object ExecuteJavaScriptWithResult(string javaScriptToExecute) - { - return _runtime.InvokeUnmarshalled(MethodName, javaScriptToExecute); - } - - public TResult InvokeUnmarshalled(string identifier, T0 arg0) - { - return _runtime.InvokeUnmarshalled(identifier, arg0); - } - - public TResult InvokeUnmarshalled(string identifier, T0 arg0, T1 arg1) - { - return _runtime.InvokeUnmarshalled(identifier, arg0, arg1); - } - - public TResult InvokeUnmarshalled(string identifier, T0 arg0, T1 arg1, T2 arg2) - { - return _runtime.InvokeUnmarshalled(identifier, arg0, arg1, arg2); - } - } -} \ No newline at end of file diff --git a/src/OpenSilverFSApplicationTemplate/OpenSilverFSApplication.Browser/OpenSilverApplication.Browser.csproj b/src/OpenSilverFSApplicationTemplate/OpenSilverFSApplication.Browser/OpenSilverApplication.Browser.csproj index 04240c7..ada65df 100644 --- a/src/OpenSilverFSApplicationTemplate/OpenSilverFSApplication.Browser/OpenSilverApplication.Browser.csproj +++ b/src/OpenSilverFSApplicationTemplate/OpenSilverFSApplication.Browser/OpenSilverApplication.Browser.csproj @@ -2,8 +2,7 @@ $ext_targetframework$ - True - 6 + 7 true false @@ -13,7 +12,7 @@ - + diff --git a/src/OpenSilverFSApplicationTemplate/OpenSilverFSApplication.Browser/OpenSilverApplication.Browser.vstemplate b/src/OpenSilverFSApplicationTemplate/OpenSilverFSApplication.Browser/OpenSilverApplication.Browser.vstemplate index 3e47d5f..ff0164d 100644 --- a/src/OpenSilverFSApplicationTemplate/OpenSilverFSApplication.Browser/OpenSilverApplication.Browser.vstemplate +++ b/src/OpenSilverFSApplicationTemplate/OpenSilverFSApplication.Browser/OpenSilverApplication.Browser.vstemplate @@ -13,9 +13,6 @@ index.html loading-indicator.css - - UnmarshalledJavaScriptExecutionHandler.cs - Index.cs diff --git a/src/OpenSilverFSApplicationTemplate/OpenSilverFSApplication.Browser/Pages/Index.cs b/src/OpenSilverFSApplicationTemplate/OpenSilverFSApplication.Browser/Pages/Index.cs index f56a66b..792ce2b 100644 --- a/src/OpenSilverFSApplicationTemplate/OpenSilverFSApplication.Browser/Pages/Index.cs +++ b/src/OpenSilverFSApplicationTemplate/OpenSilverFSApplication.Browser/Pages/Index.cs @@ -1,10 +1,7 @@ -using System; -using System.Threading.Tasks; -using DotNetForHtml5; -using $safeprojectname$.Interop; +using System.Threading.Tasks; using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components.Rendering; -using Microsoft.JSInterop; +using OpenSilver.WebAssembly; namespace $safeprojectname$.Pages { @@ -18,17 +15,7 @@ protected override void BuildRenderTree(RenderTreeBuilder __builder) protected async override Task OnInitializedAsync() { await base.OnInitializedAsync(); - - if (!await JSRuntime.InvokeAsync("getOSFilesLoadedPromise")) - { - throw new InvalidOperationException("Failed to initialize OpenSilver. Check your browser's console for error details."); - } - - Cshtml5Initializer.Initialize(new UnmarshalledJavaScriptExecutionHandler(JSRuntime)); - Program.RunApplication(); + await Runner.RunApplicationAsync<$ext_safeprojectname$.App>(); } - - [Inject] - private IJSRuntime JSRuntime { get; set; } } } \ No newline at end of file diff --git a/src/OpenSilverFSApplicationTemplate/OpenSilverFSApplication.Browser/Program.cs b/src/OpenSilverFSApplicationTemplate/OpenSilverFSApplication.Browser/Program.cs index c089ce7..24b50d3 100644 --- a/src/OpenSilverFSApplicationTemplate/OpenSilverFSApplication.Browser/Program.cs +++ b/src/OpenSilverFSApplicationTemplate/OpenSilverFSApplication.Browser/Program.cs @@ -1,8 +1,4 @@ -using System.Windows; -using Microsoft.AspNetCore.Components.WebAssembly.Hosting; -using Microsoft.Extensions.DependencyInjection; -using System; -using System.Net.Http; +using Microsoft.AspNetCore.Components.WebAssembly.Hosting; using System.Threading.Tasks; namespace $safeprojectname$ @@ -13,19 +9,8 @@ public static async Task Main(string[] args) { var builder = WebAssemblyHostBuilder.CreateDefault(args); builder.RootComponents.Add("#app"); - - builder.Services.AddTransient(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); - var host = builder.Build(); await host.RunAsync(); } - - public static void RunApplication() - { - Application.RunApplication(() => - { - var app = new $ext_safeprojectname$.App(); - }); - } } } diff --git a/src/OpenSilverFSApplicationTemplate/OpenSilverFSApplication/OpenSilverApplication.fsproj b/src/OpenSilverFSApplicationTemplate/OpenSilverFSApplication/OpenSilverApplication.fsproj index 2d6cbb0..32cec67 100644 --- a/src/OpenSilverFSApplicationTemplate/OpenSilverFSApplication/OpenSilverApplication.fsproj +++ b/src/OpenSilverFSApplicationTemplate/OpenSilverFSApplication/OpenSilverApplication.fsproj @@ -7,7 +7,7 @@ - + diff --git a/src/OpenSilverFSApplicationTemplate/OpenSilverFSApplication/OpenSilverApplication.vstemplate b/src/OpenSilverFSApplicationTemplate/OpenSilverFSApplication/OpenSilverApplication.vstemplate index 3c3470e..18082d8 100644 --- a/src/OpenSilverFSApplicationTemplate/OpenSilverFSApplication/OpenSilverApplication.vstemplate +++ b/src/OpenSilverFSApplicationTemplate/OpenSilverFSApplication/OpenSilverApplication.vstemplate @@ -9,9 +9,6 @@ App.xaml.fs MainPage.xaml MainPage.xaml.fs - - launchSettings.json - \ No newline at end of file diff --git a/src/OpenSilverFSApplicationTemplate/OpenSilverFSApplication/Properties/launchSettings.json b/src/OpenSilverFSApplicationTemplate/OpenSilverFSApplication/Properties/launchSettings.json deleted file mode 100644 index c6f934e..0000000 --- a/src/OpenSilverFSApplicationTemplate/OpenSilverFSApplication/Properties/launchSettings.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "profiles": { - "$ext_safeprojectname$": { - "commandName": "Executable", - "executablePath": "cmd", - "commandLineArgs": "/c start \"\" \"http://www.opensilver.net/permalinks/wrong_startup_project.aspx\"" - } - } -} \ No newline at end of file diff --git a/src/OpenSilverFSClassLibraryTemplate/OpenSilverClassLibrary.fsproj b/src/OpenSilverFSClassLibraryTemplate/OpenSilverClassLibrary.fsproj index 9860b5c..8db5103 100644 --- a/src/OpenSilverFSClassLibraryTemplate/OpenSilverClassLibrary.fsproj +++ b/src/OpenSilverFSClassLibraryTemplate/OpenSilverClassLibrary.fsproj @@ -7,7 +7,7 @@ - + diff --git a/src/OpenSilverVBApplicationTemplate/OpenSilverVBApplication.Browser/Interop/UnmarshalledJavaScriptExecutionHandler.cs b/src/OpenSilverVBApplicationTemplate/OpenSilverVBApplication.Browser/Interop/UnmarshalledJavaScriptExecutionHandler.cs deleted file mode 100644 index 369fd51..0000000 --- a/src/OpenSilverVBApplicationTemplate/OpenSilverVBApplication.Browser/Interop/UnmarshalledJavaScriptExecutionHandler.cs +++ /dev/null @@ -1,42 +0,0 @@ -using DotNetForHtml5; -using Microsoft.JSInterop; -using Microsoft.JSInterop.WebAssembly; - -namespace $safeprojectname$.Interop -{ - public class UnmarshalledJavaScriptExecutionHandler : IWebAssemblyExecutionHandler - { - private const string MethodName = "callJSUnmarshalled_v2"; - private readonly WebAssemblyJSRuntime _runtime; - - public UnmarshalledJavaScriptExecutionHandler(IJSRuntime runtime) - { - _runtime = runtime as WebAssemblyJSRuntime; - } - - public void ExecuteJavaScript(string javaScriptToExecute) - { - _runtime.InvokeUnmarshalled(MethodName, javaScriptToExecute); - } - - public object ExecuteJavaScriptWithResult(string javaScriptToExecute) - { - return _runtime.InvokeUnmarshalled(MethodName, javaScriptToExecute); - } - - public TResult InvokeUnmarshalled(string identifier, T0 arg0) - { - return _runtime.InvokeUnmarshalled(identifier, arg0); - } - - public TResult InvokeUnmarshalled(string identifier, T0 arg0, T1 arg1) - { - return _runtime.InvokeUnmarshalled(identifier, arg0, arg1); - } - - public TResult InvokeUnmarshalled(string identifier, T0 arg0, T1 arg1, T2 arg2) - { - return _runtime.InvokeUnmarshalled(identifier, arg0, arg1, arg2); - } - } -} \ No newline at end of file diff --git a/src/OpenSilverVBApplicationTemplate/OpenSilverVBApplication.Browser/OpenSilverApplication.Browser.csproj b/src/OpenSilverVBApplicationTemplate/OpenSilverVBApplication.Browser/OpenSilverApplication.Browser.csproj index 5abc949..35e6c4d 100644 --- a/src/OpenSilverVBApplicationTemplate/OpenSilverVBApplication.Browser/OpenSilverApplication.Browser.csproj +++ b/src/OpenSilverVBApplicationTemplate/OpenSilverVBApplication.Browser/OpenSilverApplication.Browser.csproj @@ -2,8 +2,7 @@ $ext_targetframework$ - True - 6 + 7 true false @@ -13,7 +12,7 @@ - + diff --git a/src/OpenSilverVBApplicationTemplate/OpenSilverVBApplication.Browser/OpenSilverApplication.Browser.vstemplate b/src/OpenSilverVBApplicationTemplate/OpenSilverVBApplication.Browser/OpenSilverApplication.Browser.vstemplate index 3e47d5f..ff0164d 100644 --- a/src/OpenSilverVBApplicationTemplate/OpenSilverVBApplication.Browser/OpenSilverApplication.Browser.vstemplate +++ b/src/OpenSilverVBApplicationTemplate/OpenSilverVBApplication.Browser/OpenSilverApplication.Browser.vstemplate @@ -13,9 +13,6 @@ index.html loading-indicator.css - - UnmarshalledJavaScriptExecutionHandler.cs - Index.cs diff --git a/src/OpenSilverVBApplicationTemplate/OpenSilverVBApplication.Browser/Pages/Index.cs b/src/OpenSilverVBApplicationTemplate/OpenSilverVBApplication.Browser/Pages/Index.cs index f56a66b..792ce2b 100644 --- a/src/OpenSilverVBApplicationTemplate/OpenSilverVBApplication.Browser/Pages/Index.cs +++ b/src/OpenSilverVBApplicationTemplate/OpenSilverVBApplication.Browser/Pages/Index.cs @@ -1,10 +1,7 @@ -using System; -using System.Threading.Tasks; -using DotNetForHtml5; -using $safeprojectname$.Interop; +using System.Threading.Tasks; using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components.Rendering; -using Microsoft.JSInterop; +using OpenSilver.WebAssembly; namespace $safeprojectname$.Pages { @@ -18,17 +15,7 @@ protected override void BuildRenderTree(RenderTreeBuilder __builder) protected async override Task OnInitializedAsync() { await base.OnInitializedAsync(); - - if (!await JSRuntime.InvokeAsync("getOSFilesLoadedPromise")) - { - throw new InvalidOperationException("Failed to initialize OpenSilver. Check your browser's console for error details."); - } - - Cshtml5Initializer.Initialize(new UnmarshalledJavaScriptExecutionHandler(JSRuntime)); - Program.RunApplication(); + await Runner.RunApplicationAsync<$ext_safeprojectname$.App>(); } - - [Inject] - private IJSRuntime JSRuntime { get; set; } } } \ No newline at end of file diff --git a/src/OpenSilverVBApplicationTemplate/OpenSilverVBApplication.Browser/Program.cs b/src/OpenSilverVBApplicationTemplate/OpenSilverVBApplication.Browser/Program.cs index c089ce7..24b50d3 100644 --- a/src/OpenSilverVBApplicationTemplate/OpenSilverVBApplication.Browser/Program.cs +++ b/src/OpenSilverVBApplicationTemplate/OpenSilverVBApplication.Browser/Program.cs @@ -1,8 +1,4 @@ -using System.Windows; -using Microsoft.AspNetCore.Components.WebAssembly.Hosting; -using Microsoft.Extensions.DependencyInjection; -using System; -using System.Net.Http; +using Microsoft.AspNetCore.Components.WebAssembly.Hosting; using System.Threading.Tasks; namespace $safeprojectname$ @@ -13,19 +9,8 @@ public static async Task Main(string[] args) { var builder = WebAssemblyHostBuilder.CreateDefault(args); builder.RootComponents.Add("#app"); - - builder.Services.AddTransient(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); - var host = builder.Build(); await host.RunAsync(); } - - public static void RunApplication() - { - Application.RunApplication(() => - { - var app = new $ext_safeprojectname$.App(); - }); - } } } diff --git a/src/OpenSilverVBApplicationTemplate/OpenSilverVBApplication/OpenSilverApplication.vbproj b/src/OpenSilverVBApplicationTemplate/OpenSilverVBApplication/OpenSilverApplication.vbproj index 73675ad..8d0c488 100644 --- a/src/OpenSilverVBApplicationTemplate/OpenSilverVBApplication/OpenSilverApplication.vbproj +++ b/src/OpenSilverVBApplicationTemplate/OpenSilverVBApplication/OpenSilverApplication.vbproj @@ -7,7 +7,7 @@ - + diff --git a/src/OpenSilverVBApplicationTemplate/OpenSilverVBApplication/OpenSilverApplication.vstemplate b/src/OpenSilverVBApplicationTemplate/OpenSilverVBApplication/OpenSilverApplication.vstemplate index c97ff12..025b758 100644 --- a/src/OpenSilverVBApplicationTemplate/OpenSilverVBApplication/OpenSilverApplication.vstemplate +++ b/src/OpenSilverVBApplicationTemplate/OpenSilverVBApplication/OpenSilverApplication.vstemplate @@ -9,9 +9,6 @@ App.xaml.vb MainPage.xaml MainPage.xaml.vb - - launchSettings.json - \ No newline at end of file diff --git a/src/OpenSilverVBApplicationTemplate/OpenSilverVBApplication/Properties/launchSettings.json b/src/OpenSilverVBApplicationTemplate/OpenSilverVBApplication/Properties/launchSettings.json deleted file mode 100644 index c6f934e..0000000 --- a/src/OpenSilverVBApplicationTemplate/OpenSilverVBApplication/Properties/launchSettings.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "profiles": { - "$ext_safeprojectname$": { - "commandName": "Executable", - "executablePath": "cmd", - "commandLineArgs": "/c start \"\" \"http://www.opensilver.net/permalinks/wrong_startup_project.aspx\"" - } - } -} \ No newline at end of file diff --git a/src/OpenSilverVBClassLibraryTemplate/OpenSilverClassLibrary.vbproj b/src/OpenSilverVBClassLibraryTemplate/OpenSilverClassLibrary.vbproj index d0184a3..e20ba36 100644 --- a/src/OpenSilverVBClassLibraryTemplate/OpenSilverClassLibrary.vbproj +++ b/src/OpenSilverVBClassLibraryTemplate/OpenSilverClassLibrary.vbproj @@ -7,7 +7,7 @@ - + From f61fb330923390868f7ae8681db855aa0c958b43 Mon Sep 17 00:00:00 2001 From: Iakov Lilo Date: Fri, 29 Nov 2024 16:47:13 +1100 Subject: [PATCH 02/17] Add theme support to CLI template --- README.md | 2 +- .../.template.config/template.json | 28 +++++++++++++++++++ .../OpenSilverApplication.Simulator.csproj | 2 +- .../OpenSilverApplication/App.xaml | 10 +++++++ .../OpenSilverApplication.csproj | 3 ++ ...SilverBusinessApplication.Simulator.csproj | 2 +- .../.template.config/template.json | 28 +++++++++++++++++++ .../OpenSilverApplication.Simulator.csproj | 2 +- .../OpenSilverApplication/App.xaml | 10 +++++++ .../OpenSilverApplication.fsproj | 3 ++ .../.template.config/template.json | 28 +++++++++++++++++++ .../OpenSilverApplication.Simulator.csproj | 2 +- .../OpenSilverApplication/App.xaml | 10 +++++++ .../OpenSilverApplication.vbproj | 3 ++ ...SilverBusinessApplication.Simulator.csproj | 2 +- 15 files changed, 129 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 4752018..b4bb999 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ For more information about the command line switches you can run this command to If you need help for another OpenSilver template, let's say the Class Library template, just change the name of the template as follows: - dotnet new opensilvercl -h + dotnet new opensilverlib -h If you still encounter any issues, please contact: - the OpenSilver team at: https://opensilver.net/contact.aspx diff --git a/src/OpenSilver.CLI/C#/OpenSilverApplication/.template.config/template.json b/src/OpenSilver.CLI/C#/OpenSilverApplication/.template.config/template.json index 97cbdb3..92a92a6 100644 --- a/src/OpenSilver.CLI/C#/OpenSilverApplication/.template.config/template.json +++ b/src/OpenSilver.CLI/C#/OpenSilverApplication/.template.config/template.json @@ -71,6 +71,26 @@ } ] }, + "theme": { + "type": "parameter", + "datatype": "string", + "description": "Specifies the theme for the generated OpenSilver application.", + "defaultValue": "classic", + "choices": [ + { + "choice": "classic", + "description": "Classic theme" + }, + { + "choice": "modern-light", + "description": "Modern theme with light mode" + }, + { + "choice": "modern-dark", + "description": "Modern theme with dark mode" + } + ] + }, "openSilverPackageVersion": { "type": "generated", "generator": "constant", @@ -95,6 +115,14 @@ "value": "3.1.0" } }, + "modernThemePackageVersion": { + "type": "generated", + "generator": "constant", + "replaces": "ModernThemePackageVersion", + "parameters": { + "value": "3.1.0" + } + }, "webAssemblyPackageVersion": { "type": "generated", "generator": "switch", diff --git a/src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication.Simulator/OpenSilverApplication.Simulator.csproj b/src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication.Simulator/OpenSilverApplication.Simulator.csproj index 37b9afd..45c148c 100644 --- a/src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication.Simulator/OpenSilverApplication.Simulator.csproj +++ b/src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication.Simulator/OpenSilverApplication.Simulator.csproj @@ -2,7 +2,7 @@ WinExe - net472 + net9.0-windows diff --git a/src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication/App.xaml b/src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication/App.xaml index e3f05b8..65dccdc 100644 --- a/src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication/App.xaml +++ b/src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication/App.xaml @@ -8,4 +8,14 @@ + + + + + + + + + + diff --git a/src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication/OpenSilverApplication.csproj b/src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication/OpenSilverApplication.csproj index 9c6177b..aa5431d 100644 --- a/src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication/OpenSilverApplication.csproj +++ b/src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication/OpenSilverApplication.csproj @@ -8,6 +8,9 @@ + + + diff --git a/src/OpenSilver.CLI/C#/OpenSilverBusinessApplication/OpenSilverBusinessApplication.Simulator/OpenSilverBusinessApplication.Simulator.csproj b/src/OpenSilver.CLI/C#/OpenSilverBusinessApplication/OpenSilverBusinessApplication.Simulator/OpenSilverBusinessApplication.Simulator.csproj index eab69bb..90dc99e 100644 --- a/src/OpenSilver.CLI/C#/OpenSilverBusinessApplication/OpenSilverBusinessApplication.Simulator/OpenSilverBusinessApplication.Simulator.csproj +++ b/src/OpenSilver.CLI/C#/OpenSilverBusinessApplication/OpenSilverBusinessApplication.Simulator/OpenSilverBusinessApplication.Simulator.csproj @@ -2,7 +2,7 @@ WinExe - net472 + net9.0-windows diff --git a/src/OpenSilver.CLI/F#/OpenSilverApplication/.template.config/template.json b/src/OpenSilver.CLI/F#/OpenSilverApplication/.template.config/template.json index 54c82a1..0f466d9 100644 --- a/src/OpenSilver.CLI/F#/OpenSilverApplication/.template.config/template.json +++ b/src/OpenSilver.CLI/F#/OpenSilverApplication/.template.config/template.json @@ -71,6 +71,26 @@ } ] }, + "theme": { + "type": "parameter", + "datatype": "string", + "description": "Specifies the theme for the generated OpenSilver application.", + "defaultValue": "classic", + "choices": [ + { + "choice": "classic", + "description": "Classic theme" + }, + { + "choice": "modern-light", + "description": "Modern theme with light mode" + }, + { + "choice": "modern-dark", + "description": "Modern theme with dark mode" + } + ] + }, "openSilverPackageVersion": { "type": "generated", "generator": "constant", @@ -95,6 +115,14 @@ "value": "3.1.0" } }, + "modernThemePackageVersion": { + "type": "generated", + "generator": "constant", + "replaces": "ModernThemePackageVersion", + "parameters": { + "value": "3.1.0" + } + }, "webAssemblyPackageVersion": { "type": "generated", "generator": "switch", diff --git a/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication.Simulator/OpenSilverApplication.Simulator.csproj b/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication.Simulator/OpenSilverApplication.Simulator.csproj index 1d142f9..3f43b84 100644 --- a/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication.Simulator/OpenSilverApplication.Simulator.csproj +++ b/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication.Simulator/OpenSilverApplication.Simulator.csproj @@ -2,7 +2,7 @@ WinExe - net472 + net9.0-windows diff --git a/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication/App.xaml b/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication/App.xaml index e3f05b8..65dccdc 100644 --- a/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication/App.xaml +++ b/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication/App.xaml @@ -8,4 +8,14 @@ + + + + + + + + + + diff --git a/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication/OpenSilverApplication.fsproj b/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication/OpenSilverApplication.fsproj index 305b9bd..5c8ce4d 100644 --- a/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication/OpenSilverApplication.fsproj +++ b/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication/OpenSilverApplication.fsproj @@ -8,6 +8,9 @@ + + + diff --git a/src/OpenSilver.CLI/VB/OpenSilverApplication/.template.config/template.json b/src/OpenSilver.CLI/VB/OpenSilverApplication/.template.config/template.json index 88e2486..db2b646 100644 --- a/src/OpenSilver.CLI/VB/OpenSilverApplication/.template.config/template.json +++ b/src/OpenSilver.CLI/VB/OpenSilverApplication/.template.config/template.json @@ -71,6 +71,26 @@ } ] }, + "theme": { + "type": "parameter", + "datatype": "string", + "description": "Specifies the theme for the generated OpenSilver application.", + "defaultValue": "classic", + "choices": [ + { + "choice": "classic", + "description": "Classic theme" + }, + { + "choice": "modern-light", + "description": "Modern theme with light mode" + }, + { + "choice": "modern-dark", + "description": "Modern theme with dark mode" + } + ] + }, "openSilverPackageVersion": { "type": "generated", "generator": "constant", @@ -95,6 +115,14 @@ "value": "3.1.0" } }, + "modernThemePackageVersion": { + "type": "generated", + "generator": "constant", + "replaces": "ModernThemePackageVersion", + "parameters": { + "value": "3.1.0" + } + }, "webAssemblyPackageVersion": { "type": "generated", "generator": "switch", diff --git a/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication.Simulator/OpenSilverApplication.Simulator.csproj b/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication.Simulator/OpenSilverApplication.Simulator.csproj index 1a2bdb4..28ac880 100644 --- a/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication.Simulator/OpenSilverApplication.Simulator.csproj +++ b/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication.Simulator/OpenSilverApplication.Simulator.csproj @@ -2,7 +2,7 @@ WinExe - net472 + net9.0-windows diff --git a/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication/App.xaml b/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication/App.xaml index e3f05b8..65dccdc 100644 --- a/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication/App.xaml +++ b/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication/App.xaml @@ -8,4 +8,14 @@ + + + + + + + + + + diff --git a/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication/OpenSilverApplication.vbproj b/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication/OpenSilverApplication.vbproj index d4b39e8..88414a9 100644 --- a/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication/OpenSilverApplication.vbproj +++ b/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication/OpenSilverApplication.vbproj @@ -8,6 +8,9 @@ + + + diff --git a/src/OpenSilver.CLI/VB/OpenSilverBusinessApplication/OpenSilverBusinessApplication.Simulator/OpenSilverBusinessApplication.Simulator.csproj b/src/OpenSilver.CLI/VB/OpenSilverBusinessApplication/OpenSilverBusinessApplication.Simulator/OpenSilverBusinessApplication.Simulator.csproj index ba39c45..11e39c5 100644 --- a/src/OpenSilver.CLI/VB/OpenSilverBusinessApplication/OpenSilverBusinessApplication.Simulator/OpenSilverBusinessApplication.Simulator.csproj +++ b/src/OpenSilver.CLI/VB/OpenSilverBusinessApplication/OpenSilverBusinessApplication.Simulator/OpenSilverBusinessApplication.Simulator.csproj @@ -2,7 +2,7 @@ WinExe - net472 + net9.0-windows From 4cb9bd2e7e7429bc69189c9a4d5e0013b2e46989 Mon Sep 17 00:00:00 2001 From: Oussama Babaghayou <35387603+ousspero@users.noreply.github.com> Date: Mon, 2 Dec 2024 09:54:38 +0100 Subject: [PATCH 03/17] Add configurable theme options to the template wizard (#12) * Update XamlDesigner package * Add themes to new dialog * Revert "Update XamlDesigner package" This reverts commit 0eae61109704e021b956a329376e86d6105de5ee. * Update XamlDesigner package * Add support fror F#, VB.NET * Add theme modern to replacements dictionary * Cleanup --------- Co-authored-by: Iakov Lilo --- .../AppConfigurationWindow.xaml | 11 ++- .../AppConfigurationWindow.xaml.cs | 31 +++++++- .../ThemeSelectionEnum.cs | 9 +++ .../AppCustomizationWizard.cs | 71 ++++++++++++++++- .../OpenSilver.TemplateWizards.csproj | 1 + .../OpenSilver.XamlDesigner.csproj | 16 ++-- src/OpenSilver.XamlDesigner/packages.config | 2 +- .../OpenSilverApplication.vstemplate | 79 ++++++++++--------- .../OpenSilverApplication/App.xaml | 2 +- .../root.vstemplate | 69 ++++++++-------- .../root.vstemplate | 69 ++++++++-------- .../OpenSilverApplication.vstemplate | 79 ++++++++++--------- .../OpenSilverFSApplicationTemplate.csproj | 2 +- .../OpenSilverApplication.vstemplate | 1 + 14 files changed, 280 insertions(+), 162 deletions(-) create mode 100644 src/OpenSilver.TemplateWizards/AppCustomizationWindow/ThemeSelectionEnum.cs diff --git a/src/OpenSilver.TemplateWizards/AppCustomizationWindow/AppConfigurationWindow.xaml b/src/OpenSilver.TemplateWizards/AppCustomizationWindow/AppConfigurationWindow.xaml index e0e8447..cb3b6a7 100644 --- a/src/OpenSilver.TemplateWizards/AppCustomizationWindow/AppConfigurationWindow.xaml +++ b/src/OpenSilver.TemplateWizards/AppCustomizationWindow/AppConfigurationWindow.xaml @@ -10,6 +10,7 @@ Title="OpenSilver Configuration" Height="300" Width="350" Icon="Icon.ico"> + @@ -26,7 +27,13 @@ - + + + + + + + - + diff --git a/src/OpenSilver.TemplateWizards/AppCustomizationWindow/AppConfigurationWindow.xaml.cs b/src/OpenSilver.TemplateWizards/AppCustomizationWindow/AppConfigurationWindow.xaml.cs index edbb6c4..7d51dfa 100644 --- a/src/OpenSilver.TemplateWizards/AppCustomizationWindow/AppConfigurationWindow.xaml.cs +++ b/src/OpenSilver.TemplateWizards/AppCustomizationWindow/AppConfigurationWindow.xaml.cs @@ -1,5 +1,7 @@ using System; +using System.Collections.Generic; using System.Windows; +using System.Windows.Controls; namespace OpenSilver.TemplateWizards.AppCustomizationWindow { @@ -8,6 +10,8 @@ namespace OpenSilver.TemplateWizards.AppCustomizationWindow /// public partial class AppConfigurationWindow : Window { + public IDictionary Themes { get; set; } = new Dictionary(); + public string SelectedTheme { get; set; } public OpenSilverBuildType OpenSilverBuildType { get @@ -34,20 +38,45 @@ public DotNetVersion DotNetVersion } } + public AppConfigurationWindow(string openSilverType) { + InitilizeThemes(); InitializeComponent(); - if (openSilverType == "Library") { DotNetVersionStackPanel.Visibility = Visibility.Collapsed; } } + private void InitilizeThemes() + { + Themes.Add(ThemeSelectionEnum.Dark, "Dark"); + Themes.Add(ThemeSelectionEnum.Light, "Light"); + Themes.Add(ThemeSelectionEnum.Classic, "Classic"); + } + private void ButtonContinue_Click(object sender, RoutedEventArgs e) { DialogResult = true; Close(); } + + private void OnThemSelected(object sender, RoutedEventArgs e) + { + + if (sender is RadioButton selectedRadio) + { + try + { + SelectedTheme = Themes[(ThemeSelectionEnum)selectedRadio.Tag]; + } + catch + { + throw new InvalidOperationException("Error retrieving selected theme option"); + } + } + + } } } diff --git a/src/OpenSilver.TemplateWizards/AppCustomizationWindow/ThemeSelectionEnum.cs b/src/OpenSilver.TemplateWizards/AppCustomizationWindow/ThemeSelectionEnum.cs new file mode 100644 index 0000000..7bd0fd2 --- /dev/null +++ b/src/OpenSilver.TemplateWizards/AppCustomizationWindow/ThemeSelectionEnum.cs @@ -0,0 +1,9 @@ +namespace OpenSilver.TemplateWizards.AppCustomizationWindow +{ + public enum ThemeSelectionEnum + { + Dark, + Light, + Classic, + } +} \ No newline at end of file diff --git a/src/OpenSilver.TemplateWizards/AppCustomizationWizard.cs b/src/OpenSilver.TemplateWizards/AppCustomizationWizard.cs index 8ca3ee6..349f6d7 100644 --- a/src/OpenSilver.TemplateWizards/AppCustomizationWizard.cs +++ b/src/OpenSilver.TemplateWizards/AppCustomizationWizard.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; using System.IO; +using System.Linq; using System.Reflection; using System.Windows; using System.Xml.Linq; @@ -13,7 +14,8 @@ namespace OpenSilver.TemplateWizards class AppCustomizationWizard : IWizard { private const string NugetConfig = "NuGet.Config"; - + private Dictionary _replacementsDictionary; + private string _selectedTheme; private static string GetVsixFullPath(string filename) { var vsixDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); @@ -40,7 +42,7 @@ private static void CopyNugetConfig(Dictionary replacementsDicti try { var directoryKey = IsProjectAndSolutionSameDir(replacementsDictionary) ? "$destinationdirectory$" : "$solutiondirectory$"; - var solutionDir = replacementsDictionary.ContainsKey(directoryKey) ? replacementsDictionary[directoryKey] : null; + var solutionDir = replacementsDictionary.ContainsKey(directoryKey) ? replacementsDictionary[directoryKey] : null; var vsixNugetConfig = GetVsixFullPath(NugetConfig); if (solutionDir != null && vsixNugetConfig != null) { @@ -53,6 +55,14 @@ private static void CopyNugetConfig(Dictionary replacementsDicti } } + private string GetFileFullPath(string fileRelativePath) + { + var solutionDir = _replacementsDictionary["$destinationdirectory$"]; + string projectName = _replacementsDictionary["$safeprojectname$"]; + string fullPath = $"{solutionDir}\\{projectName}\\{fileRelativePath}"; + return fullPath; + } + public void BeforeOpeningFile(ProjectItem projectItem) { @@ -60,7 +70,59 @@ public void BeforeOpeningFile(ProjectItem projectItem) public void ProjectFinishedGenerating(Project project) { + if (_selectedTheme.Equals("Classic", StringComparison.OrdinalIgnoreCase)) + return; + + + string projectName = _replacementsDictionary["$safeprojectname$"]; + string language = GetCurrentProgrammingLanguage(); + + string appXamlPath = GetFileFullPath("App.xaml"); + + string OpenSilverCsprojPath = GetFileFullPath($"{projectName}.{language}proj"); + + if (File.Exists(appXamlPath) && File.Exists(OpenSilverCsprojPath)) + { + AddThemePalette(appXamlPath); + AddThemeReferences(OpenSilverCsprojPath); + } + } + + private string GetCurrentProgrammingLanguage() + { + var openSilverInfo = XElement.Parse(_replacementsDictionary["$wizarddata$"]); + XNamespace defaultNamespace = openSilverInfo.GetDefaultNamespace(); + return openSilverInfo.Element(defaultNamespace + "LanguageCode").Value; + } + + private void AddThemePalette(string appXamlPath) + { + var appXamlContent = File.ReadAllText(appXamlPath); + appXamlContent = appXamlContent.Replace( + "", + $"\n\n\n" + ); + XDocument xdoc = XDocument.Parse(appXamlContent); + xdoc.Save(appXamlPath, SaveOptions.None); + } + + private void AddThemeReferences(string path) + { + var csprojDocument = XDocument.Load(path); + var itemGroupWithPackageReference = csprojDocument.Descendants("ItemGroup") + .FirstOrDefault(ig => ig.Elements("PackageReference").Any()); + + if (itemGroupWithPackageReference != null) + { + // Create the new element to insert + var newElement = new XElement("PackageReference", + new XAttribute("Include", "OpenSilver.Themes.Modern"), + new XAttribute("Version", _replacementsDictionary["$opensilverthememodern$"])); + + itemGroupWithPackageReference.Add(newElement); + csprojDocument.Save(path); + } } public void ProjectItemFinishedGenerating(ProjectItem projectItem) @@ -75,6 +137,7 @@ public void RunFinished() public void RunStarted(object automationObject, Dictionary replacementsDictionary, WizardRunKind runKind, object[] customParams) { + XElement openSilverInfo = XElement.Parse(replacementsDictionary["$wizarddata$"]); XNamespace defaultNamespace = openSilverInfo.GetDefaultNamespace(); @@ -119,6 +182,10 @@ public void RunStarted(object automationObject, Dictionary repla replacementsDictionary.Add("$opensilversimulatorpackageversion$", "3.1.0"); replacementsDictionary.Add("$opensilverwebassemblypackageversion$", "3.1.0"); replacementsDictionary.Add("$openria46packageversion$", "3.1.0"); + replacementsDictionary.Add("$opensilverthememodern$", "3.1.0"); + + _replacementsDictionary = replacementsDictionary; + _selectedTheme = window.SelectedTheme; } public bool ShouldAddProjectItem(string filePath) diff --git a/src/OpenSilver.TemplateWizards/OpenSilver.TemplateWizards.csproj b/src/OpenSilver.TemplateWizards/OpenSilver.TemplateWizards.csproj index f8cc621..c538b9d 100644 --- a/src/OpenSilver.TemplateWizards/OpenSilver.TemplateWizards.csproj +++ b/src/OpenSilver.TemplateWizards/OpenSilver.TemplateWizards.csproj @@ -50,6 +50,7 @@ + diff --git a/src/OpenSilver.XamlDesigner/OpenSilver.XamlDesigner.csproj b/src/OpenSilver.XamlDesigner/OpenSilver.XamlDesigner.csproj index dd97716..a4b707a 100644 --- a/src/OpenSilver.XamlDesigner/OpenSilver.XamlDesigner.csproj +++ b/src/OpenSilver.XamlDesigner/OpenSilver.XamlDesigner.csproj @@ -235,22 +235,22 @@ - ..\packages\XamlDesigner.OpenSilver.2.0.0-preview-2024-11-18-031505-451785db\lib\net47\Userware.XamlDesigner.Api.BL.Models.OpenSilver.dll + ..\packages\XamlDesigner.OpenSilver.2.0.0-preview-2024-11-29-035515-8f5b583f\lib\net47\Userware.XamlDesigner.Api.BL.Models.OpenSilver.dll - ..\packages\XamlDesigner.OpenSilver.2.0.0-preview-2024-11-18-031505-451785db\lib\net47\Userware.XamlDesigner.Api.Client.OpenSilver.dll + ..\packages\XamlDesigner.OpenSilver.2.0.0-preview-2024-11-29-035515-8f5b583f\lib\net47\Userware.XamlDesigner.Api.Client.OpenSilver.dll - ..\packages\XamlDesigner.OpenSilver.2.0.0-preview-2024-11-18-031505-451785db\lib\net47\Userware.XamlDesigner.Communication.OpenSilver.dll + ..\packages\XamlDesigner.OpenSilver.2.0.0-preview-2024-11-29-035515-8f5b583f\lib\net47\Userware.XamlDesigner.Communication.OpenSilver.dll - ..\packages\XamlDesigner.OpenSilver.2.0.0-preview-2024-11-18-031505-451785db\lib\net47\Userware.XamlDesigner.Data.Primitives.OpenSilver.dll + ..\packages\XamlDesigner.OpenSilver.2.0.0-preview-2024-11-29-035515-8f5b583f\lib\net47\Userware.XamlDesigner.Data.Primitives.OpenSilver.dll - ..\packages\XamlDesigner.OpenSilver.2.0.0-preview-2024-11-18-031505-451785db\lib\net47\Userware.XamlDesigner.OpenSilver.dll + ..\packages\XamlDesigner.OpenSilver.2.0.0-preview-2024-11-29-035515-8f5b583f\lib\net47\Userware.XamlDesigner.OpenSilver.dll - ..\packages\XamlDesigner.OpenSilver.2.0.0-preview-2024-11-18-031505-451785db\lib\net47\Userware.XamlDesigner.SplitXamlEditor.OpenSilver.dll + ..\packages\XamlDesigner.OpenSilver.2.0.0-preview-2024-11-29-035515-8f5b583f\lib\net47\Userware.XamlDesigner.SplitXamlEditor.OpenSilver.dll @@ -296,11 +296,11 @@ - + - + \ No newline at end of file diff --git a/src/OpenSilver.XamlDesigner/packages.config b/src/OpenSilver.XamlDesigner/packages.config index 2eba5a6..d06848a 100644 --- a/src/OpenSilver.XamlDesigner/packages.config +++ b/src/OpenSilver.XamlDesigner/packages.config @@ -63,5 +63,5 @@ - + \ No newline at end of file diff --git a/src/OpenSilverApplicationTemplate/OpenSilverApplication.vstemplate b/src/OpenSilverApplicationTemplate/OpenSilverApplication.vstemplate index 91c60d2..834b750 100644 --- a/src/OpenSilverApplicationTemplate/OpenSilverApplication.vstemplate +++ b/src/OpenSilverApplicationTemplate/OpenSilverApplication.vstemplate @@ -1,41 +1,42 @@ - - OpenSilver Application - A blank project for creating a rich internet application using OpenSilver. OpenSilver is an open-source reimplementation of Silverlight that runs on current browsers via WebAssembly. - Icon.ico - csharp - csharp - xaml - web - blazor - OpenSilver - 10 - true - OpenSilverApplication - true - true - - - - - OpenSilverApplication.Browser\OpenSilverApplication.Browser.vstemplate - - - OpenSilverApplication\OpenSilverApplication.vstemplate - - - OpenSilverApplication.Simulator\OpenSilverApplication.Simulator.vstemplate - - - - - OpenSilver.TemplateWizards, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - OpenSilver.TemplateWizards.AppCustomizationWizard - - - - Silverlight - Application - - + + OpenSilver Application + A blank project for creating a rich internet application using OpenSilver. OpenSilver is an open-source reimplementation of Silverlight that runs on current browsers via WebAssembly. + Icon.ico + csharp + csharp + xaml + web + blazor + OpenSilver + 10 + true + OpenSilverApplication + true + true + + + + + OpenSilverApplication.Browser\OpenSilverApplication.Browser.vstemplate + + + OpenSilverApplication\OpenSilverApplication.vstemplate + + + OpenSilverApplication.Simulator\OpenSilverApplication.Simulator.vstemplate + + + + + OpenSilver.TemplateWizards, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + OpenSilver.TemplateWizards.AppCustomizationWizard + + + + Silverlight + Application + cs + + \ No newline at end of file diff --git a/src/OpenSilverApplicationTemplate/OpenSilverApplication/App.xaml b/src/OpenSilverApplicationTemplate/OpenSilverApplication/App.xaml index b9ec891..799c875 100644 --- a/src/OpenSilverApplicationTemplate/OpenSilverApplication/App.xaml +++ b/src/OpenSilverApplicationTemplate/OpenSilverApplication/App.xaml @@ -5,7 +5,7 @@ xmlns:local="clr-namespace:$ext_safeprojectname$"> - + diff --git a/src/OpenSilverBusinessApplicationTemplate/root.vstemplate b/src/OpenSilverBusinessApplicationTemplate/root.vstemplate index b73b9fa..2c8f019 100644 --- a/src/OpenSilverBusinessApplicationTemplate/root.vstemplate +++ b/src/OpenSilverBusinessApplicationTemplate/root.vstemplate @@ -1,36 +1,37 @@ - - OpenSilver Business Application (RIA Services) - OpenSilver line-of-business application using Open RIA Services (client/server) - __TemplateIcon.ico - OpenSilverBusinessApplication - true - true - csharp - web - csharp - xaml - web - blazor - OpenSilver - 12 - - - - OpenSilverBusinessApplication\OpenSilverBusinessApplication.vstemplate - OpenSilverBusinessApplication.Browser\OpenSilverBusinessApplication.Browser.vstemplate - OpenSilverBusinessApplication.Simulator\OpenSilverBusinessApplication.Simulator.vstemplate - OpenSilverBusinessApplication.Web\OpenSilverBusinessApplication.Web.vstemplate - - - - OpenSilver.TemplateWizards, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - OpenSilver.TemplateWizards.AppCustomizationWizard - - - - Silverlight - Application - - + + OpenSilver Business Application (RIA Services) + OpenSilver line-of-business application using Open RIA Services (client/server) + __TemplateIcon.ico + OpenSilverBusinessApplication + true + true + csharp + web + csharp + xaml + web + blazor + OpenSilver + 12 + + + + OpenSilverBusinessApplication\OpenSilverBusinessApplication.vstemplate + OpenSilverBusinessApplication.Browser\OpenSilverBusinessApplication.Browser.vstemplate + OpenSilverBusinessApplication.Simulator\OpenSilverBusinessApplication.Simulator.vstemplate + OpenSilverBusinessApplication.Web\OpenSilverBusinessApplication.Web.vstemplate + + + + OpenSilver.TemplateWizards, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + OpenSilver.TemplateWizards.AppCustomizationWizard + + + + Silverlight + Application + cs + + \ No newline at end of file diff --git a/src/OpenSilverBusinessVBApplicationTemplate/root.vstemplate b/src/OpenSilverBusinessVBApplicationTemplate/root.vstemplate index d6a4466..834f5d0 100644 --- a/src/OpenSilverBusinessVBApplicationTemplate/root.vstemplate +++ b/src/OpenSilverBusinessVBApplicationTemplate/root.vstemplate @@ -1,36 +1,37 @@ - - OpenSilver Business Application (RIA Services) (VB) - OpenSilver line-of-business application using Open RIA Services (client/server) - __TemplateIcon.ico - OpenSilverBusinessApplication - true - true - visualbasic - web - visualbasic - xaml - web - blazor - OpenSilver - 16 - - - - OpenSilverBusinessApplication\OpenSilverBusinessApplication.vstemplate - OpenSilverBusinessApplication.Browser\OpenSilverBusinessApplication.Browser.vstemplate - OpenSilverBusinessApplication.Simulator\OpenSilverBusinessApplication.Simulator.vstemplate - OpenSilverBusinessApplication.Web\OpenSilverBusinessApplication.Web.vstemplate - - - - OpenSilver.TemplateWizards, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - OpenSilver.TemplateWizards.AppCustomizationWizard - - - - Silverlight - Application - - + + OpenSilver Business Application (RIA Services) (VB) + OpenSilver line-of-business application using Open RIA Services (client/server) + __TemplateIcon.ico + OpenSilverBusinessApplication + true + true + visualbasic + web + visualbasic + xaml + web + blazor + OpenSilver + 16 + + + + OpenSilverBusinessApplication\OpenSilverBusinessApplication.vstemplate + OpenSilverBusinessApplication.Browser\OpenSilverBusinessApplication.Browser.vstemplate + OpenSilverBusinessApplication.Simulator\OpenSilverBusinessApplication.Simulator.vstemplate + OpenSilverBusinessApplication.Web\OpenSilverBusinessApplication.Web.vstemplate + + + + OpenSilver.TemplateWizards, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + OpenSilver.TemplateWizards.AppCustomizationWizard + + + + Silverlight + Application + vb + + \ No newline at end of file diff --git a/src/OpenSilverFSApplicationTemplate/OpenSilverApplication.vstemplate b/src/OpenSilverFSApplicationTemplate/OpenSilverApplication.vstemplate index 9d19fe6..da2b0c7 100644 --- a/src/OpenSilverFSApplicationTemplate/OpenSilverApplication.vstemplate +++ b/src/OpenSilverFSApplicationTemplate/OpenSilverApplication.vstemplate @@ -1,41 +1,42 @@ - - OpenSilver Application (F#) - A blank project for creating a rich internet application using OpenSilver. OpenSilver is an open-source reimplementation of Silverlight that runs on current browsers via WebAssembly. - Icon.ico - fsharp - fsharp - xaml - web - blazor - OpenSilver - 18 - true - OpenSilverApplication - true - true - - - - - OpenSilverFSApplication.Browser\OpenSilverApplication.Browser.vstemplate - - - OpenSilverFSApplication\OpenSilverApplication.vstemplate - - - OpenSilverFSApplication.Simulator\OpenSilverApplication.Simulator.vstemplate - - - - - OpenSilver.TemplateWizards, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - OpenSilver.TemplateWizards.AppCustomizationWizard - - - - Silverlight - Application - - + + OpenSilver Application (F#) + A blank project for creating a rich internet application using OpenSilver. OpenSilver is an open-source reimplementation of Silverlight that runs on current browsers via WebAssembly. + Icon.ico + fsharp + fsharp + xaml + web + blazor + OpenSilver + 18 + true + OpenSilverApplication + true + true + + + + + OpenSilverFSApplication.Browser\OpenSilverApplication.Browser.vstemplate + + + OpenSilverFSApplication\OpenSilverApplication.vstemplate + + + OpenSilverFSApplication.Simulator\OpenSilverApplication.Simulator.vstemplate + + + + + OpenSilver.TemplateWizards, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + OpenSilver.TemplateWizards.AppCustomizationWizard + + + + Silverlight + Application + fs + + \ No newline at end of file diff --git a/src/OpenSilverFSApplicationTemplate/OpenSilverFSApplicationTemplate.csproj b/src/OpenSilverFSApplicationTemplate/OpenSilverFSApplicationTemplate.csproj index f6146bd..3f8df0f 100644 --- a/src/OpenSilverFSApplicationTemplate/OpenSilverFSApplicationTemplate.csproj +++ b/src/OpenSilverFSApplicationTemplate/OpenSilverFSApplicationTemplate.csproj @@ -13,7 +13,7 @@ Debug AnyCPU {82b43b9b-a64c-4715-b499-d71e9ca2bd60};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - {80832fe2-eb71-4443-b582-61cf0132e241} + {80832FE2-EB71-4443-B582-61CF0132E241} Library Properties $safeprojectname$ diff --git a/src/OpenSilverVBApplicationTemplate/OpenSilverApplication.vstemplate b/src/OpenSilverVBApplicationTemplate/OpenSilverApplication.vstemplate index b2ee91d..750a924 100644 --- a/src/OpenSilverVBApplicationTemplate/OpenSilverApplication.vstemplate +++ b/src/OpenSilverVBApplicationTemplate/OpenSilverApplication.vstemplate @@ -36,6 +36,7 @@ Silverlight Application + vb \ No newline at end of file From cac54696cc1fdd8078eb2774ac8ee60a95f0da7b Mon Sep 17 00:00:00 2001 From: Iakov Lilo Date: Wed, 4 Dec 2024 15:17:47 +1100 Subject: [PATCH 04/17] Remove outdated VSCode configuration for Wasm debugging --- .../C#/OpenSilverApplication/.vscode/launch.json | 16 ---------------- .../.vscode/launch.json | 16 ---------------- .../F#/OpenSilverApplication/.vscode/launch.json | 16 ---------------- .../OpenSilver.CLI.Templates.csproj | 15 --------------- .../VB/OpenSilverApplication/.vscode/launch.json | 16 ---------------- .../.vscode/launch.json | 16 ---------------- 6 files changed, 95 deletions(-) delete mode 100644 src/OpenSilver.CLI/C#/OpenSilverApplication/.vscode/launch.json delete mode 100644 src/OpenSilver.CLI/C#/OpenSilverBusinessApplication/.vscode/launch.json delete mode 100644 src/OpenSilver.CLI/F#/OpenSilverApplication/.vscode/launch.json delete mode 100644 src/OpenSilver.CLI/VB/OpenSilverApplication/.vscode/launch.json delete mode 100644 src/OpenSilver.CLI/VB/OpenSilverBusinessApplication/.vscode/launch.json diff --git a/src/OpenSilver.CLI/C#/OpenSilverApplication/.vscode/launch.json b/src/OpenSilver.CLI/C#/OpenSilverApplication/.vscode/launch.json deleted file mode 100644 index 518e450..0000000 --- a/src/OpenSilver.CLI/C#/OpenSilverApplication/.vscode/launch.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "Launch OpenSilver App", - "type": "blazorwasm", - "request": "launch", - "timeout": 60000, - "url": "http://localhost:55592", - "cwd": "${workspaceFolder}/OpenSilverApplication.Browser" - } - ] -} \ No newline at end of file diff --git a/src/OpenSilver.CLI/C#/OpenSilverBusinessApplication/.vscode/launch.json b/src/OpenSilver.CLI/C#/OpenSilverBusinessApplication/.vscode/launch.json deleted file mode 100644 index 77569e8..0000000 --- a/src/OpenSilver.CLI/C#/OpenSilverBusinessApplication/.vscode/launch.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "Launch OpenSilver App", - "type": "blazorwasm", - "request": "launch", - "timeout": 60000, - "url": "http://localhost:55592", - "cwd": "${workspaceFolder}/OpenSilverBusinessApplication.Browser" - } - ] -} \ No newline at end of file diff --git a/src/OpenSilver.CLI/F#/OpenSilverApplication/.vscode/launch.json b/src/OpenSilver.CLI/F#/OpenSilverApplication/.vscode/launch.json deleted file mode 100644 index 518e450..0000000 --- a/src/OpenSilver.CLI/F#/OpenSilverApplication/.vscode/launch.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "Launch OpenSilver App", - "type": "blazorwasm", - "request": "launch", - "timeout": 60000, - "url": "http://localhost:55592", - "cwd": "${workspaceFolder}/OpenSilverApplication.Browser" - } - ] -} \ No newline at end of file diff --git a/src/OpenSilver.CLI/OpenSilver.CLI.Templates.csproj b/src/OpenSilver.CLI/OpenSilver.CLI.Templates.csproj index 41a737c..ef9c43c 100644 --- a/src/OpenSilver.CLI/OpenSilver.CLI.Templates.csproj +++ b/src/OpenSilver.CLI/OpenSilver.CLI.Templates.csproj @@ -36,19 +36,4 @@ - - - Code - - - Code - - - Code - - - Code - - - \ No newline at end of file diff --git a/src/OpenSilver.CLI/VB/OpenSilverApplication/.vscode/launch.json b/src/OpenSilver.CLI/VB/OpenSilverApplication/.vscode/launch.json deleted file mode 100644 index 518e450..0000000 --- a/src/OpenSilver.CLI/VB/OpenSilverApplication/.vscode/launch.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "Launch OpenSilver App", - "type": "blazorwasm", - "request": "launch", - "timeout": 60000, - "url": "http://localhost:55592", - "cwd": "${workspaceFolder}/OpenSilverApplication.Browser" - } - ] -} \ No newline at end of file diff --git a/src/OpenSilver.CLI/VB/OpenSilverBusinessApplication/.vscode/launch.json b/src/OpenSilver.CLI/VB/OpenSilverBusinessApplication/.vscode/launch.json deleted file mode 100644 index 77569e8..0000000 --- a/src/OpenSilver.CLI/VB/OpenSilverBusinessApplication/.vscode/launch.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "Launch OpenSilver App", - "type": "blazorwasm", - "request": "launch", - "timeout": 60000, - "url": "http://localhost:55592", - "cwd": "${workspaceFolder}/OpenSilverBusinessApplication.Browser" - } - ] -} \ No newline at end of file From 1b150d6933a004d0faaa31726ad2fc5b991ba782 Mon Sep 17 00:00:00 2001 From: Iakov Lilo Date: Thu, 5 Dec 2024 16:40:59 +1100 Subject: [PATCH 05/17] Use version 3.1.* for Modern Theme --- .../C#/OpenSilverApplication/.template.config/template.json | 2 +- .../F#/OpenSilverApplication/.template.config/template.json | 2 +- .../VB/OpenSilverApplication/.template.config/template.json | 2 +- src/OpenSilver.TemplateWizards/AppCustomizationWizard.cs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/OpenSilver.CLI/C#/OpenSilverApplication/.template.config/template.json b/src/OpenSilver.CLI/C#/OpenSilverApplication/.template.config/template.json index 92a92a6..0a5b73b 100644 --- a/src/OpenSilver.CLI/C#/OpenSilverApplication/.template.config/template.json +++ b/src/OpenSilver.CLI/C#/OpenSilverApplication/.template.config/template.json @@ -120,7 +120,7 @@ "generator": "constant", "replaces": "ModernThemePackageVersion", "parameters": { - "value": "3.1.0" + "value": "3.1.*" } }, "webAssemblyPackageVersion": { diff --git a/src/OpenSilver.CLI/F#/OpenSilverApplication/.template.config/template.json b/src/OpenSilver.CLI/F#/OpenSilverApplication/.template.config/template.json index 0f466d9..94c06f6 100644 --- a/src/OpenSilver.CLI/F#/OpenSilverApplication/.template.config/template.json +++ b/src/OpenSilver.CLI/F#/OpenSilverApplication/.template.config/template.json @@ -120,7 +120,7 @@ "generator": "constant", "replaces": "ModernThemePackageVersion", "parameters": { - "value": "3.1.0" + "value": "3.1.*" } }, "webAssemblyPackageVersion": { diff --git a/src/OpenSilver.CLI/VB/OpenSilverApplication/.template.config/template.json b/src/OpenSilver.CLI/VB/OpenSilverApplication/.template.config/template.json index db2b646..9fa493f 100644 --- a/src/OpenSilver.CLI/VB/OpenSilverApplication/.template.config/template.json +++ b/src/OpenSilver.CLI/VB/OpenSilverApplication/.template.config/template.json @@ -120,7 +120,7 @@ "generator": "constant", "replaces": "ModernThemePackageVersion", "parameters": { - "value": "3.1.0" + "value": "3.1.*" } }, "webAssemblyPackageVersion": { diff --git a/src/OpenSilver.TemplateWizards/AppCustomizationWizard.cs b/src/OpenSilver.TemplateWizards/AppCustomizationWizard.cs index 349f6d7..32c14d6 100644 --- a/src/OpenSilver.TemplateWizards/AppCustomizationWizard.cs +++ b/src/OpenSilver.TemplateWizards/AppCustomizationWizard.cs @@ -182,7 +182,7 @@ public void RunStarted(object automationObject, Dictionary repla replacementsDictionary.Add("$opensilversimulatorpackageversion$", "3.1.0"); replacementsDictionary.Add("$opensilverwebassemblypackageversion$", "3.1.0"); replacementsDictionary.Add("$openria46packageversion$", "3.1.0"); - replacementsDictionary.Add("$opensilverthememodern$", "3.1.0"); + replacementsDictionary.Add("$opensilverthememodern$", "3.1.*"); _replacementsDictionary = replacementsDictionary; _selectedTheme = window.SelectedTheme; From 9c44567b996745e9d37669fbd02de985b1b8a0ce Mon Sep 17 00:00:00 2001 From: Iakov Lilo Date: Sat, 7 Dec 2024 14:18:37 +1100 Subject: [PATCH 06/17] Prioritize cross-platform launching profile --- .../Properties/launchSettings.json | 15 ++++++++------- .../Properties/launchSettings.json | 15 ++++++++------- .../Properties/launchSettings.json | 15 ++++++++------- .../Properties/launchSettings.json | 15 ++++++++------- .../Properties/launchSettings.json | 15 ++++++++------- .../Properties/launchSettings.json | 15 ++++++++------- .../Properties/launchSettings.json | 15 ++++++++------- .../Properties/launchSettings.json | 15 ++++++++------- .../Properties/launchSettings.json | 15 ++++++++------- .../Properties/launchSettings.json | 15 ++++++++------- 10 files changed, 80 insertions(+), 70 deletions(-) diff --git a/src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication.Browser/Properties/launchSettings.json b/src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication.Browser/Properties/launchSettings.json index 6a2b151..e79929a 100644 --- a/src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication.Browser/Properties/launchSettings.json +++ b/src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication.Browser/Properties/launchSettings.json @@ -8,22 +8,23 @@ } }, "profiles": { - "IIS Express": { - "commandName": "IISExpress", + "OpenSilverApplication.Browser": { + "commandName": "Project", + "dotnetRunMessages": true, "launchBrowser": true, "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" - } + }, + "applicationUrl": "http://localhost:55592/" }, - "OpenSilverApplication.Browser": { - "commandName": "Project", + "IIS Express": { + "commandName": "IISExpress", "launchBrowser": true, "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" - }, - "applicationUrl": "http://localhost:55592/" + } } } } \ No newline at end of file diff --git a/src/OpenSilver.CLI/C#/OpenSilverBusinessApplication/OpenSilverBusinessApplication.Browser/Properties/launchSettings.json b/src/OpenSilver.CLI/C#/OpenSilverBusinessApplication/OpenSilverBusinessApplication.Browser/Properties/launchSettings.json index 529c28c..85d4ab5 100644 --- a/src/OpenSilver.CLI/C#/OpenSilverBusinessApplication/OpenSilverBusinessApplication.Browser/Properties/launchSettings.json +++ b/src/OpenSilver.CLI/C#/OpenSilverBusinessApplication/OpenSilverBusinessApplication.Browser/Properties/launchSettings.json @@ -8,22 +8,23 @@ } }, "profiles": { - "IIS Express": { - "commandName": "IISExpress", + "OpenSilverBusinessApplication.Browser": { + "commandName": "Project", + "dotnetRunMessages": true, "launchBrowser": true, "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" - } + }, + "applicationUrl": "http://localhost:55592/" }, - "OpenSilverBusinessApplication.Browser": { - "commandName": "Project", + "IIS Express": { + "commandName": "IISExpress", "launchBrowser": true, "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" - }, - "applicationUrl": "http://localhost:55592/" + } } } } \ No newline at end of file diff --git a/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication.Browser/Properties/launchSettings.json b/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication.Browser/Properties/launchSettings.json index 6a2b151..e79929a 100644 --- a/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication.Browser/Properties/launchSettings.json +++ b/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication.Browser/Properties/launchSettings.json @@ -8,22 +8,23 @@ } }, "profiles": { - "IIS Express": { - "commandName": "IISExpress", + "OpenSilverApplication.Browser": { + "commandName": "Project", + "dotnetRunMessages": true, "launchBrowser": true, "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" - } + }, + "applicationUrl": "http://localhost:55592/" }, - "OpenSilverApplication.Browser": { - "commandName": "Project", + "IIS Express": { + "commandName": "IISExpress", "launchBrowser": true, "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" - }, - "applicationUrl": "http://localhost:55592/" + } } } } \ No newline at end of file diff --git a/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication.Browser/Properties/launchSettings.json b/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication.Browser/Properties/launchSettings.json index 6a2b151..e79929a 100644 --- a/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication.Browser/Properties/launchSettings.json +++ b/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication.Browser/Properties/launchSettings.json @@ -8,22 +8,23 @@ } }, "profiles": { - "IIS Express": { - "commandName": "IISExpress", + "OpenSilverApplication.Browser": { + "commandName": "Project", + "dotnetRunMessages": true, "launchBrowser": true, "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" - } + }, + "applicationUrl": "http://localhost:55592/" }, - "OpenSilverApplication.Browser": { - "commandName": "Project", + "IIS Express": { + "commandName": "IISExpress", "launchBrowser": true, "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" - }, - "applicationUrl": "http://localhost:55592/" + } } } } \ No newline at end of file diff --git a/src/OpenSilver.CLI/VB/OpenSilverBusinessApplication/OpenSilverBusinessApplication.Browser/Properties/launchSettings.json b/src/OpenSilver.CLI/VB/OpenSilverBusinessApplication/OpenSilverBusinessApplication.Browser/Properties/launchSettings.json index 529c28c..85d4ab5 100644 --- a/src/OpenSilver.CLI/VB/OpenSilverBusinessApplication/OpenSilverBusinessApplication.Browser/Properties/launchSettings.json +++ b/src/OpenSilver.CLI/VB/OpenSilverBusinessApplication/OpenSilverBusinessApplication.Browser/Properties/launchSettings.json @@ -8,22 +8,23 @@ } }, "profiles": { - "IIS Express": { - "commandName": "IISExpress", + "OpenSilverBusinessApplication.Browser": { + "commandName": "Project", + "dotnetRunMessages": true, "launchBrowser": true, "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" - } + }, + "applicationUrl": "http://localhost:55592/" }, - "OpenSilverBusinessApplication.Browser": { - "commandName": "Project", + "IIS Express": { + "commandName": "IISExpress", "launchBrowser": true, "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" - }, - "applicationUrl": "http://localhost:55592/" + } } } } \ No newline at end of file diff --git a/src/OpenSilverApplicationTemplate/OpenSilverApplication.Browser/Properties/launchSettings.json b/src/OpenSilverApplicationTemplate/OpenSilverApplication.Browser/Properties/launchSettings.json index 7b865db..990c3f6 100644 --- a/src/OpenSilverApplicationTemplate/OpenSilverApplication.Browser/Properties/launchSettings.json +++ b/src/OpenSilverApplicationTemplate/OpenSilverApplication.Browser/Properties/launchSettings.json @@ -8,22 +8,23 @@ } }, "profiles": { - "IIS Express": { - "commandName": "IISExpress", + "$safeprojectname$": { + "commandName": "Project", + "dotnetRunMessages": true, "launchBrowser": true, "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" - } + }, + "applicationUrl": "http://localhost:55592/" }, - "$safeprojectname$": { - "commandName": "Project", + "IIS Express": { + "commandName": "IISExpress", "launchBrowser": true, "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" - }, - "applicationUrl": "http://localhost:55592/" + } } } } \ No newline at end of file diff --git a/src/OpenSilverBusinessApplicationTemplate/OpenSilverBusinessApplication.Browser/Properties/launchSettings.json b/src/OpenSilverBusinessApplicationTemplate/OpenSilverBusinessApplication.Browser/Properties/launchSettings.json index 8a5ea8f..4faa042 100644 --- a/src/OpenSilverBusinessApplicationTemplate/OpenSilverBusinessApplication.Browser/Properties/launchSettings.json +++ b/src/OpenSilverBusinessApplicationTemplate/OpenSilverBusinessApplication.Browser/Properties/launchSettings.json @@ -8,22 +8,23 @@ } }, "profiles": { - "IIS Express": { - "commandName": "IISExpress", + "$safeprojectname$": { + "commandName": "Project", + "dotnetRunMessages": true, "launchBrowser": true, "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" - } + }, + "applicationUrl": "http://localhost:55592/" }, - "$safeprojectname$": { - "commandName": "Project", + "IIS Express": { + "commandName": "IISExpress", "launchBrowser": true, "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" - }, - "applicationUrl": "http://localhost:55592/" + } } } } \ No newline at end of file diff --git a/src/OpenSilverBusinessVBApplicationTemplate/OpenSilverBusinessApplication.Browser/Properties/launchSettings.json b/src/OpenSilverBusinessVBApplicationTemplate/OpenSilverBusinessApplication.Browser/Properties/launchSettings.json index 7b865db..990c3f6 100644 --- a/src/OpenSilverBusinessVBApplicationTemplate/OpenSilverBusinessApplication.Browser/Properties/launchSettings.json +++ b/src/OpenSilverBusinessVBApplicationTemplate/OpenSilverBusinessApplication.Browser/Properties/launchSettings.json @@ -8,22 +8,23 @@ } }, "profiles": { - "IIS Express": { - "commandName": "IISExpress", + "$safeprojectname$": { + "commandName": "Project", + "dotnetRunMessages": true, "launchBrowser": true, "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" - } + }, + "applicationUrl": "http://localhost:55592/" }, - "$safeprojectname$": { - "commandName": "Project", + "IIS Express": { + "commandName": "IISExpress", "launchBrowser": true, "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" - }, - "applicationUrl": "http://localhost:55592/" + } } } } \ No newline at end of file diff --git a/src/OpenSilverFSApplicationTemplate/OpenSilverFSApplication.Browser/Properties/launchSettings.json b/src/OpenSilverFSApplicationTemplate/OpenSilverFSApplication.Browser/Properties/launchSettings.json index 7b865db..990c3f6 100644 --- a/src/OpenSilverFSApplicationTemplate/OpenSilverFSApplication.Browser/Properties/launchSettings.json +++ b/src/OpenSilverFSApplicationTemplate/OpenSilverFSApplication.Browser/Properties/launchSettings.json @@ -8,22 +8,23 @@ } }, "profiles": { - "IIS Express": { - "commandName": "IISExpress", + "$safeprojectname$": { + "commandName": "Project", + "dotnetRunMessages": true, "launchBrowser": true, "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" - } + }, + "applicationUrl": "http://localhost:55592/" }, - "$safeprojectname$": { - "commandName": "Project", + "IIS Express": { + "commandName": "IISExpress", "launchBrowser": true, "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" - }, - "applicationUrl": "http://localhost:55592/" + } } } } \ No newline at end of file diff --git a/src/OpenSilverVBApplicationTemplate/OpenSilverVBApplication.Browser/Properties/launchSettings.json b/src/OpenSilverVBApplicationTemplate/OpenSilverVBApplication.Browser/Properties/launchSettings.json index 7b865db..990c3f6 100644 --- a/src/OpenSilverVBApplicationTemplate/OpenSilverVBApplication.Browser/Properties/launchSettings.json +++ b/src/OpenSilverVBApplicationTemplate/OpenSilverVBApplication.Browser/Properties/launchSettings.json @@ -8,22 +8,23 @@ } }, "profiles": { - "IIS Express": { - "commandName": "IISExpress", + "$safeprojectname$": { + "commandName": "Project", + "dotnetRunMessages": true, "launchBrowser": true, "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" - } + }, + "applicationUrl": "http://localhost:55592/" }, - "$safeprojectname$": { - "commandName": "Project", + "IIS Express": { + "commandName": "IISExpress", "launchBrowser": true, "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" - }, - "applicationUrl": "http://localhost:55592/" + } } } } \ No newline at end of file From c9fe53c77e40962934a6340dc15f8dc16ca26578 Mon Sep 17 00:00:00 2001 From: Iakov Lilo Date: Sat, 7 Dec 2024 14:30:08 +1100 Subject: [PATCH 07/17] Use WebAssembly packages version 8.0.11 for .NET 8 --- .../C#/OpenSilverApplication/.template.config/template.json | 2 +- .../.template.config/template.json | 2 +- .../F#/OpenSilverApplication/.template.config/template.json | 2 +- .../VB/OpenSilverApplication/.template.config/template.json | 2 +- .../.template.config/template.json | 2 +- src/OpenSilver.TemplateWizards/AppCustomizationWizard.cs | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/OpenSilver.CLI/C#/OpenSilverApplication/.template.config/template.json b/src/OpenSilver.CLI/C#/OpenSilverApplication/.template.config/template.json index 0a5b73b..450689e 100644 --- a/src/OpenSilver.CLI/C#/OpenSilverApplication/.template.config/template.json +++ b/src/OpenSilver.CLI/C#/OpenSilverApplication/.template.config/template.json @@ -137,7 +137,7 @@ }, { "condition": "(targetFramework == 'net8.0')", - "value": "8.0.0" + "value": "8.0.11" }, { "condition": "(targetFramework == 'net9.0')", diff --git a/src/OpenSilver.CLI/C#/OpenSilverBusinessApplication/.template.config/template.json b/src/OpenSilver.CLI/C#/OpenSilverBusinessApplication/.template.config/template.json index e52e2cd..e8073a9 100644 --- a/src/OpenSilver.CLI/C#/OpenSilverBusinessApplication/.template.config/template.json +++ b/src/OpenSilver.CLI/C#/OpenSilverBusinessApplication/.template.config/template.json @@ -103,7 +103,7 @@ }, { "condition": "(targetFramework == 'net8.0')", - "value": "8.0.0" + "value": "8.0.11" }, { "condition": "(targetFramework == 'net9.0')", diff --git a/src/OpenSilver.CLI/F#/OpenSilverApplication/.template.config/template.json b/src/OpenSilver.CLI/F#/OpenSilverApplication/.template.config/template.json index 94c06f6..97e010b 100644 --- a/src/OpenSilver.CLI/F#/OpenSilverApplication/.template.config/template.json +++ b/src/OpenSilver.CLI/F#/OpenSilverApplication/.template.config/template.json @@ -137,7 +137,7 @@ }, { "condition": "(targetFramework == 'net8.0')", - "value": "8.0.0" + "value": "8.0.11" }, { "condition": "(targetFramework == 'net9.0')", diff --git a/src/OpenSilver.CLI/VB/OpenSilverApplication/.template.config/template.json b/src/OpenSilver.CLI/VB/OpenSilverApplication/.template.config/template.json index 9fa493f..231830e 100644 --- a/src/OpenSilver.CLI/VB/OpenSilverApplication/.template.config/template.json +++ b/src/OpenSilver.CLI/VB/OpenSilverApplication/.template.config/template.json @@ -137,7 +137,7 @@ }, { "condition": "(targetFramework == 'net8.0')", - "value": "8.0.0" + "value": "8.0.11" }, { "condition": "(targetFramework == 'net9.0')", diff --git a/src/OpenSilver.CLI/VB/OpenSilverBusinessApplication/.template.config/template.json b/src/OpenSilver.CLI/VB/OpenSilverBusinessApplication/.template.config/template.json index 4484cb4..4a2e0da 100644 --- a/src/OpenSilver.CLI/VB/OpenSilverBusinessApplication/.template.config/template.json +++ b/src/OpenSilver.CLI/VB/OpenSilverBusinessApplication/.template.config/template.json @@ -103,7 +103,7 @@ }, { "condition": "(targetFramework == 'net8.0')", - "value": "8.0.0" + "value": "8.0.11" }, { "condition": "(targetFramework == 'net9.0')", diff --git a/src/OpenSilver.TemplateWizards/AppCustomizationWizard.cs b/src/OpenSilver.TemplateWizards/AppCustomizationWizard.cs index 32c14d6..b67e423 100644 --- a/src/OpenSilver.TemplateWizards/AppCustomizationWizard.cs +++ b/src/OpenSilver.TemplateWizards/AppCustomizationWizard.cs @@ -167,7 +167,7 @@ public void RunStarted(object automationObject, Dictionary repla break; case DotNetVersion.Net8: replacementsDictionary.Add("$targetframework$", "net8.0"); - replacementsDictionary.Add("$blazorpackagesversion$", "8.0.0"); + replacementsDictionary.Add("$blazorpackagesversion$", "8.0.11"); break; case DotNetVersion.Net9: replacementsDictionary.Add("$targetframework$", "net9.0"); From 4a86a58734f055b685f920ad57d540b47db58086 Mon Sep 17 00:00:00 2001 From: Oussama Babaghayou <35387603+ousspero@users.noreply.github.com> Date: Mon, 9 Dec 2024 03:08:54 +0100 Subject: [PATCH 08/17] Improve "New project dialog" design (#13) * Improve "New project dialog" design * Ajdust the font weight --- .../AppConfigurationWindow.xaml | 88 ++++++++--- .../AppConfigurationWindow.xaml.cs | 11 +- .../Models/ThemeOption.cs | 22 +++ .../ThemeCollectionView.xaml | 145 ++++++++++++++++++ .../ThemeCollectionView.xaml.cs | 38 +++++ .../Assets/Images/classic_theme.png | Bin 0 -> 3838 bytes .../Assets/Images/dark_theme.png | Bin 0 -> 4224 bytes .../Assets/Images/light_theme.png | Bin 0 -> 6143 bytes .../OpenSilver.TemplateWizards.csproj | 14 ++ 9 files changed, 294 insertions(+), 24 deletions(-) create mode 100644 src/OpenSilver.TemplateWizards/AppCustomizationWindow/Models/ThemeOption.cs create mode 100644 src/OpenSilver.TemplateWizards/AppCustomizationWindow/ThemeCollectionView.xaml create mode 100644 src/OpenSilver.TemplateWizards/AppCustomizationWindow/ThemeCollectionView.xaml.cs create mode 100644 src/OpenSilver.TemplateWizards/Assets/Images/classic_theme.png create mode 100644 src/OpenSilver.TemplateWizards/Assets/Images/dark_theme.png create mode 100644 src/OpenSilver.TemplateWizards/Assets/Images/light_theme.png diff --git a/src/OpenSilver.TemplateWizards/AppCustomizationWindow/AppConfigurationWindow.xaml b/src/OpenSilver.TemplateWizards/AppCustomizationWindow/AppConfigurationWindow.xaml index cb3b6a7..4e36534 100644 --- a/src/OpenSilver.TemplateWizards/AppCustomizationWindow/AppConfigurationWindow.xaml +++ b/src/OpenSilver.TemplateWizards/AppCustomizationWindow/AppConfigurationWindow.xaml @@ -7,49 +7,77 @@ WindowStartupLocation="CenterScreen" ResizeMode="NoResize" mc:Ignorable="d" - Title="OpenSilver Configuration" Height="300" Width="350" Icon="Icon.ico"> + Title="OpenSilver Configuration" Height="600" Width="660" Icon="Icon.ico"> - + + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + .NET 7 .NET 8 .NET 9 - - - - - - - - - + + - - - - + + + + - + + + - + + + + + diff --git a/src/OpenSilver.TemplateWizards/AppCustomizationWindow/AppConfigurationWindow.xaml.cs b/src/OpenSilver.TemplateWizards/AppCustomizationWindow/AppConfigurationWindow.xaml.cs index 7d51dfa..279a4f4 100644 --- a/src/OpenSilver.TemplateWizards/AppCustomizationWindow/AppConfigurationWindow.xaml.cs +++ b/src/OpenSilver.TemplateWizards/AppCustomizationWindow/AppConfigurationWindow.xaml.cs @@ -1,4 +1,5 @@ -using System; +using OpenSilver.TemplateWizards.AppCustomizationWindow.Models; +using System; using System.Collections.Generic; using System.Windows; using System.Windows.Controls; @@ -45,7 +46,7 @@ public AppConfigurationWindow(string openSilverType) InitializeComponent(); if (openSilverType == "Library") { - DotNetVersionStackPanel.Visibility = Visibility.Collapsed; + DotNetVersionPanel.Visibility = Visibility.Collapsed; } } @@ -78,5 +79,11 @@ private void OnThemSelected(object sender, RoutedEventArgs e) } } + + private void ThemeCollectionView_SelectionChanged(object sender, EventArgs e) + { + SelectedTheme= (sender as ThemeOptions).Name; + continueBtn.IsEnabled = true; + } } } diff --git a/src/OpenSilver.TemplateWizards/AppCustomizationWindow/Models/ThemeOption.cs b/src/OpenSilver.TemplateWizards/AppCustomizationWindow/Models/ThemeOption.cs new file mode 100644 index 0000000..fba3b48 --- /dev/null +++ b/src/OpenSilver.TemplateWizards/AppCustomizationWindow/Models/ThemeOption.cs @@ -0,0 +1,22 @@ +using System.Collections.Generic; +using System.Runtime.CompilerServices; + +namespace OpenSilver.TemplateWizards.AppCustomizationWindow.Models +{ + public class ThemeOptions + { + public string ThumbnailUri { get; set; } + public string Name { get; set; } + public string Title { get; set; } + public string BackgroundColor { get; set; } + + public static IEnumerable GeThemes() + { + var themes = new List(); + themes.Add(new ThemeOptions { Name="Light",Title = "Modern - Light", ThumbnailUri = "/OpenSilver.TemplateWizards;component/Assets/Images/light_theme.png", BackgroundColor = "#FFFFFF" }); + themes.Add(new ThemeOptions { Name="Dark",Title = "Modern - Dark", ThumbnailUri = "/OpenSilver.TemplateWizards;component/Assets/Images/dark_theme.png", BackgroundColor = "#111111" }); + themes.Add(new ThemeOptions { Name="Classic",Title = "Classic - Silverlight", ThumbnailUri = "/OpenSilver.TemplateWizards;component/Assets/Images/classic_theme.png", BackgroundColor = "#FFFFFF" }); + return themes; + } + } +} diff --git a/src/OpenSilver.TemplateWizards/AppCustomizationWindow/ThemeCollectionView.xaml b/src/OpenSilver.TemplateWizards/AppCustomizationWindow/ThemeCollectionView.xaml new file mode 100644 index 0000000..1730f68 --- /dev/null +++ b/src/OpenSilver.TemplateWizards/AppCustomizationWindow/ThemeCollectionView.xaml @@ -0,0 +1,145 @@ + + + + + + + + + + + + + + diff --git a/src/OpenSilver.TemplateWizards/AppCustomizationWindow/ThemeCollectionView.xaml.cs b/src/OpenSilver.TemplateWizards/AppCustomizationWindow/ThemeCollectionView.xaml.cs new file mode 100644 index 0000000..3bf4426 --- /dev/null +++ b/src/OpenSilver.TemplateWizards/AppCustomizationWindow/ThemeCollectionView.xaml.cs @@ -0,0 +1,38 @@ +using OpenSilver.TemplateWizards.AppCustomizationWindow.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace OpenSilver.TemplateWizards.AppCustomizationWindow +{ + /// + /// Interaction logic for ThemeCollectionView.xaml + /// + public partial class ThemeCollectionView : UserControl + { + public event EventHandler SelectionChanged; + public ThemeCollectionView() + { + InitializeComponent(); + themeList.ItemsSource = ThemeOptions.GeThemes(); + themeList.SelectionChanged += ThemeList_SelectionChanged; + } + + private void ThemeList_SelectionChanged(object sender, SelectionChangedEventArgs e) + { + + SelectionChanged?.Invoke(themeList.SelectedItem, e); + } + } +} diff --git a/src/OpenSilver.TemplateWizards/Assets/Images/classic_theme.png b/src/OpenSilver.TemplateWizards/Assets/Images/classic_theme.png new file mode 100644 index 0000000000000000000000000000000000000000..ee5f2ac02e78ab49ea44af82d3d45462979122b7 GIT binary patch literal 3838 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 literal 0 HcmV?d00001 diff --git a/src/OpenSilver.TemplateWizards/Assets/Images/light_theme.png b/src/OpenSilver.TemplateWizards/Assets/Images/light_theme.png new file mode 100644 index 0000000000000000000000000000000000000000..62bfa68dd87f11bf72472ddc29f535cd56917a88 GIT binary patch literal 6143 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 literal 0 HcmV?d00001 diff --git a/src/OpenSilver.TemplateWizards/OpenSilver.TemplateWizards.csproj b/src/OpenSilver.TemplateWizards/OpenSilver.TemplateWizards.csproj index c538b9d..05c814d 100644 --- a/src/OpenSilver.TemplateWizards/OpenSilver.TemplateWizards.csproj +++ b/src/OpenSilver.TemplateWizards/OpenSilver.TemplateWizards.csproj @@ -49,7 +49,11 @@ AppConfigurationWindow.xaml + + + ThemeCollectionView.xaml + @@ -59,6 +63,10 @@ MSBuild:Compile Designer + + Designer + MSBuild:Compile + @@ -67,5 +75,11 @@ + + + + + + \ No newline at end of file From 75d397f2f3222dfdb5c456718f1a2c5fb0054e47 Mon Sep 17 00:00:00 2001 From: Iakov Lilo Date: Tue, 10 Dec 2024 16:47:06 +1100 Subject: [PATCH 09/17] Add reference to palette colors for consistent styling --- .../.template.config/template.json | 48 +++++++++++++++++-- .../OpenSilverApplication.Browser.csproj | 6 +-- .../OpenSilverApplication.Simulator.csproj | 2 +- .../OpenSilverApplication/MainPage.xaml | 5 +- .../OpenSilverApplication.csproj | 4 +- .../.template.config/template.json | 10 ++-- ...enSilverBusinessApplication.Browser.csproj | 6 +-- ...SilverBusinessApplication.Simulator.csproj | 2 +- .../OpenSilverBusinessApplication.csproj | 10 ++-- .../.template.config/template.json | 2 +- .../OpenSilverClassLibrary.csproj | 2 +- .../.template.config/template.json | 48 +++++++++++++++++-- .../OpenSilverApplication.Browser.csproj | 6 +-- .../OpenSilverApplication.Simulator.csproj | 2 +- .../OpenSilverApplication/MainPage.xaml | 5 +- .../OpenSilverApplication.fsproj | 4 +- .../.template.config/template.json | 2 +- .../OpenSilverClassLibrary.fsproj | 2 +- .../.template.config/template.json | 48 +++++++++++++++++-- .../OpenSilverApplication.Browser.csproj | 6 +-- .../OpenSilverApplication.Simulator.csproj | 2 +- .../OpenSilverApplication/MainPage.xaml | 5 +- .../OpenSilverApplication.vbproj | 4 +- .../.template.config/template.json | 10 ++-- ...enSilverBusinessApplication.Browser.csproj | 6 +-- ...SilverBusinessApplication.Simulator.csproj | 2 +- .../OpenSilverBusinessApplication.vbproj | 10 ++-- .../.template.config/template.json | 2 +- .../OpenSilverClassLibrary.vbproj | 2 +- 29 files changed, 190 insertions(+), 73 deletions(-) diff --git a/src/OpenSilver.CLI/C#/OpenSilverApplication/.template.config/template.json b/src/OpenSilver.CLI/C#/OpenSilverApplication/.template.config/template.json index 450689e..7de540f 100644 --- a/src/OpenSilver.CLI/C#/OpenSilverApplication/.template.config/template.json +++ b/src/OpenSilver.CLI/C#/OpenSilverApplication/.template.config/template.json @@ -94,7 +94,7 @@ "openSilverPackageVersion": { "type": "generated", "generator": "constant", - "replaces": "OpenSilverPackageVersion", + "replaces": "$OpenSilverPackageVersion$", "parameters": { "value": "3.1.0" } @@ -102,7 +102,7 @@ "openSilverSimulatorPackageVersion": { "type": "generated", "generator": "constant", - "replaces": "OpenSilverSimulatorPackageVersion", + "replaces": "$OpenSilverSimulatorPackageVersion$", "parameters": { "value": "3.1.0" } @@ -110,7 +110,7 @@ "openSilverWebAssemblyPackageVersion": { "type": "generated", "generator": "constant", - "replaces": "OpenSilverWebAssemblyPackageVersion", + "replaces": "$OpenSilverWebAssemblyPackageVersion$", "parameters": { "value": "3.1.0" } @@ -118,7 +118,7 @@ "modernThemePackageVersion": { "type": "generated", "generator": "constant", - "replaces": "ModernThemePackageVersion", + "replaces": "$ModernThemePackageVersion$", "parameters": { "value": "3.1.*" } @@ -127,7 +127,7 @@ "type": "generated", "generator": "switch", "datatype": "string", - "replaces": "WebAssemblyPackageVersion", + "replaces": "$WebAssemblyPackageVersion$", "parameters": { "evaluator": "C++", "cases": [ @@ -146,6 +146,44 @@ ] } }, + "pageForeground": { + "type": "generated", + "generator": "switch", + "datatype": "string", + "replaces": "$PageForeground$", + "parameters": { + "evaluator": "C++", + "cases": [ + { + "condition": "(theme == 'classic')", + "value": "Black" + }, + { + "condition": "(theme != 'classic')", + "value": "{DynamicResource Theme_TextBrush}" + } + ] + } + }, + "gridBackground": { + "type": "generated", + "generator": "switch", + "datatype": "string", + "replaces": "$GridBackground$", + "parameters": { + "evaluator": "C++", + "cases": [ + { + "condition": "(theme == 'classic')", + "value": "White" + }, + { + "condition": "(theme != 'classic')", + "value": "{DynamicResource Theme_BackgroundBrush}" + } + ] + } + }, "operatingSystem": { "type": "bind", "binding": "env:OS" diff --git a/src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication.Browser/OpenSilverApplication.Browser.csproj b/src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication.Browser/OpenSilverApplication.Browser.csproj index f8c97ee..4aa7954 100644 --- a/src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication.Browser/OpenSilverApplication.Browser.csproj +++ b/src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication.Browser/OpenSilverApplication.Browser.csproj @@ -10,9 +10,9 @@ - - - + + + diff --git a/src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication.Simulator/OpenSilverApplication.Simulator.csproj b/src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication.Simulator/OpenSilverApplication.Simulator.csproj index 45c148c..826f049 100644 --- a/src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication.Simulator/OpenSilverApplication.Simulator.csproj +++ b/src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication.Simulator/OpenSilverApplication.Simulator.csproj @@ -6,7 +6,7 @@ - + diff --git a/src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication/MainPage.xaml b/src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication/MainPage.xaml index 7222d8b..c85f37e 100644 --- a/src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication/MainPage.xaml +++ b/src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication/MainPage.xaml @@ -4,9 +4,10 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:OpenSilverApplication" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - mc:Ignorable="d"> + mc:Ignorable="d" + Foreground="$PageForeground$"> - + diff --git a/src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication/OpenSilverApplication.csproj b/src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication/OpenSilverApplication.csproj index aa5431d..a9dac6f 100644 --- a/src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication/OpenSilverApplication.csproj +++ b/src/OpenSilver.CLI/C#/OpenSilverApplication/OpenSilverApplication/OpenSilverApplication.csproj @@ -7,9 +7,9 @@ - + - + diff --git a/src/OpenSilver.CLI/C#/OpenSilverBusinessApplication/.template.config/template.json b/src/OpenSilver.CLI/C#/OpenSilverBusinessApplication/.template.config/template.json index e8073a9..a3aa5b0 100644 --- a/src/OpenSilver.CLI/C#/OpenSilverBusinessApplication/.template.config/template.json +++ b/src/OpenSilver.CLI/C#/OpenSilverBusinessApplication/.template.config/template.json @@ -60,7 +60,7 @@ "openSilverPackageVersion": { "type": "generated", "generator": "constant", - "replaces": "OpenSilverPackageVersion", + "replaces": "$OpenSilverPackageVersion$", "parameters": { "value": "3.1.0" } @@ -68,7 +68,7 @@ "openSilverSimulatorPackageVersion": { "type": "generated", "generator": "constant", - "replaces": "OpenSilverSimulatorPackageVersion", + "replaces": "$OpenSilverSimulatorPackageVersion$", "parameters": { "value": "3.1.0" } @@ -76,7 +76,7 @@ "openSilverWebAssemblyPackageVersion": { "type": "generated", "generator": "constant", - "replaces": "OpenSilverWebAssemblyPackageVersion", + "replaces": "$OpenSilverWebAssemblyPackageVersion$", "parameters": { "value": "3.1.0" } @@ -84,7 +84,7 @@ "openSilverOpenRiaPackageVersion": { "type": "generated", "generator": "constant", - "replaces": "OpenSilverOpenRiaPackageVersion", + "replaces": "$OpenSilverOpenRiaPackageVersion$", "parameters": { "value": "3.1.0" } @@ -93,7 +93,7 @@ "type": "generated", "generator": "switch", "datatype": "string", - "replaces": "WebAssemblyPackageVersion", + "replaces": "$WebAssemblyPackageVersion$", "parameters": { "evaluator": "C++", "cases": [ diff --git a/src/OpenSilver.CLI/C#/OpenSilverBusinessApplication/OpenSilverBusinessApplication.Browser/OpenSilverBusinessApplication.Browser.csproj b/src/OpenSilver.CLI/C#/OpenSilverBusinessApplication/OpenSilverBusinessApplication.Browser/OpenSilverBusinessApplication.Browser.csproj index 8db4489..d6890b8 100644 --- a/src/OpenSilver.CLI/C#/OpenSilverBusinessApplication/OpenSilverBusinessApplication.Browser/OpenSilverBusinessApplication.Browser.csproj +++ b/src/OpenSilver.CLI/C#/OpenSilverBusinessApplication/OpenSilverBusinessApplication.Browser/OpenSilverBusinessApplication.Browser.csproj @@ -10,9 +10,9 @@ - - - + + + diff --git a/src/OpenSilver.CLI/C#/OpenSilverBusinessApplication/OpenSilverBusinessApplication.Simulator/OpenSilverBusinessApplication.Simulator.csproj b/src/OpenSilver.CLI/C#/OpenSilverBusinessApplication/OpenSilverBusinessApplication.Simulator/OpenSilverBusinessApplication.Simulator.csproj index 90dc99e..088cfb7 100644 --- a/src/OpenSilver.CLI/C#/OpenSilverBusinessApplication/OpenSilverBusinessApplication.Simulator/OpenSilverBusinessApplication.Simulator.csproj +++ b/src/OpenSilver.CLI/C#/OpenSilverBusinessApplication/OpenSilverBusinessApplication.Simulator/OpenSilverBusinessApplication.Simulator.csproj @@ -6,7 +6,7 @@ - + diff --git a/src/OpenSilver.CLI/C#/OpenSilverBusinessApplication/OpenSilverBusinessApplication/OpenSilverBusinessApplication.csproj b/src/OpenSilver.CLI/C#/OpenSilverBusinessApplication/OpenSilverBusinessApplication/OpenSilverBusinessApplication.csproj index f5bbc04..fa86171 100644 --- a/src/OpenSilver.CLI/C#/OpenSilverBusinessApplication/OpenSilverBusinessApplication/OpenSilverBusinessApplication.csproj +++ b/src/OpenSilver.CLI/C#/OpenSilverBusinessApplication/OpenSilverBusinessApplication/OpenSilverBusinessApplication.csproj @@ -8,14 +8,14 @@ - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/src/OpenSilver.CLI/C#/OpenSilverClassLibrary/.template.config/template.json b/src/OpenSilver.CLI/C#/OpenSilverClassLibrary/.template.config/template.json index edba567..254a2a4 100644 --- a/src/OpenSilver.CLI/C#/OpenSilverClassLibrary/.template.config/template.json +++ b/src/OpenSilver.CLI/C#/OpenSilverClassLibrary/.template.config/template.json @@ -33,7 +33,7 @@ "openSilverPackageVersion": { "type": "generated", "generator": "constant", - "replaces": "OpenSilverPackageVersion", + "replaces": "$OpenSilverPackageVersion$", "parameters": { "value": "3.1.0" } diff --git a/src/OpenSilver.CLI/C#/OpenSilverClassLibrary/OpenSilverClassLibrary.csproj b/src/OpenSilver.CLI/C#/OpenSilverClassLibrary/OpenSilverClassLibrary.csproj index a802b21..7e0c9d3 100644 --- a/src/OpenSilver.CLI/C#/OpenSilverClassLibrary/OpenSilverClassLibrary.csproj +++ b/src/OpenSilver.CLI/C#/OpenSilverClassLibrary/OpenSilverClassLibrary.csproj @@ -7,7 +7,7 @@ - + diff --git a/src/OpenSilver.CLI/F#/OpenSilverApplication/.template.config/template.json b/src/OpenSilver.CLI/F#/OpenSilverApplication/.template.config/template.json index 97e010b..dc4a50a 100644 --- a/src/OpenSilver.CLI/F#/OpenSilverApplication/.template.config/template.json +++ b/src/OpenSilver.CLI/F#/OpenSilverApplication/.template.config/template.json @@ -94,7 +94,7 @@ "openSilverPackageVersion": { "type": "generated", "generator": "constant", - "replaces": "OpenSilverPackageVersion", + "replaces": "$OpenSilverPackageVersion$", "parameters": { "value": "3.1.0" } @@ -102,7 +102,7 @@ "openSilverSimulatorPackageVersion": { "type": "generated", "generator": "constant", - "replaces": "OpenSilverSimulatorPackageVersion", + "replaces": "$OpenSilverSimulatorPackageVersion$", "parameters": { "value": "3.1.0" } @@ -110,7 +110,7 @@ "openSilverWebAssemblyPackageVersion": { "type": "generated", "generator": "constant", - "replaces": "OpenSilverWebAssemblyPackageVersion", + "replaces": "$OpenSilverWebAssemblyPackageVersion$", "parameters": { "value": "3.1.0" } @@ -118,7 +118,7 @@ "modernThemePackageVersion": { "type": "generated", "generator": "constant", - "replaces": "ModernThemePackageVersion", + "replaces": "$ModernThemePackageVersion$", "parameters": { "value": "3.1.*" } @@ -127,7 +127,7 @@ "type": "generated", "generator": "switch", "datatype": "string", - "replaces": "WebAssemblyPackageVersion", + "replaces": "$WebAssemblyPackageVersion$", "parameters": { "evaluator": "C++", "cases": [ @@ -146,6 +146,44 @@ ] } }, + "pageForeground": { + "type": "generated", + "generator": "switch", + "datatype": "string", + "replaces": "$PageForeground$", + "parameters": { + "evaluator": "C++", + "cases": [ + { + "condition": "(theme == 'classic')", + "value": "Black" + }, + { + "condition": "(theme != 'classic')", + "value": "{DynamicResource Theme_TextBrush}" + } + ] + } + }, + "gridBackground": { + "type": "generated", + "generator": "switch", + "datatype": "string", + "replaces": "$GridBackground$", + "parameters": { + "evaluator": "C++", + "cases": [ + { + "condition": "(theme == 'classic')", + "value": "White" + }, + { + "condition": "(theme != 'classic')", + "value": "{DynamicResource Theme_BackgroundBrush}" + } + ] + } + }, "operatingSystem": { "type": "bind", "binding": "env:OS" diff --git a/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication.Browser/OpenSilverApplication.Browser.csproj b/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication.Browser/OpenSilverApplication.Browser.csproj index 2d34628..a91222c 100644 --- a/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication.Browser/OpenSilverApplication.Browser.csproj +++ b/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication.Browser/OpenSilverApplication.Browser.csproj @@ -10,9 +10,9 @@ - - - + + + diff --git a/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication.Simulator/OpenSilverApplication.Simulator.csproj b/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication.Simulator/OpenSilverApplication.Simulator.csproj index 3f43b84..2234dd3 100644 --- a/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication.Simulator/OpenSilverApplication.Simulator.csproj +++ b/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication.Simulator/OpenSilverApplication.Simulator.csproj @@ -6,7 +6,7 @@ - + diff --git a/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication/MainPage.xaml b/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication/MainPage.xaml index 7222d8b..c85f37e 100644 --- a/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication/MainPage.xaml +++ b/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication/MainPage.xaml @@ -4,9 +4,10 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:OpenSilverApplication" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - mc:Ignorable="d"> + mc:Ignorable="d" + Foreground="$PageForeground$"> - + diff --git a/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication/OpenSilverApplication.fsproj b/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication/OpenSilverApplication.fsproj index 5c8ce4d..90c319d 100644 --- a/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication/OpenSilverApplication.fsproj +++ b/src/OpenSilver.CLI/F#/OpenSilverApplication/OpenSilverApplication/OpenSilverApplication.fsproj @@ -7,9 +7,9 @@ - + - + diff --git a/src/OpenSilver.CLI/F#/OpenSilverClassLibrary/.template.config/template.json b/src/OpenSilver.CLI/F#/OpenSilverClassLibrary/.template.config/template.json index 2be96af..b2e6b1b 100644 --- a/src/OpenSilver.CLI/F#/OpenSilverClassLibrary/.template.config/template.json +++ b/src/OpenSilver.CLI/F#/OpenSilverClassLibrary/.template.config/template.json @@ -33,7 +33,7 @@ "openSilverPackageVersion": { "type": "generated", "generator": "constant", - "replaces": "OpenSilverPackageVersion", + "replaces": "$OpenSilverPackageVersion$", "parameters": { "value": "3.1.0" } diff --git a/src/OpenSilver.CLI/F#/OpenSilverClassLibrary/OpenSilverClassLibrary.fsproj b/src/OpenSilver.CLI/F#/OpenSilverClassLibrary/OpenSilverClassLibrary.fsproj index af01c90..4a41351 100644 --- a/src/OpenSilver.CLI/F#/OpenSilverClassLibrary/OpenSilverClassLibrary.fsproj +++ b/src/OpenSilver.CLI/F#/OpenSilverClassLibrary/OpenSilverClassLibrary.fsproj @@ -7,7 +7,7 @@ - + diff --git a/src/OpenSilver.CLI/VB/OpenSilverApplication/.template.config/template.json b/src/OpenSilver.CLI/VB/OpenSilverApplication/.template.config/template.json index 231830e..184615b 100644 --- a/src/OpenSilver.CLI/VB/OpenSilverApplication/.template.config/template.json +++ b/src/OpenSilver.CLI/VB/OpenSilverApplication/.template.config/template.json @@ -94,7 +94,7 @@ "openSilverPackageVersion": { "type": "generated", "generator": "constant", - "replaces": "OpenSilverPackageVersion", + "replaces": "$OpenSilverPackageVersion$", "parameters": { "value": "3.1.0" } @@ -102,7 +102,7 @@ "openSilverSimulatorPackageVersion": { "type": "generated", "generator": "constant", - "replaces": "OpenSilverSimulatorPackageVersion", + "replaces": "$OpenSilverSimulatorPackageVersion$", "parameters": { "value": "3.1.0" } @@ -110,7 +110,7 @@ "openSilverWebAssemblyPackageVersion": { "type": "generated", "generator": "constant", - "replaces": "OpenSilverWebAssemblyPackageVersion", + "replaces": "$OpenSilverWebAssemblyPackageVersion$", "parameters": { "value": "3.1.0" } @@ -118,7 +118,7 @@ "modernThemePackageVersion": { "type": "generated", "generator": "constant", - "replaces": "ModernThemePackageVersion", + "replaces": "$ModernThemePackageVersion$", "parameters": { "value": "3.1.*" } @@ -127,7 +127,7 @@ "type": "generated", "generator": "switch", "datatype": "string", - "replaces": "WebAssemblyPackageVersion", + "replaces": "$WebAssemblyPackageVersion$", "parameters": { "evaluator": "C++", "cases": [ @@ -146,6 +146,44 @@ ] } }, + "pageForeground": { + "type": "generated", + "generator": "switch", + "datatype": "string", + "replaces": "$PageForeground$", + "parameters": { + "evaluator": "C++", + "cases": [ + { + "condition": "(theme == 'classic')", + "value": "Black" + }, + { + "condition": "(theme != 'classic')", + "value": "{DynamicResource Theme_TextBrush}" + } + ] + } + }, + "gridBackground": { + "type": "generated", + "generator": "switch", + "datatype": "string", + "replaces": "$GridBackground$", + "parameters": { + "evaluator": "C++", + "cases": [ + { + "condition": "(theme == 'classic')", + "value": "White" + }, + { + "condition": "(theme != 'classic')", + "value": "{DynamicResource Theme_BackgroundBrush}" + } + ] + } + }, "operatingSystem": { "type": "bind", "binding": "env:OS" diff --git a/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication.Browser/OpenSilverApplication.Browser.csproj b/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication.Browser/OpenSilverApplication.Browser.csproj index 96b911b..f310836 100644 --- a/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication.Browser/OpenSilverApplication.Browser.csproj +++ b/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication.Browser/OpenSilverApplication.Browser.csproj @@ -10,9 +10,9 @@ - - - + + + diff --git a/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication.Simulator/OpenSilverApplication.Simulator.csproj b/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication.Simulator/OpenSilverApplication.Simulator.csproj index 28ac880..1b58f46 100644 --- a/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication.Simulator/OpenSilverApplication.Simulator.csproj +++ b/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication.Simulator/OpenSilverApplication.Simulator.csproj @@ -6,7 +6,7 @@ - + diff --git a/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication/MainPage.xaml b/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication/MainPage.xaml index 7222d8b..c85f37e 100644 --- a/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication/MainPage.xaml +++ b/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication/MainPage.xaml @@ -4,9 +4,10 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:OpenSilverApplication" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - mc:Ignorable="d"> + mc:Ignorable="d" + Foreground="$PageForeground$"> - + diff --git a/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication/OpenSilverApplication.vbproj b/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication/OpenSilverApplication.vbproj index 88414a9..a0e2932 100644 --- a/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication/OpenSilverApplication.vbproj +++ b/src/OpenSilver.CLI/VB/OpenSilverApplication/OpenSilverApplication/OpenSilverApplication.vbproj @@ -7,9 +7,9 @@ - + - + diff --git a/src/OpenSilver.CLI/VB/OpenSilverBusinessApplication/.template.config/template.json b/src/OpenSilver.CLI/VB/OpenSilverBusinessApplication/.template.config/template.json index 4a2e0da..d49d1aa 100644 --- a/src/OpenSilver.CLI/VB/OpenSilverBusinessApplication/.template.config/template.json +++ b/src/OpenSilver.CLI/VB/OpenSilverBusinessApplication/.template.config/template.json @@ -60,7 +60,7 @@ "openSilverPackageVersion": { "type": "generated", "generator": "constant", - "replaces": "OpenSilverPackageVersion", + "replaces": "$OpenSilverPackageVersion$", "parameters": { "value": "3.1.0" } @@ -68,7 +68,7 @@ "openSilverSimulatorPackageVersion": { "type": "generated", "generator": "constant", - "replaces": "OpenSilverSimulatorPackageVersion", + "replaces": "$OpenSilverSimulatorPackageVersion$", "parameters": { "value": "3.1.0" } @@ -76,7 +76,7 @@ "openSilverWebAssemblyPackageVersion": { "type": "generated", "generator": "constant", - "replaces": "OpenSilverWebAssemblyPackageVersion", + "replaces": "$OpenSilverWebAssemblyPackageVersion$", "parameters": { "value": "3.1.0" } @@ -84,7 +84,7 @@ "openSilverOpenRiaPackageVersion": { "type": "generated", "generator": "constant", - "replaces": "OpenSilverOpenRiaPackageVersion", + "replaces": "$OpenSilverOpenRiaPackageVersion$", "parameters": { "value": "3.1.0" } @@ -93,7 +93,7 @@ "type": "generated", "generator": "switch", "datatype": "string", - "replaces": "WebAssemblyPackageVersion", + "replaces": "$WebAssemblyPackageVersion$", "parameters": { "evaluator": "C++", "cases": [ diff --git a/src/OpenSilver.CLI/VB/OpenSilverBusinessApplication/OpenSilverBusinessApplication.Browser/OpenSilverBusinessApplication.Browser.csproj b/src/OpenSilver.CLI/VB/OpenSilverBusinessApplication/OpenSilverBusinessApplication.Browser/OpenSilverBusinessApplication.Browser.csproj index 2211bc5..7375e26 100644 --- a/src/OpenSilver.CLI/VB/OpenSilverBusinessApplication/OpenSilverBusinessApplication.Browser/OpenSilverBusinessApplication.Browser.csproj +++ b/src/OpenSilver.CLI/VB/OpenSilverBusinessApplication/OpenSilverBusinessApplication.Browser/OpenSilverBusinessApplication.Browser.csproj @@ -10,9 +10,9 @@ - - - + + + diff --git a/src/OpenSilver.CLI/VB/OpenSilverBusinessApplication/OpenSilverBusinessApplication.Simulator/OpenSilverBusinessApplication.Simulator.csproj b/src/OpenSilver.CLI/VB/OpenSilverBusinessApplication/OpenSilverBusinessApplication.Simulator/OpenSilverBusinessApplication.Simulator.csproj index 11e39c5..abaf994 100644 --- a/src/OpenSilver.CLI/VB/OpenSilverBusinessApplication/OpenSilverBusinessApplication.Simulator/OpenSilverBusinessApplication.Simulator.csproj +++ b/src/OpenSilver.CLI/VB/OpenSilverBusinessApplication/OpenSilverBusinessApplication.Simulator/OpenSilverBusinessApplication.Simulator.csproj @@ -6,7 +6,7 @@ - + diff --git a/src/OpenSilver.CLI/VB/OpenSilverBusinessApplication/OpenSilverBusinessApplication/OpenSilverBusinessApplication.vbproj b/src/OpenSilver.CLI/VB/OpenSilverBusinessApplication/OpenSilverBusinessApplication/OpenSilverBusinessApplication.vbproj index 3754667..f63e01e 100644 --- a/src/OpenSilver.CLI/VB/OpenSilverBusinessApplication/OpenSilverBusinessApplication/OpenSilverBusinessApplication.vbproj +++ b/src/OpenSilver.CLI/VB/OpenSilverBusinessApplication/OpenSilverBusinessApplication/OpenSilverBusinessApplication.vbproj @@ -8,14 +8,14 @@ - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/src/OpenSilver.CLI/VB/OpenSilverClassLibrary/.template.config/template.json b/src/OpenSilver.CLI/VB/OpenSilverClassLibrary/.template.config/template.json index 30e7179..cfcc2cf 100644 --- a/src/OpenSilver.CLI/VB/OpenSilverClassLibrary/.template.config/template.json +++ b/src/OpenSilver.CLI/VB/OpenSilverClassLibrary/.template.config/template.json @@ -33,7 +33,7 @@ "openSilverPackageVersion": { "type": "generated", "generator": "constant", - "replaces": "OpenSilverPackageVersion", + "replaces": "$OpenSilverPackageVersion$", "parameters": { "value": "3.1.0" } diff --git a/src/OpenSilver.CLI/VB/OpenSilverClassLibrary/OpenSilverClassLibrary.vbproj b/src/OpenSilver.CLI/VB/OpenSilverClassLibrary/OpenSilverClassLibrary.vbproj index 62e079b..89057a7 100644 --- a/src/OpenSilver.CLI/VB/OpenSilverClassLibrary/OpenSilverClassLibrary.vbproj +++ b/src/OpenSilver.CLI/VB/OpenSilverClassLibrary/OpenSilverClassLibrary.vbproj @@ -7,7 +7,7 @@ - + From 37b41589c8f81d5b06d14297e02eb2aaada6b4f0 Mon Sep 17 00:00:00 2001 From: Iakov Lilo Date: Tue, 10 Dec 2024 17:16:51 +1100 Subject: [PATCH 10/17] Update version of Xaml Designer --- .../OpenSilver.XamlDesigner.csproj | 16 ++++++++-------- src/OpenSilver.XamlDesigner/packages.config | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/OpenSilver.XamlDesigner/OpenSilver.XamlDesigner.csproj b/src/OpenSilver.XamlDesigner/OpenSilver.XamlDesigner.csproj index a4b707a..61bece4 100644 --- a/src/OpenSilver.XamlDesigner/OpenSilver.XamlDesigner.csproj +++ b/src/OpenSilver.XamlDesigner/OpenSilver.XamlDesigner.csproj @@ -235,22 +235,22 @@ - ..\packages\XamlDesigner.OpenSilver.2.0.0-preview-2024-11-29-035515-8f5b583f\lib\net47\Userware.XamlDesigner.Api.BL.Models.OpenSilver.dll + ..\packages\XamlDesigner.OpenSilver.2.0.0-preview-2024-12-10-034909-9ed5258f\lib\net47\Userware.XamlDesigner.Api.BL.Models.OpenSilver.dll - ..\packages\XamlDesigner.OpenSilver.2.0.0-preview-2024-11-29-035515-8f5b583f\lib\net47\Userware.XamlDesigner.Api.Client.OpenSilver.dll + ..\packages\XamlDesigner.OpenSilver.2.0.0-preview-2024-12-10-034909-9ed5258f\lib\net47\Userware.XamlDesigner.Api.Client.OpenSilver.dll - ..\packages\XamlDesigner.OpenSilver.2.0.0-preview-2024-11-29-035515-8f5b583f\lib\net47\Userware.XamlDesigner.Communication.OpenSilver.dll + ..\packages\XamlDesigner.OpenSilver.2.0.0-preview-2024-12-10-034909-9ed5258f\lib\net47\Userware.XamlDesigner.Communication.OpenSilver.dll - ..\packages\XamlDesigner.OpenSilver.2.0.0-preview-2024-11-29-035515-8f5b583f\lib\net47\Userware.XamlDesigner.Data.Primitives.OpenSilver.dll + ..\packages\XamlDesigner.OpenSilver.2.0.0-preview-2024-12-10-034909-9ed5258f\lib\net47\Userware.XamlDesigner.Data.Primitives.OpenSilver.dll - ..\packages\XamlDesigner.OpenSilver.2.0.0-preview-2024-11-29-035515-8f5b583f\lib\net47\Userware.XamlDesigner.OpenSilver.dll + ..\packages\XamlDesigner.OpenSilver.2.0.0-preview-2024-12-10-034909-9ed5258f\lib\net47\Userware.XamlDesigner.OpenSilver.dll - ..\packages\XamlDesigner.OpenSilver.2.0.0-preview-2024-11-29-035515-8f5b583f\lib\net47\Userware.XamlDesigner.SplitXamlEditor.OpenSilver.dll + ..\packages\XamlDesigner.OpenSilver.2.0.0-preview-2024-12-10-034909-9ed5258f\lib\net47\Userware.XamlDesigner.SplitXamlEditor.OpenSilver.dll @@ -296,11 +296,11 @@ - + - + \ No newline at end of file diff --git a/src/OpenSilver.XamlDesigner/packages.config b/src/OpenSilver.XamlDesigner/packages.config index d06848a..41469a6 100644 --- a/src/OpenSilver.XamlDesigner/packages.config +++ b/src/OpenSilver.XamlDesigner/packages.config @@ -63,5 +63,5 @@ - + \ No newline at end of file From 46467c50dfae3b41af5b43aa7bf0178034523134 Mon Sep 17 00:00:00 2001 From: Oussama Babaghayou <35387603+ousspero@users.noreply.github.com> Date: Tue, 10 Dec 2024 07:29:25 +0100 Subject: [PATCH 11/17] Enhance the "New Project Dialog" style, more space and shadow (#16) Adjust the new dialog style, more space and shadow effect --- .../AppCustomizationWindow/AppConfigurationWindow.xaml | 2 +- .../AppCustomizationWindow/ThemeCollectionView.xaml | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/OpenSilver.TemplateWizards/AppCustomizationWindow/AppConfigurationWindow.xaml b/src/OpenSilver.TemplateWizards/AppCustomizationWindow/AppConfigurationWindow.xaml index 4e36534..a8ef8d5 100644 --- a/src/OpenSilver.TemplateWizards/AppCustomizationWindow/AppConfigurationWindow.xaml +++ b/src/OpenSilver.TemplateWizards/AppCustomizationWindow/AppConfigurationWindow.xaml @@ -28,7 +28,7 @@ - + diff --git a/src/OpenSilver.TemplateWizards/AppCustomizationWindow/ThemeCollectionView.xaml b/src/OpenSilver.TemplateWizards/AppCustomizationWindow/ThemeCollectionView.xaml index 1730f68..38daad8 100644 --- a/src/OpenSilver.TemplateWizards/AppCustomizationWindow/ThemeCollectionView.xaml +++ b/src/OpenSilver.TemplateWizards/AppCustomizationWindow/ThemeCollectionView.xaml @@ -94,11 +94,16 @@ - + + + + + Date: Tue, 10 Dec 2024 07:46:26 +0100 Subject: [PATCH 12/17] Deactivate Modern Theme for Business Applications (#17) Deactivate Modern Theme for Business Applications --- .../AppConfigurationWindow.xaml | 2 +- .../AppConfigurationWindow.xaml.cs | 14 ++++++++++++-- .../AppCustomizationWizard.cs | 3 ++- .../root.vstemplate | 1 + .../root.vstemplate | 1 + 5 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/OpenSilver.TemplateWizards/AppCustomizationWindow/AppConfigurationWindow.xaml b/src/OpenSilver.TemplateWizards/AppCustomizationWindow/AppConfigurationWindow.xaml index a8ef8d5..5af4c33 100644 --- a/src/OpenSilver.TemplateWizards/AppCustomizationWindow/AppConfigurationWindow.xaml +++ b/src/OpenSilver.TemplateWizards/AppCustomizationWindow/AppConfigurationWindow.xaml @@ -22,7 +22,7 @@ - + diff --git a/src/OpenSilver.TemplateWizards/AppCustomizationWindow/AppConfigurationWindow.xaml.cs b/src/OpenSilver.TemplateWizards/AppCustomizationWindow/AppConfigurationWindow.xaml.cs index 279a4f4..12f3534 100644 --- a/src/OpenSilver.TemplateWizards/AppCustomizationWindow/AppConfigurationWindow.xaml.cs +++ b/src/OpenSilver.TemplateWizards/AppCustomizationWindow/AppConfigurationWindow.xaml.cs @@ -40,14 +40,24 @@ public DotNetVersion DotNetVersion } - public AppConfigurationWindow(string openSilverType) + public AppConfigurationWindow(string openSilverType, bool isBusiness = false) { + InitilizeThemes(); InitializeComponent(); if (openSilverType == "Library") { DotNetVersionPanel.Visibility = Visibility.Collapsed; } + + //Modern theme is deactivated for now, for Business Application projects + if (isBusiness) + { + chooseThemesCollection.Visibility = Visibility.Collapsed; + SelectedTheme = Themes[ThemeSelectionEnum.Classic]; + continueBtn.IsEnabled = true; + this.Height = 300; + } } private void InitilizeThemes() @@ -82,7 +92,7 @@ private void OnThemSelected(object sender, RoutedEventArgs e) private void ThemeCollectionView_SelectionChanged(object sender, EventArgs e) { - SelectedTheme= (sender as ThemeOptions).Name; + SelectedTheme = (sender as ThemeOptions).Name; continueBtn.IsEnabled = true; } } diff --git a/src/OpenSilver.TemplateWizards/AppCustomizationWizard.cs b/src/OpenSilver.TemplateWizards/AppCustomizationWizard.cs index b67e423..fc45a30 100644 --- a/src/OpenSilver.TemplateWizards/AppCustomizationWizard.cs +++ b/src/OpenSilver.TemplateWizards/AppCustomizationWizard.cs @@ -143,9 +143,10 @@ public void RunStarted(object automationObject, Dictionary repla XNamespace defaultNamespace = openSilverInfo.GetDefaultNamespace(); string openSilverType = openSilverInfo.Element(defaultNamespace + "Type").Value; + bool isBusiness = openSilverInfo.Element(defaultNamespace + "IsBusiness")?.Value.Equals("true", StringComparison.OrdinalIgnoreCase) ?? false; - AppConfigurationWindow window = new AppConfigurationWindow(openSilverType); + AppConfigurationWindow window = new AppConfigurationWindow(openSilverType, isBusiness); // In the case of a class Library, the user has no other choices to make so we do not show the app configuration window. if (openSilverType != "Library") diff --git a/src/OpenSilverBusinessApplicationTemplate/root.vstemplate b/src/OpenSilverBusinessApplicationTemplate/root.vstemplate index 2c8f019..dbfe386 100644 --- a/src/OpenSilverBusinessApplicationTemplate/root.vstemplate +++ b/src/OpenSilverBusinessApplicationTemplate/root.vstemplate @@ -32,6 +32,7 @@ Silverlight Application cs + true \ No newline at end of file diff --git a/src/OpenSilverBusinessVBApplicationTemplate/root.vstemplate b/src/OpenSilverBusinessVBApplicationTemplate/root.vstemplate index 834f5d0..c29e661 100644 --- a/src/OpenSilverBusinessVBApplicationTemplate/root.vstemplate +++ b/src/OpenSilverBusinessVBApplicationTemplate/root.vstemplate @@ -32,6 +32,7 @@ Silverlight Application vb + true \ No newline at end of file From d6edd8b4900482e4c1fe55a153d5049157cd32d6 Mon Sep 17 00:00:00 2001 From: Iakov Lilo Date: Tue, 10 Dec 2024 18:52:44 +1100 Subject: [PATCH 13/17] Add reference to palette colors for consistent styling --- src/OpenSilver.TemplateWizards/AppCustomizationWizard.cs | 2 ++ .../OpenSilverApplication/MainPage.xaml | 5 +++-- .../OpenSilverFSApplication/MainPage.xaml | 5 +++-- .../OpenSilverVBApplication/MainPage.xaml | 5 +++-- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/OpenSilver.TemplateWizards/AppCustomizationWizard.cs b/src/OpenSilver.TemplateWizards/AppCustomizationWizard.cs index fc45a30..7f9e5c1 100644 --- a/src/OpenSilver.TemplateWizards/AppCustomizationWizard.cs +++ b/src/OpenSilver.TemplateWizards/AppCustomizationWizard.cs @@ -184,6 +184,8 @@ public void RunStarted(object automationObject, Dictionary repla replacementsDictionary.Add("$opensilverwebassemblypackageversion$", "3.1.0"); replacementsDictionary.Add("$openria46packageversion$", "3.1.0"); replacementsDictionary.Add("$opensilverthememodern$", "3.1.*"); + replacementsDictionary.Add("$pageforeground$", window.SelectedTheme == "Classic" ? "Black" : "{DynamicResource Theme_TextBrush}"); + replacementsDictionary.Add("$gridbackground$", window.SelectedTheme == "Classic" ? "White" : "{DynamicResource Theme_BackgroundBrush}"); _replacementsDictionary = replacementsDictionary; _selectedTheme = window.SelectedTheme; diff --git a/src/OpenSilverApplicationTemplate/OpenSilverApplication/MainPage.xaml b/src/OpenSilverApplicationTemplate/OpenSilverApplication/MainPage.xaml index 0c16c99..2fdcd6e 100644 --- a/src/OpenSilverApplicationTemplate/OpenSilverApplication/MainPage.xaml +++ b/src/OpenSilverApplicationTemplate/OpenSilverApplication/MainPage.xaml @@ -4,9 +4,10 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:$ext_safeprojectname$" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - mc:Ignorable="d"> + mc:Ignorable="d" + Foreground="$ext_pageforeground$"> - + diff --git a/src/OpenSilverFSApplicationTemplate/OpenSilverFSApplication/MainPage.xaml b/src/OpenSilverFSApplicationTemplate/OpenSilverFSApplication/MainPage.xaml index 0c16c99..2fdcd6e 100644 --- a/src/OpenSilverFSApplicationTemplate/OpenSilverFSApplication/MainPage.xaml +++ b/src/OpenSilverFSApplicationTemplate/OpenSilverFSApplication/MainPage.xaml @@ -4,9 +4,10 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:$ext_safeprojectname$" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - mc:Ignorable="d"> + mc:Ignorable="d" + Foreground="$ext_pageforeground$"> - + diff --git a/src/OpenSilverVBApplicationTemplate/OpenSilverVBApplication/MainPage.xaml b/src/OpenSilverVBApplicationTemplate/OpenSilverVBApplication/MainPage.xaml index 0c16c99..2fdcd6e 100644 --- a/src/OpenSilverVBApplicationTemplate/OpenSilverVBApplication/MainPage.xaml +++ b/src/OpenSilverVBApplicationTemplate/OpenSilverVBApplication/MainPage.xaml @@ -4,9 +4,10 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:$ext_safeprojectname$" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - mc:Ignorable="d"> + mc:Ignorable="d" + Foreground="$ext_pageforeground$"> - + From e0cff6a806137612c88686c273a656fa3fd5b3a0 Mon Sep 17 00:00:00 2001 From: Iakov Lilo Date: Tue, 10 Dec 2024 19:31:09 +1100 Subject: [PATCH 14/17] Adjust theme code generation --- .../AppCustomizationWizard.cs | 21 ++++++++----------- .../OpenSilverApplication/App.xaml | 1 + .../OpenSilverFSApplication/App.xaml | 1 + .../OpenSilverVBApplication/App.xaml | 1 + 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/OpenSilver.TemplateWizards/AppCustomizationWizard.cs b/src/OpenSilver.TemplateWizards/AppCustomizationWizard.cs index 7f9e5c1..a900984 100644 --- a/src/OpenSilver.TemplateWizards/AppCustomizationWizard.cs +++ b/src/OpenSilver.TemplateWizards/AppCustomizationWizard.cs @@ -77,13 +77,10 @@ public void ProjectFinishedGenerating(Project project) string projectName = _replacementsDictionary["$safeprojectname$"]; string language = GetCurrentProgrammingLanguage(); - string appXamlPath = GetFileFullPath("App.xaml"); - string OpenSilverCsprojPath = GetFileFullPath($"{projectName}.{language}proj"); - if (File.Exists(appXamlPath) && File.Exists(OpenSilverCsprojPath)) + if (File.Exists(OpenSilverCsprojPath)) { - AddThemePalette(appXamlPath); AddThemeReferences(OpenSilverCsprojPath); } } @@ -95,15 +92,14 @@ private string GetCurrentProgrammingLanguage() return openSilverInfo.Element(defaultNamespace + "LanguageCode").Value; } - private void AddThemePalette(string appXamlPath) + private string GetAppXamlTheme(string selectedTheme) { - var appXamlContent = File.ReadAllText(appXamlPath); - appXamlContent = appXamlContent.Replace( - "", - $"\n\n\n" - ); - XDocument xdoc = XDocument.Parse(appXamlContent); - xdoc.Save(appXamlPath, SaveOptions.None); + if (selectedTheme == "Classic") + { + return ""; + } + + return $" {Environment.NewLine} {Environment.NewLine} "; } private void AddThemeReferences(string path) @@ -186,6 +182,7 @@ public void RunStarted(object automationObject, Dictionary repla replacementsDictionary.Add("$opensilverthememodern$", "3.1.*"); replacementsDictionary.Add("$pageforeground$", window.SelectedTheme == "Classic" ? "Black" : "{DynamicResource Theme_TextBrush}"); replacementsDictionary.Add("$gridbackground$", window.SelectedTheme == "Classic" ? "White" : "{DynamicResource Theme_BackgroundBrush}"); + replacementsDictionary.Add("$appxamltheme$", GetAppXamlTheme(window.SelectedTheme)); _replacementsDictionary = replacementsDictionary; _selectedTheme = window.SelectedTheme; diff --git a/src/OpenSilverApplicationTemplate/OpenSilverApplication/App.xaml b/src/OpenSilverApplicationTemplate/OpenSilverApplication/App.xaml index 799c875..30d0938 100644 --- a/src/OpenSilverApplicationTemplate/OpenSilverApplication/App.xaml +++ b/src/OpenSilverApplicationTemplate/OpenSilverApplication/App.xaml @@ -8,4 +8,5 @@ +$ext_appxamltheme$ diff --git a/src/OpenSilverFSApplicationTemplate/OpenSilverFSApplication/App.xaml b/src/OpenSilverFSApplicationTemplate/OpenSilverFSApplication/App.xaml index b9ec891..7266969 100644 --- a/src/OpenSilverFSApplicationTemplate/OpenSilverFSApplication/App.xaml +++ b/src/OpenSilverFSApplicationTemplate/OpenSilverFSApplication/App.xaml @@ -8,4 +8,5 @@ +$ext_appxamltheme$ diff --git a/src/OpenSilverVBApplicationTemplate/OpenSilverVBApplication/App.xaml b/src/OpenSilverVBApplicationTemplate/OpenSilverVBApplication/App.xaml index b9ec891..7266969 100644 --- a/src/OpenSilverVBApplicationTemplate/OpenSilverVBApplication/App.xaml +++ b/src/OpenSilverVBApplicationTemplate/OpenSilverVBApplication/App.xaml @@ -8,4 +8,5 @@ +$ext_appxamltheme$ From a455d79ff05495770f91670cf248b6bd9057ab7a Mon Sep 17 00:00:00 2001 From: Iakov Lilo Date: Tue, 10 Dec 2024 20:31:55 +1100 Subject: [PATCH 15/17] Update Xaml Designer --- .../OpenSilver.XamlDesigner.csproj | 16 ++++++++-------- src/OpenSilver.XamlDesigner/packages.config | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/OpenSilver.XamlDesigner/OpenSilver.XamlDesigner.csproj b/src/OpenSilver.XamlDesigner/OpenSilver.XamlDesigner.csproj index 61bece4..03288ad 100644 --- a/src/OpenSilver.XamlDesigner/OpenSilver.XamlDesigner.csproj +++ b/src/OpenSilver.XamlDesigner/OpenSilver.XamlDesigner.csproj @@ -235,22 +235,22 @@ - ..\packages\XamlDesigner.OpenSilver.2.0.0-preview-2024-12-10-034909-9ed5258f\lib\net47\Userware.XamlDesigner.Api.BL.Models.OpenSilver.dll + ..\packages\XamlDesigner.OpenSilver.2.0.0-preview-2024-12-10-092348-bf8d19d8\lib\net47\Userware.XamlDesigner.Api.BL.Models.OpenSilver.dll - ..\packages\XamlDesigner.OpenSilver.2.0.0-preview-2024-12-10-034909-9ed5258f\lib\net47\Userware.XamlDesigner.Api.Client.OpenSilver.dll + ..\packages\XamlDesigner.OpenSilver.2.0.0-preview-2024-12-10-092348-bf8d19d8\lib\net47\Userware.XamlDesigner.Api.Client.OpenSilver.dll - ..\packages\XamlDesigner.OpenSilver.2.0.0-preview-2024-12-10-034909-9ed5258f\lib\net47\Userware.XamlDesigner.Communication.OpenSilver.dll + ..\packages\XamlDesigner.OpenSilver.2.0.0-preview-2024-12-10-092348-bf8d19d8\lib\net47\Userware.XamlDesigner.Communication.OpenSilver.dll - ..\packages\XamlDesigner.OpenSilver.2.0.0-preview-2024-12-10-034909-9ed5258f\lib\net47\Userware.XamlDesigner.Data.Primitives.OpenSilver.dll + ..\packages\XamlDesigner.OpenSilver.2.0.0-preview-2024-12-10-092348-bf8d19d8\lib\net47\Userware.XamlDesigner.Data.Primitives.OpenSilver.dll - ..\packages\XamlDesigner.OpenSilver.2.0.0-preview-2024-12-10-034909-9ed5258f\lib\net47\Userware.XamlDesigner.OpenSilver.dll + ..\packages\XamlDesigner.OpenSilver.2.0.0-preview-2024-12-10-092348-bf8d19d8\lib\net47\Userware.XamlDesigner.OpenSilver.dll - ..\packages\XamlDesigner.OpenSilver.2.0.0-preview-2024-12-10-034909-9ed5258f\lib\net47\Userware.XamlDesigner.SplitXamlEditor.OpenSilver.dll + ..\packages\XamlDesigner.OpenSilver.2.0.0-preview-2024-12-10-092348-bf8d19d8\lib\net47\Userware.XamlDesigner.SplitXamlEditor.OpenSilver.dll @@ -296,11 +296,11 @@ - + - + \ No newline at end of file diff --git a/src/OpenSilver.XamlDesigner/packages.config b/src/OpenSilver.XamlDesigner/packages.config index 41469a6..7800914 100644 --- a/src/OpenSilver.XamlDesigner/packages.config +++ b/src/OpenSilver.XamlDesigner/packages.config @@ -63,5 +63,5 @@ - + \ No newline at end of file From 52c57c32f515d1eaec3d420c2ec575f41cbc1927 Mon Sep 17 00:00:00 2001 From: Iakov Lilo Date: Wed, 11 Dec 2024 11:26:04 +1100 Subject: [PATCH 16/17] Fix generating class library --- .../AppCustomizationWizard.cs | 56 ++----------------- .../source.extension.vsixmanifest | 2 +- .../OpenSilverApplication.csproj | 2 +- .../OpenSilverApplication.fsproj | 2 +- .../OpenSilverApplication.vbproj | 2 +- 5 files changed, 8 insertions(+), 56 deletions(-) diff --git a/src/OpenSilver.TemplateWizards/AppCustomizationWizard.cs b/src/OpenSilver.TemplateWizards/AppCustomizationWizard.cs index a900984..b4627b4 100644 --- a/src/OpenSilver.TemplateWizards/AppCustomizationWizard.cs +++ b/src/OpenSilver.TemplateWizards/AppCustomizationWizard.cs @@ -4,7 +4,6 @@ using System; using System.Collections.Generic; using System.IO; -using System.Linq; using System.Reflection; using System.Windows; using System.Xml.Linq; @@ -14,8 +13,6 @@ namespace OpenSilver.TemplateWizards class AppCustomizationWizard : IWizard { private const string NugetConfig = "NuGet.Config"; - private Dictionary _replacementsDictionary; - private string _selectedTheme; private static string GetVsixFullPath(string filename) { var vsixDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); @@ -55,14 +52,6 @@ private static void CopyNugetConfig(Dictionary replacementsDicti } } - private string GetFileFullPath(string fileRelativePath) - { - var solutionDir = _replacementsDictionary["$destinationdirectory$"]; - string projectName = _replacementsDictionary["$safeprojectname$"]; - string fullPath = $"{solutionDir}\\{projectName}\\{fileRelativePath}"; - return fullPath; - } - public void BeforeOpeningFile(ProjectItem projectItem) { @@ -70,26 +59,6 @@ public void BeforeOpeningFile(ProjectItem projectItem) public void ProjectFinishedGenerating(Project project) { - if (_selectedTheme.Equals("Classic", StringComparison.OrdinalIgnoreCase)) - return; - - - string projectName = _replacementsDictionary["$safeprojectname$"]; - string language = GetCurrentProgrammingLanguage(); - - string OpenSilverCsprojPath = GetFileFullPath($"{projectName}.{language}proj"); - - if (File.Exists(OpenSilverCsprojPath)) - { - AddThemeReferences(OpenSilverCsprojPath); - } - } - - private string GetCurrentProgrammingLanguage() - { - var openSilverInfo = XElement.Parse(_replacementsDictionary["$wizarddata$"]); - XNamespace defaultNamespace = openSilverInfo.GetDefaultNamespace(); - return openSilverInfo.Element(defaultNamespace + "LanguageCode").Value; } private string GetAppXamlTheme(string selectedTheme) @@ -101,24 +70,9 @@ private string GetAppXamlTheme(string selectedTheme) return $" {Environment.NewLine} {Environment.NewLine} "; } - - private void AddThemeReferences(string path) + private string GetThemesNugetPackageLine(string version) { - var csprojDocument = XDocument.Load(path); - var itemGroupWithPackageReference = csprojDocument.Descendants("ItemGroup") - .FirstOrDefault(ig => ig.Elements("PackageReference").Any()); - - if (itemGroupWithPackageReference != null) - { - // Create the new element to insert - var newElement = new XElement("PackageReference", - new XAttribute("Include", "OpenSilver.Themes.Modern"), - new XAttribute("Version", _replacementsDictionary["$opensilverthememodern$"])); - - itemGroupWithPackageReference.Add(newElement); - - csprojDocument.Save(path); - } + return $"{Environment.NewLine} "; } public void ProjectItemFinishedGenerating(ProjectItem projectItem) @@ -133,7 +87,6 @@ public void RunFinished() public void RunStarted(object automationObject, Dictionary replacementsDictionary, WizardRunKind runKind, object[] customParams) { - XElement openSilverInfo = XElement.Parse(replacementsDictionary["$wizarddata$"]); XNamespace defaultNamespace = openSilverInfo.GetDefaultNamespace(); @@ -180,12 +133,11 @@ public void RunStarted(object automationObject, Dictionary repla replacementsDictionary.Add("$opensilverwebassemblypackageversion$", "3.1.0"); replacementsDictionary.Add("$openria46packageversion$", "3.1.0"); replacementsDictionary.Add("$opensilverthememodern$", "3.1.*"); + replacementsDictionary.Add("$pageforeground$", window.SelectedTheme == "Classic" ? "Black" : "{DynamicResource Theme_TextBrush}"); replacementsDictionary.Add("$gridbackground$", window.SelectedTheme == "Classic" ? "White" : "{DynamicResource Theme_BackgroundBrush}"); replacementsDictionary.Add("$appxamltheme$", GetAppXamlTheme(window.SelectedTheme)); - - _replacementsDictionary = replacementsDictionary; - _selectedTheme = window.SelectedTheme; + replacementsDictionary.Add("$themesnugetpackage$", window.SelectedTheme == "Classic" ? "" : GetThemesNugetPackageLine(replacementsDictionary["$opensilverthememodern$"])); } public bool ShouldAddProjectItem(string filePath) diff --git a/src/OpenSilver.VSIX/source.extension.vsixmanifest b/src/OpenSilver.VSIX/source.extension.vsixmanifest index f68367c..a4c7fec 100644 --- a/src/OpenSilver.VSIX/source.extension.vsixmanifest +++ b/src/OpenSilver.VSIX/source.extension.vsixmanifest @@ -1,7 +1,7 @@ - + OpenSilver Project templates and XAML Designer for creating OpenSilver applications. OpenSilver is an open-source reimplementation of Silverlight that runs on current browsers via WebAssembly. Logo_32x32.png diff --git a/src/OpenSilverApplicationTemplate/OpenSilverApplication/OpenSilverApplication.csproj b/src/OpenSilverApplicationTemplate/OpenSilverApplication/OpenSilverApplication.csproj index ee82318..7a228d4 100644 --- a/src/OpenSilverApplicationTemplate/OpenSilverApplication/OpenSilverApplication.csproj +++ b/src/OpenSilverApplicationTemplate/OpenSilverApplication/OpenSilverApplication.csproj @@ -7,7 +7,7 @@ - + $ext_themesnugetpackage$ diff --git a/src/OpenSilverFSApplicationTemplate/OpenSilverFSApplication/OpenSilverApplication.fsproj b/src/OpenSilverFSApplicationTemplate/OpenSilverFSApplication/OpenSilverApplication.fsproj index 32cec67..f414e7b 100644 --- a/src/OpenSilverFSApplicationTemplate/OpenSilverFSApplication/OpenSilverApplication.fsproj +++ b/src/OpenSilverFSApplicationTemplate/OpenSilverFSApplication/OpenSilverApplication.fsproj @@ -7,7 +7,7 @@ - + $ext_themesnugetpackage$ diff --git a/src/OpenSilverVBApplicationTemplate/OpenSilverVBApplication/OpenSilverApplication.vbproj b/src/OpenSilverVBApplicationTemplate/OpenSilverVBApplication/OpenSilverApplication.vbproj index 8d0c488..7dc2066 100644 --- a/src/OpenSilverVBApplicationTemplate/OpenSilverVBApplication/OpenSilverApplication.vbproj +++ b/src/OpenSilverVBApplicationTemplate/OpenSilverVBApplication/OpenSilverApplication.vbproj @@ -7,7 +7,7 @@ - + $ext_themesnugetpackage$ From 0583f6484342be037ae661c4e2490e6db0f53e14 Mon Sep 17 00:00:00 2001 From: Iakov Lilo Date: Wed, 11 Dec 2024 17:24:38 +1100 Subject: [PATCH 17/17] Add loader screens tailored to the selected theme --- .../AppCustomizationWizard.cs | 123 +++++++++++++++- .../OpenSilverApplication.Browser.vstemplate | 2 + .../wwwroot/index.html | 28 +--- .../wwwroot/loading-indicator.css | 12 +- .../wwwroot/modern/loading-animation.js | 134 ++++++++++++++++++ .../wwwroot/modern/loading-indicator.css | 74 ++++++++++ .../wwwroot/loading-indicator.css | 12 +- .../wwwroot/loading-indicator.css | 12 +- .../OpenSilverApplication.Browser.vstemplate | 2 + .../wwwroot/index.html | 28 +--- .../wwwroot/loading-indicator.css | 12 +- .../wwwroot/modern/loading-animation.js | 134 ++++++++++++++++++ .../wwwroot/modern/loading-indicator.css | 74 ++++++++++ .../OpenSilverApplication.Browser.vstemplate | 2 + .../wwwroot/index.html | 28 +--- .../wwwroot/loading-indicator.css | 12 +- .../wwwroot/modern/loading-animation.js | 134 ++++++++++++++++++ .../wwwroot/modern/loading-indicator.css | 74 ++++++++++ 18 files changed, 812 insertions(+), 85 deletions(-) create mode 100644 src/OpenSilverApplicationTemplate/OpenSilverApplication.Browser/wwwroot/modern/loading-animation.js create mode 100644 src/OpenSilverApplicationTemplate/OpenSilverApplication.Browser/wwwroot/modern/loading-indicator.css create mode 100644 src/OpenSilverFSApplicationTemplate/OpenSilverFSApplication.Browser/wwwroot/modern/loading-animation.js create mode 100644 src/OpenSilverFSApplicationTemplate/OpenSilverFSApplication.Browser/wwwroot/modern/loading-indicator.css create mode 100644 src/OpenSilverVBApplicationTemplate/OpenSilverVBApplication.Browser/wwwroot/modern/loading-animation.js create mode 100644 src/OpenSilverVBApplicationTemplate/OpenSilverVBApplication.Browser/wwwroot/modern/loading-indicator.css diff --git a/src/OpenSilver.TemplateWizards/AppCustomizationWizard.cs b/src/OpenSilver.TemplateWizards/AppCustomizationWizard.cs index b4627b4..7630fed 100644 --- a/src/OpenSilver.TemplateWizards/AppCustomizationWizard.cs +++ b/src/OpenSilver.TemplateWizards/AppCustomizationWizard.cs @@ -13,6 +13,67 @@ namespace OpenSilver.TemplateWizards class AppCustomizationWizard : IWizard { private const string NugetConfig = "NuGet.Config"; + private const string ClassicLoadingAnimation = @" +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
"; + private const string ModernLoadingAnimation = @" +
+
+
+
+
+
+
+
+ + + +
+
+
"; + private const string ModernLightStyles = @" + "; + private const string ModernDarkStyles = @" + "; + private const string ModernLoadingJs = @" + const script = document.createElement('script'); + script.setAttribute('type', 'application/javascript'); + script.setAttribute('src', 'modern/loading-animation.js?date=' + new Date().toISOString()); + document.head.appendChild(script);"; + private static string GetVsixFullPath(string filename) { var vsixDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); @@ -70,11 +131,57 @@ private string GetAppXamlTheme(string selectedTheme) return $" {Environment.NewLine} {Environment.NewLine} "; } + private string GetThemesNugetPackageLine(string version) { return $"{Environment.NewLine} "; } + private string GetLoadingColors(string selectedTheme) + { + if (selectedTheme == "Light") + { + return ModernLightStyles; + } + + if (selectedTheme == "Dark") + { + return ModernDarkStyles; + } + + return ""; + } + + private string GetLoadingIndicatorCss(string selectedTheme) + { + if (selectedTheme == "Classic") + { + return "loading-indicator.css"; + } + + return "modern/loading-indicator.css"; + } + + private string GetLoadingIndicatorJs(string selectedTheme) + { + if (selectedTheme == "Classic") + { + return ""; + } + + return ModernLoadingJs; + } + + private string GetLoadingIndicatorHtml(string selectedTheme) + { + if (selectedTheme == "Classic") + { + return ClassicLoadingAnimation; + } + + return ModernLoadingAnimation; + } + public void ProjectItemFinishedGenerating(ProjectItem projectItem) { @@ -134,10 +241,20 @@ public void RunStarted(object automationObject, Dictionary repla replacementsDictionary.Add("$openria46packageversion$", "3.1.0"); replacementsDictionary.Add("$opensilverthememodern$", "3.1.*"); - replacementsDictionary.Add("$pageforeground$", window.SelectedTheme == "Classic" ? "Black" : "{DynamicResource Theme_TextBrush}"); - replacementsDictionary.Add("$gridbackground$", window.SelectedTheme == "Classic" ? "White" : "{DynamicResource Theme_BackgroundBrush}"); + replacementsDictionary.Add("$pageforeground$", IsClassic(window) ? "Black" : "{DynamicResource Theme_TextBrush}"); + replacementsDictionary.Add("$gridbackground$", IsClassic(window) ? "White" : "{DynamicResource Theme_BackgroundBrush}"); replacementsDictionary.Add("$appxamltheme$", GetAppXamlTheme(window.SelectedTheme)); - replacementsDictionary.Add("$themesnugetpackage$", window.SelectedTheme == "Classic" ? "" : GetThemesNugetPackageLine(replacementsDictionary["$opensilverthememodern$"])); + replacementsDictionary.Add("$themesnugetpackage$", IsClassic(window) ? "" : GetThemesNugetPackageLine(replacementsDictionary["$opensilverthememodern$"])); + + replacementsDictionary.Add("$modernloadingcolors$", GetLoadingColors(window.SelectedTheme)); + replacementsDictionary.Add("$loadingindicatorcss$", GetLoadingIndicatorCss(window.SelectedTheme)); + replacementsDictionary.Add("$loadingindicatorjs$", GetLoadingIndicatorJs(window.SelectedTheme)); + replacementsDictionary.Add("$loadingindicatorhtml$", GetLoadingIndicatorHtml(window.SelectedTheme)); + } + + private bool IsClassic(AppConfigurationWindow window) + { + return window.SelectedTheme == "Classic"; } public bool ShouldAddProjectItem(string filePath) diff --git a/src/OpenSilverApplicationTemplate/OpenSilverApplication.Browser/OpenSilverApplication.Browser.vstemplate b/src/OpenSilverApplicationTemplate/OpenSilverApplication.Browser/OpenSilverApplication.Browser.vstemplate index ff0164d..b8bc7ab 100644 --- a/src/OpenSilverApplicationTemplate/OpenSilverApplication.Browser/OpenSilverApplication.Browser.vstemplate +++ b/src/OpenSilverApplicationTemplate/OpenSilverApplication.Browser/OpenSilverApplication.Browser.vstemplate @@ -9,6 +9,8 @@ launchSettings.json + modern/loading-indicator.css + modern/loading-animation.js favicon.ico index.html loading-indicator.css diff --git a/src/OpenSilverApplicationTemplate/OpenSilverApplication.Browser/wwwroot/index.html b/src/OpenSilverApplicationTemplate/OpenSilverApplication.Browser/wwwroot/index.html index 411db66..0589c9e 100644 --- a/src/OpenSilverApplicationTemplate/OpenSilverApplication.Browser/wwwroot/index.html +++ b/src/OpenSilverApplicationTemplate/OpenSilverApplication.Browser/wwwroot/index.html @@ -4,40 +4,20 @@ $ext_safeprojectname$ - + $ext_modernloadingcolors$ -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
$ext_loadingindicatorhtml$
diff --git a/src/OpenSilverApplicationTemplate/OpenSilverApplication.Browser/wwwroot/loading-indicator.css b/src/OpenSilverApplicationTemplate/OpenSilverApplication.Browser/wwwroot/loading-indicator.css index af05e43..f85e049 100644 --- a/src/OpenSilverApplicationTemplate/OpenSilverApplication.Browser/wwwroot/loading-indicator.css +++ b/src/OpenSilverApplicationTemplate/OpenSilverApplication.Browser/wwwroot/loading-indicator.css @@ -20,12 +20,17 @@ } } +body { + margin: 0; +} + .loading-indicator-wrapper { display: flex; justify-content: center; align-items: center; width: 100vw; height: 100vh; + background-color: #f0f0f0; /* Lighter background */ } .loading-indicator { @@ -41,8 +46,8 @@ width: 16%; height: 16%; border-radius: 50%; - background: #41afe6; - filter: blur(4px); + background: #3b8eea; /* Light blue */ + filter: blur(3px); /* Slightly lighter blur */ opacity: 0; animation: loading-indicator-ball-anim 9s infinite; } @@ -154,4 +159,7 @@ .loading-indicator-text:after { content: var(--blazor-load-percentage-text, "Loading..."); + color: #555; /* Darker text for contrast */ + font-size: 1.2rem; + font-family: 'Arial', sans-serif; } diff --git a/src/OpenSilverApplicationTemplate/OpenSilverApplication.Browser/wwwroot/modern/loading-animation.js b/src/OpenSilverApplicationTemplate/OpenSilverApplication.Browser/wwwroot/modern/loading-animation.js new file mode 100644 index 0000000..8c79602 --- /dev/null +++ b/src/OpenSilverApplicationTemplate/OpenSilverApplication.Browser/wwwroot/modern/loading-animation.js @@ -0,0 +1,134 @@ +(function () { + function startLoader() { + const count = document.querySelector(".opensilver-odometer"); + const loader = document.querySelector(".opensilver-loader-progress-bar"); + + if (!count || !loader) return; + + loader.style.width = "0%"; + + const observer = new MutationObserver(updateCount); + function updateCount() { + const loadPercentageText = getComputedStyle(document.documentElement) + .getPropertyValue("--blazor-load-percentage-text") + .trim(); + const loadPercentage = parseInt(loadPercentageText.replace(/"/g, "")); + const currentValue = isNaN(loadPercentage) ? 0 : loadPercentage; + + animateCounter(currentValue); + loader.style.width = currentValue + "%"; + + if (currentValue === 100) { + observer.disconnect(); + return; + } + } + + observer.observe(document.documentElement, { + attributes: true, + attributeFilter: ["style"], + }); + + updateCount(); + } + + function animateCounter(newValue) { + newValue = Math.min(newValue, 100); + + const count = Array.from(document.querySelectorAll(".opensilver-odometer")); + const currentValue = count.map((span) => span.textContent).join(""); + const newValueString = String(newValue).padStart(3, "0"); + for (let i = 0; i < newValueString.length; i++) { + if (newValueString[i] !== currentValue[i]) { + gsap.to(count[i], { + y: -4, + opacity: 0.5, + duration: 0.075, + ease: "none", + onComplete: () => { + count[i].textContent = newValueString[i]; + gsap.fromTo( + count[i], + { y: 4, opacity: 0.5 }, + { y: 0, opacity: 1, duration: 0.075, ease: "none" } + ); + }, + }); + } + } + + if (newValue === 100 && currentValue !== "100") { + gsap.to(count[1], { + y: -4, + opacity: 0.5, + duration: 0.075, + ease: "none", + onComplete: () => { + count[1].textContent = "0"; + gsap.fromTo( + count[1], + { y: 4, opacity: 0.5 }, + { y: 0, opacity: 1, duration: 0.075, ease: "none" } + ); + }, + }); + + gsap.to(count[2], { + y: -4, + opacity: 0.5, + duration: 0.075, + ease: "none", + onComplete: () => { + count[2].textContent = "0"; + gsap.fromTo( + count[2], + { y: 4, opacity: 0.5 }, + { y: 0, opacity: 1, duration: 0.075, ease: "none" } + ); + }, + }); + } + } + + function onDomReady() { + startLoader(); + + function startAnimations() { + gsap.to(".opensilver-loader-progress", { + width: "60vw", + opacity: 1, + duration: 1.25, + ease: "power1.out", + delay: 0.4, + }); + + gsap.to(".opensilver-counter-container", { + opacity: 1, + duration: 0.3, + ease: "none", + delay: 1.1, + }); + + gsap.to(".opensilver-counter-container > .opensilver-odometer", { + transform: "translateY(0)", + duration: 0.3, + ease: "none", + delay: 1.1, + }); + } + + startAnimations(); + } + + const script = document.createElement('script'); + script.setAttribute('type', 'application/javascript'); + script.setAttribute('src', 'https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.5/gsap.min.js'); + script.addEventListener('load', function () { + if (document.readyState === 'loading') { + document.addEventListener('DOMContentLoaded', onDomReady); + } else { + onDomReady(); + } + }); + document.head.appendChild(script); +})(); \ No newline at end of file diff --git a/src/OpenSilverApplicationTemplate/OpenSilverApplication.Browser/wwwroot/modern/loading-indicator.css b/src/OpenSilverApplicationTemplate/OpenSilverApplication.Browser/wwwroot/modern/loading-indicator.css new file mode 100644 index 0000000..5eb9e1e --- /dev/null +++ b/src/OpenSilverApplicationTemplate/OpenSilverApplication.Browser/wwwroot/modern/loading-indicator.css @@ -0,0 +1,74 @@ + +html body { + background: var(--opensilver-loading-background-color); +} + +.opensilver-loading-indicator { + position: fixed; + top: 0; + left: 0; + display: flex; + justify-content: center; + align-items: center; + pointer-events: none; + height: 100vh; + width: 100vw; + overflow: hidden; + background: var(--opensilver-loading-background-color); +} + +.opensilver-loading-indicator .opensilver-loader-container { + display: flex; + justify-content: center; + align-items: center; + gap: 8px; +} + +.opensilver-loading-indicator .opensilver-loader { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + gap: 10px; + width: 100%; + height: 100%; + margin-left: 20px; +} + +.opensilver-loading-indicator .opensilver-loader-progress { + display: flex; + justify-content: flex-start; + align-items: center; + width: 0; + max-width: 200px; + height: 4px; + border-radius: 12px; + background-color: var(--opensilver-loading-progress-bg); +} + +.opensilver-loading-indicator .opensilver-loader-progress-bar { + width: 0%; + height: 5px; + border-radius: 12px; + background-color: var(--opensilver-loading-progress-bar-color); + transition: width 0.75s ease; +} + +.opensilver-loading-indicator .opensilver-counter-container { + align-self: end; + display: flex; + justify-content: end; + align-items: center; + font-family: sans-serif; + font-size: clamp(0.8rem, 1.4vw, 1.6rem); + font-weight: 500; + width: 100%; + min-width: 26px; + line-height: 1; + gap: 1px; + color: var(--opensilver-loading-counter-color); +} + +.opensilver-loading-indicator .opensilver-counter-container > .opensilver-odometer { + transform: translateY(4px); +} diff --git a/src/OpenSilverBusinessApplicationTemplate/OpenSilverBusinessApplication.Browser/wwwroot/loading-indicator.css b/src/OpenSilverBusinessApplicationTemplate/OpenSilverBusinessApplication.Browser/wwwroot/loading-indicator.css index a87a07b..fcf8777 100644 --- a/src/OpenSilverBusinessApplicationTemplate/OpenSilverBusinessApplication.Browser/wwwroot/loading-indicator.css +++ b/src/OpenSilverBusinessApplicationTemplate/OpenSilverBusinessApplication.Browser/wwwroot/loading-indicator.css @@ -20,12 +20,17 @@ } } +body { + margin: 0; +} + .loading-indicator-wrapper { display: flex; justify-content: center; align-items: center; width: 100vw; height: 100vh; + background-color: #f0f0f0; /* Lighter background */ } .loading-indicator { @@ -41,8 +46,8 @@ width: 16%; height: 16%; border-radius: 50%; - background: #41afe6; - filter: blur(4px); + background: #3b8eea; /* Light blue */ + filter: blur(3px); /* Slightly lighter blur */ opacity: 0; animation: loading-indicator-ball-anim 9s infinite; } @@ -154,4 +159,7 @@ .loading-indicator-text:after { content: var(--blazor-load-percentage-text, "Loading..."); + color: #555; /* Darker text for contrast */ + font-size: 1.2rem; + font-family: 'Arial', sans-serif; } diff --git a/src/OpenSilverBusinessVBApplicationTemplate/OpenSilverBusinessApplication.Browser/wwwroot/loading-indicator.css b/src/OpenSilverBusinessVBApplicationTemplate/OpenSilverBusinessApplication.Browser/wwwroot/loading-indicator.css index af05e43..f85e049 100644 --- a/src/OpenSilverBusinessVBApplicationTemplate/OpenSilverBusinessApplication.Browser/wwwroot/loading-indicator.css +++ b/src/OpenSilverBusinessVBApplicationTemplate/OpenSilverBusinessApplication.Browser/wwwroot/loading-indicator.css @@ -20,12 +20,17 @@ } } +body { + margin: 0; +} + .loading-indicator-wrapper { display: flex; justify-content: center; align-items: center; width: 100vw; height: 100vh; + background-color: #f0f0f0; /* Lighter background */ } .loading-indicator { @@ -41,8 +46,8 @@ width: 16%; height: 16%; border-radius: 50%; - background: #41afe6; - filter: blur(4px); + background: #3b8eea; /* Light blue */ + filter: blur(3px); /* Slightly lighter blur */ opacity: 0; animation: loading-indicator-ball-anim 9s infinite; } @@ -154,4 +159,7 @@ .loading-indicator-text:after { content: var(--blazor-load-percentage-text, "Loading..."); + color: #555; /* Darker text for contrast */ + font-size: 1.2rem; + font-family: 'Arial', sans-serif; } diff --git a/src/OpenSilverFSApplicationTemplate/OpenSilverFSApplication.Browser/OpenSilverApplication.Browser.vstemplate b/src/OpenSilverFSApplicationTemplate/OpenSilverFSApplication.Browser/OpenSilverApplication.Browser.vstemplate index ff0164d..b8bc7ab 100644 --- a/src/OpenSilverFSApplicationTemplate/OpenSilverFSApplication.Browser/OpenSilverApplication.Browser.vstemplate +++ b/src/OpenSilverFSApplicationTemplate/OpenSilverFSApplication.Browser/OpenSilverApplication.Browser.vstemplate @@ -9,6 +9,8 @@ launchSettings.json + modern/loading-indicator.css + modern/loading-animation.js favicon.ico index.html loading-indicator.css diff --git a/src/OpenSilverFSApplicationTemplate/OpenSilverFSApplication.Browser/wwwroot/index.html b/src/OpenSilverFSApplicationTemplate/OpenSilverFSApplication.Browser/wwwroot/index.html index 411db66..0589c9e 100644 --- a/src/OpenSilverFSApplicationTemplate/OpenSilverFSApplication.Browser/wwwroot/index.html +++ b/src/OpenSilverFSApplicationTemplate/OpenSilverFSApplication.Browser/wwwroot/index.html @@ -4,40 +4,20 @@ $ext_safeprojectname$ - + $ext_modernloadingcolors$ -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
$ext_loadingindicatorhtml$
diff --git a/src/OpenSilverFSApplicationTemplate/OpenSilverFSApplication.Browser/wwwroot/loading-indicator.css b/src/OpenSilverFSApplicationTemplate/OpenSilverFSApplication.Browser/wwwroot/loading-indicator.css index af05e43..f85e049 100644 --- a/src/OpenSilverFSApplicationTemplate/OpenSilverFSApplication.Browser/wwwroot/loading-indicator.css +++ b/src/OpenSilverFSApplicationTemplate/OpenSilverFSApplication.Browser/wwwroot/loading-indicator.css @@ -20,12 +20,17 @@ } } +body { + margin: 0; +} + .loading-indicator-wrapper { display: flex; justify-content: center; align-items: center; width: 100vw; height: 100vh; + background-color: #f0f0f0; /* Lighter background */ } .loading-indicator { @@ -41,8 +46,8 @@ width: 16%; height: 16%; border-radius: 50%; - background: #41afe6; - filter: blur(4px); + background: #3b8eea; /* Light blue */ + filter: blur(3px); /* Slightly lighter blur */ opacity: 0; animation: loading-indicator-ball-anim 9s infinite; } @@ -154,4 +159,7 @@ .loading-indicator-text:after { content: var(--blazor-load-percentage-text, "Loading..."); + color: #555; /* Darker text for contrast */ + font-size: 1.2rem; + font-family: 'Arial', sans-serif; } diff --git a/src/OpenSilverFSApplicationTemplate/OpenSilverFSApplication.Browser/wwwroot/modern/loading-animation.js b/src/OpenSilverFSApplicationTemplate/OpenSilverFSApplication.Browser/wwwroot/modern/loading-animation.js new file mode 100644 index 0000000..8c79602 --- /dev/null +++ b/src/OpenSilverFSApplicationTemplate/OpenSilverFSApplication.Browser/wwwroot/modern/loading-animation.js @@ -0,0 +1,134 @@ +(function () { + function startLoader() { + const count = document.querySelector(".opensilver-odometer"); + const loader = document.querySelector(".opensilver-loader-progress-bar"); + + if (!count || !loader) return; + + loader.style.width = "0%"; + + const observer = new MutationObserver(updateCount); + function updateCount() { + const loadPercentageText = getComputedStyle(document.documentElement) + .getPropertyValue("--blazor-load-percentage-text") + .trim(); + const loadPercentage = parseInt(loadPercentageText.replace(/"/g, "")); + const currentValue = isNaN(loadPercentage) ? 0 : loadPercentage; + + animateCounter(currentValue); + loader.style.width = currentValue + "%"; + + if (currentValue === 100) { + observer.disconnect(); + return; + } + } + + observer.observe(document.documentElement, { + attributes: true, + attributeFilter: ["style"], + }); + + updateCount(); + } + + function animateCounter(newValue) { + newValue = Math.min(newValue, 100); + + const count = Array.from(document.querySelectorAll(".opensilver-odometer")); + const currentValue = count.map((span) => span.textContent).join(""); + const newValueString = String(newValue).padStart(3, "0"); + for (let i = 0; i < newValueString.length; i++) { + if (newValueString[i] !== currentValue[i]) { + gsap.to(count[i], { + y: -4, + opacity: 0.5, + duration: 0.075, + ease: "none", + onComplete: () => { + count[i].textContent = newValueString[i]; + gsap.fromTo( + count[i], + { y: 4, opacity: 0.5 }, + { y: 0, opacity: 1, duration: 0.075, ease: "none" } + ); + }, + }); + } + } + + if (newValue === 100 && currentValue !== "100") { + gsap.to(count[1], { + y: -4, + opacity: 0.5, + duration: 0.075, + ease: "none", + onComplete: () => { + count[1].textContent = "0"; + gsap.fromTo( + count[1], + { y: 4, opacity: 0.5 }, + { y: 0, opacity: 1, duration: 0.075, ease: "none" } + ); + }, + }); + + gsap.to(count[2], { + y: -4, + opacity: 0.5, + duration: 0.075, + ease: "none", + onComplete: () => { + count[2].textContent = "0"; + gsap.fromTo( + count[2], + { y: 4, opacity: 0.5 }, + { y: 0, opacity: 1, duration: 0.075, ease: "none" } + ); + }, + }); + } + } + + function onDomReady() { + startLoader(); + + function startAnimations() { + gsap.to(".opensilver-loader-progress", { + width: "60vw", + opacity: 1, + duration: 1.25, + ease: "power1.out", + delay: 0.4, + }); + + gsap.to(".opensilver-counter-container", { + opacity: 1, + duration: 0.3, + ease: "none", + delay: 1.1, + }); + + gsap.to(".opensilver-counter-container > .opensilver-odometer", { + transform: "translateY(0)", + duration: 0.3, + ease: "none", + delay: 1.1, + }); + } + + startAnimations(); + } + + const script = document.createElement('script'); + script.setAttribute('type', 'application/javascript'); + script.setAttribute('src', 'https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.5/gsap.min.js'); + script.addEventListener('load', function () { + if (document.readyState === 'loading') { + document.addEventListener('DOMContentLoaded', onDomReady); + } else { + onDomReady(); + } + }); + document.head.appendChild(script); +})(); \ No newline at end of file diff --git a/src/OpenSilverFSApplicationTemplate/OpenSilverFSApplication.Browser/wwwroot/modern/loading-indicator.css b/src/OpenSilverFSApplicationTemplate/OpenSilverFSApplication.Browser/wwwroot/modern/loading-indicator.css new file mode 100644 index 0000000..5eb9e1e --- /dev/null +++ b/src/OpenSilverFSApplicationTemplate/OpenSilverFSApplication.Browser/wwwroot/modern/loading-indicator.css @@ -0,0 +1,74 @@ + +html body { + background: var(--opensilver-loading-background-color); +} + +.opensilver-loading-indicator { + position: fixed; + top: 0; + left: 0; + display: flex; + justify-content: center; + align-items: center; + pointer-events: none; + height: 100vh; + width: 100vw; + overflow: hidden; + background: var(--opensilver-loading-background-color); +} + +.opensilver-loading-indicator .opensilver-loader-container { + display: flex; + justify-content: center; + align-items: center; + gap: 8px; +} + +.opensilver-loading-indicator .opensilver-loader { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + gap: 10px; + width: 100%; + height: 100%; + margin-left: 20px; +} + +.opensilver-loading-indicator .opensilver-loader-progress { + display: flex; + justify-content: flex-start; + align-items: center; + width: 0; + max-width: 200px; + height: 4px; + border-radius: 12px; + background-color: var(--opensilver-loading-progress-bg); +} + +.opensilver-loading-indicator .opensilver-loader-progress-bar { + width: 0%; + height: 5px; + border-radius: 12px; + background-color: var(--opensilver-loading-progress-bar-color); + transition: width 0.75s ease; +} + +.opensilver-loading-indicator .opensilver-counter-container { + align-self: end; + display: flex; + justify-content: end; + align-items: center; + font-family: sans-serif; + font-size: clamp(0.8rem, 1.4vw, 1.6rem); + font-weight: 500; + width: 100%; + min-width: 26px; + line-height: 1; + gap: 1px; + color: var(--opensilver-loading-counter-color); +} + +.opensilver-loading-indicator .opensilver-counter-container > .opensilver-odometer { + transform: translateY(4px); +} diff --git a/src/OpenSilverVBApplicationTemplate/OpenSilverVBApplication.Browser/OpenSilverApplication.Browser.vstemplate b/src/OpenSilverVBApplicationTemplate/OpenSilverVBApplication.Browser/OpenSilverApplication.Browser.vstemplate index ff0164d..b8bc7ab 100644 --- a/src/OpenSilverVBApplicationTemplate/OpenSilverVBApplication.Browser/OpenSilverApplication.Browser.vstemplate +++ b/src/OpenSilverVBApplicationTemplate/OpenSilverVBApplication.Browser/OpenSilverApplication.Browser.vstemplate @@ -9,6 +9,8 @@ launchSettings.json + modern/loading-indicator.css + modern/loading-animation.js favicon.ico index.html loading-indicator.css diff --git a/src/OpenSilverVBApplicationTemplate/OpenSilverVBApplication.Browser/wwwroot/index.html b/src/OpenSilverVBApplicationTemplate/OpenSilverVBApplication.Browser/wwwroot/index.html index 411db66..0589c9e 100644 --- a/src/OpenSilverVBApplicationTemplate/OpenSilverVBApplication.Browser/wwwroot/index.html +++ b/src/OpenSilverVBApplicationTemplate/OpenSilverVBApplication.Browser/wwwroot/index.html @@ -4,40 +4,20 @@ $ext_safeprojectname$ - + $ext_modernloadingcolors$ -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
$ext_loadingindicatorhtml$
diff --git a/src/OpenSilverVBApplicationTemplate/OpenSilverVBApplication.Browser/wwwroot/loading-indicator.css b/src/OpenSilverVBApplicationTemplate/OpenSilverVBApplication.Browser/wwwroot/loading-indicator.css index af05e43..f85e049 100644 --- a/src/OpenSilverVBApplicationTemplate/OpenSilverVBApplication.Browser/wwwroot/loading-indicator.css +++ b/src/OpenSilverVBApplicationTemplate/OpenSilverVBApplication.Browser/wwwroot/loading-indicator.css @@ -20,12 +20,17 @@ } } +body { + margin: 0; +} + .loading-indicator-wrapper { display: flex; justify-content: center; align-items: center; width: 100vw; height: 100vh; + background-color: #f0f0f0; /* Lighter background */ } .loading-indicator { @@ -41,8 +46,8 @@ width: 16%; height: 16%; border-radius: 50%; - background: #41afe6; - filter: blur(4px); + background: #3b8eea; /* Light blue */ + filter: blur(3px); /* Slightly lighter blur */ opacity: 0; animation: loading-indicator-ball-anim 9s infinite; } @@ -154,4 +159,7 @@ .loading-indicator-text:after { content: var(--blazor-load-percentage-text, "Loading..."); + color: #555; /* Darker text for contrast */ + font-size: 1.2rem; + font-family: 'Arial', sans-serif; } diff --git a/src/OpenSilverVBApplicationTemplate/OpenSilverVBApplication.Browser/wwwroot/modern/loading-animation.js b/src/OpenSilverVBApplicationTemplate/OpenSilverVBApplication.Browser/wwwroot/modern/loading-animation.js new file mode 100644 index 0000000..8c79602 --- /dev/null +++ b/src/OpenSilverVBApplicationTemplate/OpenSilverVBApplication.Browser/wwwroot/modern/loading-animation.js @@ -0,0 +1,134 @@ +(function () { + function startLoader() { + const count = document.querySelector(".opensilver-odometer"); + const loader = document.querySelector(".opensilver-loader-progress-bar"); + + if (!count || !loader) return; + + loader.style.width = "0%"; + + const observer = new MutationObserver(updateCount); + function updateCount() { + const loadPercentageText = getComputedStyle(document.documentElement) + .getPropertyValue("--blazor-load-percentage-text") + .trim(); + const loadPercentage = parseInt(loadPercentageText.replace(/"/g, "")); + const currentValue = isNaN(loadPercentage) ? 0 : loadPercentage; + + animateCounter(currentValue); + loader.style.width = currentValue + "%"; + + if (currentValue === 100) { + observer.disconnect(); + return; + } + } + + observer.observe(document.documentElement, { + attributes: true, + attributeFilter: ["style"], + }); + + updateCount(); + } + + function animateCounter(newValue) { + newValue = Math.min(newValue, 100); + + const count = Array.from(document.querySelectorAll(".opensilver-odometer")); + const currentValue = count.map((span) => span.textContent).join(""); + const newValueString = String(newValue).padStart(3, "0"); + for (let i = 0; i < newValueString.length; i++) { + if (newValueString[i] !== currentValue[i]) { + gsap.to(count[i], { + y: -4, + opacity: 0.5, + duration: 0.075, + ease: "none", + onComplete: () => { + count[i].textContent = newValueString[i]; + gsap.fromTo( + count[i], + { y: 4, opacity: 0.5 }, + { y: 0, opacity: 1, duration: 0.075, ease: "none" } + ); + }, + }); + } + } + + if (newValue === 100 && currentValue !== "100") { + gsap.to(count[1], { + y: -4, + opacity: 0.5, + duration: 0.075, + ease: "none", + onComplete: () => { + count[1].textContent = "0"; + gsap.fromTo( + count[1], + { y: 4, opacity: 0.5 }, + { y: 0, opacity: 1, duration: 0.075, ease: "none" } + ); + }, + }); + + gsap.to(count[2], { + y: -4, + opacity: 0.5, + duration: 0.075, + ease: "none", + onComplete: () => { + count[2].textContent = "0"; + gsap.fromTo( + count[2], + { y: 4, opacity: 0.5 }, + { y: 0, opacity: 1, duration: 0.075, ease: "none" } + ); + }, + }); + } + } + + function onDomReady() { + startLoader(); + + function startAnimations() { + gsap.to(".opensilver-loader-progress", { + width: "60vw", + opacity: 1, + duration: 1.25, + ease: "power1.out", + delay: 0.4, + }); + + gsap.to(".opensilver-counter-container", { + opacity: 1, + duration: 0.3, + ease: "none", + delay: 1.1, + }); + + gsap.to(".opensilver-counter-container > .opensilver-odometer", { + transform: "translateY(0)", + duration: 0.3, + ease: "none", + delay: 1.1, + }); + } + + startAnimations(); + } + + const script = document.createElement('script'); + script.setAttribute('type', 'application/javascript'); + script.setAttribute('src', 'https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.5/gsap.min.js'); + script.addEventListener('load', function () { + if (document.readyState === 'loading') { + document.addEventListener('DOMContentLoaded', onDomReady); + } else { + onDomReady(); + } + }); + document.head.appendChild(script); +})(); \ No newline at end of file diff --git a/src/OpenSilverVBApplicationTemplate/OpenSilverVBApplication.Browser/wwwroot/modern/loading-indicator.css b/src/OpenSilverVBApplicationTemplate/OpenSilverVBApplication.Browser/wwwroot/modern/loading-indicator.css new file mode 100644 index 0000000..5eb9e1e --- /dev/null +++ b/src/OpenSilverVBApplicationTemplate/OpenSilverVBApplication.Browser/wwwroot/modern/loading-indicator.css @@ -0,0 +1,74 @@ + +html body { + background: var(--opensilver-loading-background-color); +} + +.opensilver-loading-indicator { + position: fixed; + top: 0; + left: 0; + display: flex; + justify-content: center; + align-items: center; + pointer-events: none; + height: 100vh; + width: 100vw; + overflow: hidden; + background: var(--opensilver-loading-background-color); +} + +.opensilver-loading-indicator .opensilver-loader-container { + display: flex; + justify-content: center; + align-items: center; + gap: 8px; +} + +.opensilver-loading-indicator .opensilver-loader { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + gap: 10px; + width: 100%; + height: 100%; + margin-left: 20px; +} + +.opensilver-loading-indicator .opensilver-loader-progress { + display: flex; + justify-content: flex-start; + align-items: center; + width: 0; + max-width: 200px; + height: 4px; + border-radius: 12px; + background-color: var(--opensilver-loading-progress-bg); +} + +.opensilver-loading-indicator .opensilver-loader-progress-bar { + width: 0%; + height: 5px; + border-radius: 12px; + background-color: var(--opensilver-loading-progress-bar-color); + transition: width 0.75s ease; +} + +.opensilver-loading-indicator .opensilver-counter-container { + align-self: end; + display: flex; + justify-content: end; + align-items: center; + font-family: sans-serif; + font-size: clamp(0.8rem, 1.4vw, 1.6rem); + font-weight: 500; + width: 100%; + min-width: 26px; + line-height: 1; + gap: 1px; + color: var(--opensilver-loading-counter-color); +} + +.opensilver-loading-indicator .opensilver-counter-container > .opensilver-odometer { + transform: translateY(4px); +}