From 232e6e4b418023f90286ff502d7172f7e094b05b Mon Sep 17 00:00:00 2001
From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com>
Date: Sun, 4 Jun 2023 23:10:03 +0800
Subject: [PATCH] feat: upgrade to support wasm.
---
demo/Semi.Avalonia.Demo.Web/App.axaml | 8 ++++----
demo/Semi.Avalonia.Demo.Web/AppBundle/app.css | 9 ++++++++-
demo/Semi.Avalonia.Demo.Web/AppBundle/index.html | 1 -
demo/Semi.Avalonia.Demo.Web/AppBundle/main.js | 3 ---
demo/Semi.Avalonia.Demo.Web/Program.cs | 11 +++++------
.../Semi.Avalonia.Demo.Web.csproj | 11 +----------
6 files changed, 18 insertions(+), 25 deletions(-)
diff --git a/demo/Semi.Avalonia.Demo.Web/App.axaml b/demo/Semi.Avalonia.Demo.Web/App.axaml
index fe5d151..6b850fc 100644
--- a/demo/Semi.Avalonia.Demo.Web/App.axaml
+++ b/demo/Semi.Avalonia.Demo.Web/App.axaml
@@ -1,10 +1,10 @@
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
-
-
+
+
+
\ No newline at end of file
diff --git a/demo/Semi.Avalonia.Demo.Web/AppBundle/app.css b/demo/Semi.Avalonia.Demo.Web/AppBundle/app.css
index 027ea8f..a424538 100644
--- a/demo/Semi.Avalonia.Demo.Web/AppBundle/app.css
+++ b/demo/Semi.Avalonia.Demo.Web/AppBundle/app.css
@@ -1,4 +1,11 @@
-/* HTML styles for the splash screen */
+:root {
+ --sat: env(safe-area-inset-top);
+ --sar: env(safe-area-inset-right);
+ --sab: env(safe-area-inset-bottom);
+ --sal: env(safe-area-inset-left);
+}
+
+/* HTML styles for the splash screen */
.highlight {
color: white;
diff --git a/demo/Semi.Avalonia.Demo.Web/AppBundle/index.html b/demo/Semi.Avalonia.Demo.Web/AppBundle/index.html
index c90e26c..703ee35 100644
--- a/demo/Semi.Avalonia.Demo.Web/AppBundle/index.html
+++ b/demo/Semi.Avalonia.Demo.Web/AppBundle/index.html
@@ -10,7 +10,6 @@
-
diff --git a/demo/Semi.Avalonia.Demo.Web/AppBundle/main.js b/demo/Semi.Avalonia.Demo.Web/AppBundle/main.js
index 2426ede..0dbe2e4 100644
--- a/demo/Semi.Avalonia.Demo.Web/AppBundle/main.js
+++ b/demo/Semi.Avalonia.Demo.Web/AppBundle/main.js
@@ -1,5 +1,4 @@
import { dotnet } from './dotnet.js'
-import { registerAvaloniaModule } from './avalonia.js';
const is_browser = typeof window != "undefined";
if (!is_browser) throw new Error(`Expected to be running in a browser`);
@@ -9,8 +8,6 @@ const dotnetRuntime = await dotnet
.withApplicationArgumentsFromQuery()
.create();
-await registerAvaloniaModule(dotnetRuntime);
-
const config = dotnetRuntime.getConfig();
await dotnetRuntime.runMainAndExit(config.mainAssemblyName, [window.location.search]);
\ No newline at end of file
diff --git a/demo/Semi.Avalonia.Demo.Web/Program.cs b/demo/Semi.Avalonia.Demo.Web/Program.cs
index 37143f0..17e83a9 100644
--- a/demo/Semi.Avalonia.Demo.Web/Program.cs
+++ b/demo/Semi.Avalonia.Demo.Web/Program.cs
@@ -1,17 +1,16 @@
using System.Runtime.Versioning;
+using System.Threading.Tasks;
using Avalonia;
-using Avalonia.Media;
-using Semi.Avalonia.Demo.Web;
using Avalonia.Browser;
[assembly: SupportedOSPlatform("browser")]
+namespace Semi.Avalonia.Demo.Web;
+
internal partial class Program
{
- private static void Main(string[] args)
- {
- BuildAvaloniaApp(); //.SetupBrowserApp("out");
- }
+ private static async Task Main(string[] args) => await BuildAvaloniaApp()
+ .StartBrowserAppAsync("out");
public static AppBuilder BuildAvaloniaApp()
=> AppBuilder.Configure();
diff --git a/demo/Semi.Avalonia.Demo.Web/Semi.Avalonia.Demo.Web.csproj b/demo/Semi.Avalonia.Demo.Web/Semi.Avalonia.Demo.Web.csproj
index 9db7e5b..b169194 100644
--- a/demo/Semi.Avalonia.Demo.Web/Semi.Avalonia.Demo.Web.csproj
+++ b/demo/Semi.Avalonia.Demo.Web/Semi.Avalonia.Demo.Web.csproj
@@ -10,20 +10,11 @@
-
-
-
-
-
-
-
-
-
-
+