Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -64,30 +64,70 @@
{
"choice": "net8.0",
"description": "Use .NET 8.0"
},
{
"choice": "net9.0",
"description": "Use .NET 9.0"
}
]
},
"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",
"replaces": "OpenSilverPackageVersion",
"replaces": "$OpenSilverPackageVersion$",
"parameters": {
"value": "3.0.1"
"value": "3.1.0"
}
},
"openSilverSimulatorPackageVersion": {
"type": "generated",
"generator": "constant",
"replaces": "OpenSilverSimulatorPackageVersion",
"replaces": "$OpenSilverSimulatorPackageVersion$",
"parameters": {
"value": "3.0.0"
"value": "3.1.0"
}
},
"openSilverWebAssemblyPackageVersion": {
"type": "generated",
"generator": "constant",
"replaces": "$OpenSilverWebAssemblyPackageVersion$",
"parameters": {
"value": "3.1.0"
}
},
"modernThemePackageVersion": {
"type": "generated",
"generator": "constant",
"replaces": "$ModernThemePackageVersion$",
"parameters": {
"value": "3.1.*"
}
},
"webAssemblyPackageVersion": {
"type": "generated",
"generator": "switch",
"datatype": "string",
"replaces": "WebAssemblyPackageVersion",
"replaces": "$WebAssemblyPackageVersion$",
"parameters": {
"evaluator": "C++",
"cases": [
Expand All @@ -97,7 +137,49 @@
},
{
"condition": "(targetFramework == 'net8.0')",
"value": "8.0.0"
"value": "8.0.11"
},
{
"condition": "(targetFramework == 'net9.0')",
"value": "9.0.0"
}
]
}
},
"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}"
}
]
}
Expand Down
16 changes: 0 additions & 16 deletions src/OpenSilver.CLI/C#/OpenSilverApplication/.vscode/launch.json

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<NoXamlPreprocessor>True</NoXamlPreprocessor>
<OpenSilverType>6</OpenSilverType>
<TargetFramework>net9.0</TargetFramework>
<OpenSilverType>7</OpenSilverType>
<PublishTrimmed>true</PublishTrimmed>
<WasmEnableSIMD>false</WasmEnableSIMD>
<!-- Uncomment to enable AOT compilation when publishing -->
<!--<RunAOTCompilation>true</RunAOTCompilation>-->
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="WebAssemblyPackageVersion" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="WebAssemblyPackageVersion" PrivateAssets="all" />
<PackageReference Include="OpenSilver" Version="OpenSilverPackageVersion" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="$WebAssemblyPackageVersion$" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="$WebAssemblyPackageVersion$" PrivateAssets="all" />
<PackageReference Include="OpenSilver.WebAssembly" Version="$OpenSilverWebAssemblyPackageVersion$" />
</ItemGroup>

<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -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
{
Expand All @@ -18,17 +15,7 @@ protected override void BuildRenderTree(RenderTreeBuilder __builder)
protected async override Task OnInitializedAsync()
{
await base.OnInitializedAsync();

if (!await JSRuntime.InvokeAsync<bool>("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<OpenSilverApplication.App>();
}

[Inject]
private IJSRuntime JSRuntime { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -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
{
Expand All @@ -13,19 +9,8 @@ public static async Task Main(string[] args)
{
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("#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();
});
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net472</TargetFramework>
<TargetFramework>net9.0-windows</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="OpenSilver.Simulator" Version="OpenSilverSimulatorPackageVersion" />
<PackageReference Include="OpenSilver.Simulator" Version="$OpenSilverSimulatorPackageVersion$" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,14 @@

</ResourceDictionary>
</Application.Resources>
<!--#if(theme == 'modern-light')-->
<Application.Theme>
<mt:ModernTheme CurrentPalette="Light" xmlns:mt="http://opensilver.net/themes/modern" />
</Application.Theme>
<!--#endif-->
<!--#if(theme == 'modern-dark')-->
<Application.Theme>
<mt:ModernTheme CurrentPalette="Dark" xmlns:mt="http://opensilver.net/themes/modern" />
</Application.Theme>
<!--#endif-->
</Application>
Original file line number Diff line number Diff line change
Expand Up @@ -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$">

<Grid Background="White">
<Grid Background="$GridBackground$">
<TextBlock Text="Hello, World!" FontSize="23" Margin="32,32,0,0" HorizontalAlignment="Left" VerticalAlignment="Top"/>
</Grid>
</Page>
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="OpenSilver" Version="OpenSilverPackageVersion" />
<PackageReference Include="OpenSilver" Version="$OpenSilverPackageVersion$" />
<!--#if(theme == 'modern-light' || theme == 'modern-dark')-->
<PackageReference Include="OpenSilver.Themes.Modern" Version="$ModernThemePackageVersion$" />
<!--#endif-->
</ItemGroup>

<ItemGroup>
Expand Down

This file was deleted.

Loading