25 changed files with 105 additions and 106 deletions
@ -1,7 +1,7 @@ |
|||||
using Avalonia; |
using Avalonia; |
||||
using Avalonia.Web.Blazor; |
using Avalonia.Web.Blazor; |
||||
|
|
||||
namespace ControlCatalog.Web; |
namespace ControlCatalog.Blazor.Web; |
||||
|
|
||||
public partial class App |
public partial class App |
||||
{ |
{ |
||||
@ -0,0 +1,29 @@ |
|||||
|
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly"> |
||||
|
<PropertyGroup> |
||||
|
<TargetFramework>net7.0</TargetFramework> |
||||
|
<RuntimeIdentifier>browser-wasm</RuntimeIdentifier> |
||||
|
<Nullable>enable</Nullable> |
||||
|
<EmccTotalMemory>16777216</EmccTotalMemory> |
||||
|
<BlazorEnableTimeZoneSupport>false</BlazorEnableTimeZoneSupport> |
||||
|
<BlazorWebAssemblyPreserveCollationData>false</BlazorWebAssemblyPreserveCollationData> |
||||
|
</PropertyGroup> |
||||
|
|
||||
|
<ItemGroup> |
||||
|
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.0-rc.1.22427.2" /> |
||||
|
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="7.0.0-rc.1.22427.2" PrivateAssets="all" /> |
||||
|
</ItemGroup> |
||||
|
|
||||
|
<ItemGroup> |
||||
|
<ProjectReference Include="..\..\src\Skia\Avalonia.Skia\Avalonia.Skia.csproj" /> |
||||
|
<ProjectReference Include="..\..\src\Web\Avalonia.Web.Blazor\Avalonia.Web.Blazor.csproj" /> |
||||
|
<ProjectReference Include="..\ControlCatalog\ControlCatalog.csproj" /> |
||||
|
</ItemGroup> |
||||
|
|
||||
|
<Import Project="..\..\build\ReferenceCoreLibraries.props" /> |
||||
|
<Import Project="..\..\build\BuildTargets.targets" /> |
||||
|
|
||||
|
<Import Project="..\..\src\Web\Avalonia.Web\Avalonia.Web.props" /> |
||||
|
<Import Project="..\..\src\Web\Avalonia.Web\Avalonia.Web.targets" /> |
||||
|
|
||||
|
</Project> |
||||
|
|
||||
@ -0,0 +1,29 @@ |
|||||
|
using System; |
||||
|
using System.Net.Http; |
||||
|
using System.Threading.Tasks; |
||||
|
using Microsoft.AspNetCore.Components.WebAssembly.Hosting; |
||||
|
using Microsoft.Extensions.DependencyInjection; |
||||
|
using ControlCatalog.Blazor.Web; |
||||
|
|
||||
|
public class Program |
||||
|
{ |
||||
|
public static async Task Main(string[] args) |
||||
|
{ |
||||
|
await CreateHostBuilder(args).Build().RunAsync(); |
||||
|
} |
||||
|
|
||||
|
public static WebAssemblyHostBuilder CreateHostBuilder(string[] args) |
||||
|
{ |
||||
|
var builder = WebAssemblyHostBuilder.CreateDefault(args); |
||||
|
|
||||
|
builder.RootComponents.Add<App>("#app"); |
||||
|
|
||||
|
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); |
||||
|
|
||||
|
return builder; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
Before Width: | Height: | Size: 172 KiB After Width: | Height: | Size: 172 KiB |
@ -1,7 +1,5 @@ |
|||||
using System; |
using System; |
||||
using System.Runtime.InteropServices.JavaScript; |
using System.Runtime.InteropServices.JavaScript; |
||||
|
|
||||
using Avalonia; |
|
||||
using Avalonia.Platform; |
using Avalonia.Platform; |
||||
using Avalonia.Web; |
using Avalonia.Web; |
||||
|
|
||||
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 172 KiB After Width: | Height: | Size: 172 KiB |
@ -1,41 +0,0 @@ |
|||||
<Project Sdk="Microsoft.NET.Sdk"> |
|
||||
<PropertyGroup> |
|
||||
<TargetFramework>net7.0</TargetFramework> |
|
||||
<RuntimeIdentifier>browser-wasm</RuntimeIdentifier> |
|
||||
<WasmMainJSPath>main.js</WasmMainJSPath> |
|
||||
<OutputType>Exe</OutputType> |
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> |
|
||||
<MSBuildEnableWorkloadResolver>true</MSBuildEnableWorkloadResolver> |
|
||||
<WasmBuildNative>true</WasmBuildNative> |
|
||||
<EmccFlags>-sVERBOSE -sERROR_ON_UNDEFINED_SYMBOLS=0</EmccFlags> |
|
||||
</PropertyGroup> |
|
||||
|
|
||||
<PropertyGroup Condition="'$(Configuration)'=='Release'"> |
|
||||
<RunAOTCompilation>true</RunAOTCompilation> |
|
||||
<PublishTrimmed>true</PublishTrimmed> |
|
||||
<TrimMode>full</TrimMode> |
|
||||
<WasmBuildNative>true</WasmBuildNative> |
|
||||
<InvariantGlobalization>true</InvariantGlobalization> |
|
||||
<WasmEnableSIMD>true</WasmEnableSIMD> |
|
||||
<EmccCompileOptimizationFlag>-O3</EmccCompileOptimizationFlag> |
|
||||
<EmccLinkOptimizationFlag>-O3</EmccLinkOptimizationFlag> |
|
||||
</PropertyGroup> |
|
||||
|
|
||||
<ItemGroup> |
|
||||
<ProjectReference Include="..\..\..\samples\ControlCatalog\ControlCatalog.csproj" /> |
|
||||
<ProjectReference Include="..\Avalonia.Web\Avalonia.Web.csproj" /> |
|
||||
<ProjectReference Include="..\..\..\src\Skia\Avalonia.Skia\Avalonia.Skia.csproj" /> |
|
||||
</ItemGroup> |
|
||||
|
|
||||
<ItemGroup> |
|
||||
<WasmExtraFilesToDeploy Include="index.html" /> |
|
||||
<WasmExtraFilesToDeploy Include="main.js" /> |
|
||||
<WasmExtraFilesToDeploy Include="embed.js" /> |
|
||||
<WasmExtraFilesToDeploy Include="favicon.ico" /> |
|
||||
<WasmExtraFilesToDeploy Include="Logo.svg" /> |
|
||||
<WasmExtraFilesToDeploy Include="app.css" /> |
|
||||
</ItemGroup> |
|
||||
|
|
||||
<Import Project="..\Avalonia.Web\Avalonia.Web.props" /> |
|
||||
<Import Project="..\Avalonia.Web\Avalonia.Web.targets" /> |
|
||||
</Project> |
|
||||
@ -1,19 +0,0 @@ |
|||||
using Avalonia; |
|
||||
using Avalonia.Web; |
|
||||
using ControlCatalog; |
|
||||
using ControlCatalog.Web; |
|
||||
|
|
||||
internal partial class Program |
|
||||
{ |
|
||||
private static void Main(string[] args) |
|
||||
{ |
|
||||
BuildAvaloniaApp() |
|
||||
.AfterSetup(_ => |
|
||||
{ |
|
||||
ControlCatalog.Pages.EmbedSample.Implementation = new EmbedSampleWeb(); |
|
||||
}).SetupBrowserApp("out"); |
|
||||
} |
|
||||
|
|
||||
public static AppBuilder BuildAvaloniaApp() |
|
||||
=> AppBuilder.Configure<App>(); |
|
||||
} |
|
||||
Loading…
Reference in new issue