Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
danielchalmers committed Mar 24, 2024
1 parent 9a0cff1 commit c5a18c3
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 18 deletions.
4 changes: 3 additions & 1 deletion src/TryMudBlazor.Client/App.razor
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<Router AppAssembly="@typeof(Program).Assembly"
AdditionalAssemblies="@(new List<System.Reflection.Assembly> { typeof(Try.UserComponents.__Main).Assembly })">
AdditionalAssemblies="@(new List<System.Reflection.Assembly> { typeof(Try.UserComponents.__Main).Assembly })"
@rendermode="new InteractiveWebAssemblyRenderMode(prerender: false)">
<Found Context="routeData">
<RouteView RouteData="@routeData" DefaultLayout="@typeof(EmptyLayout)" />
</Found>
Expand All @@ -9,3 +10,4 @@
</LayoutView>
</NotFound>
</Router>
@* <HeadOutlet @rendermode="new InteractiveWebAssemblyRenderMode(prerender: false)"/> *@
7 changes: 2 additions & 5 deletions src/TryMudBlazor.Client/Pages/Index/Index.razor
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
@page "/"


<MudLayout Class="try-mudblazor-index">
<MudAppBar Color="Color.Transparent" Fixed="false" Elevation="0">
<div class="brand">Try<span>MudBlazor</span></div>
<MudSpacer />
<MudButton Link="https://mudblazor.com/" Color="Color.Default" Size="Size.Large">MudBlazor</MudButton>
<MudButton Link="https://github.com/MudBlazor/TryMudBlazor" Color="Color.Primary" Size="Size.Large">Source Code</MudButton>
<MudButton Href="https://mudblazor.com/" Color="Color.Default" Size="Size.Large">MudBlazor</MudButton>
<MudButton Href="https://github.com/MudBlazor/TryMudBlazor" Color="Color.Primary" Size="Size.Large">Source Code</MudButton>
</MudAppBar>
<MudMainContent>
<MudContainer Class="my-16" MaxWidth="MaxWidth.Large">
Expand Down Expand Up @@ -152,8 +151,6 @@
</MudMainContent>
</MudLayout>



@code {
string Version { get { var v = typeof(MudText).Assembly.GetName().Version; return $"v{v.Major}.{v.Minor}.{v.Build}"; } }
}
4 changes: 2 additions & 2 deletions src/TryMudBlazor.Client/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ namespace TryMudBlazor.Client
using Microsoft.AspNetCore.Components.WebAssembly.Services;
using Microsoft.AspNetCore.Components.Web;

public class Program
public static class Program
{
public static async Task Main(string[] args)
{
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("#app");
builder.RootComponents.Add<HeadOutlet>("head::after");
//builder.RootComponents.Add<HeadOutlet>("head::after");

builder.Services.AddSingleton(serviceProvider => (IJSInProcessRuntime)serviceProvider.GetRequiredService<IJSRuntime>());
builder.Services.AddSingleton(serviceProvider => (IJSUnmarshalledRuntime)serviceProvider.GetRequiredService<IJSRuntime>());
Expand Down
6 changes: 0 additions & 6 deletions src/TryMudBlazor.Client/Routes.razor

This file was deleted.

10 changes: 6 additions & 4 deletions src/TryMudBlazor.Server/Program.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
using Microsoft.AspNetCore.Builder;
using MudBlazor.Examples.Data;
using TryMudBlazor.Client;
using TryMudBlazor.Client.Shared;

var builder = WebApplication.CreateBuilder(args);

// Add services to the container.
builder.Services.AddRazorComponents()
.AddInteractiveServerComponents();
//.AddInteractiveServerComponents()
.AddInteractiveWebAssemblyComponents();

builder.Services.AddScoped<IPeriodicTableService, PeriodicTableService>();
builder.Services.AddCors(options =>
Expand Down Expand Up @@ -52,7 +53,8 @@
app.UseAntiforgery();

app.MapRazorComponents<App>()
.AddInteractiveServerRenderMode();
//.AddAdditionalAssemblies([typeof(MainLayout).Assembly]);
//.AddInteractiveServerRenderMode()
.AddInteractiveWebAssemblyRenderMode();
//.AddAdditionalAssemblies(typeof(MainLayout).Assembly);

app.Run();
2 changes: 2 additions & 0 deletions src/UserComponents/__Main.razor
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
@page "/__main"
@rendermode @(new InteractiveWebAssemblyRenderMode(prerender: false))

@namespace Try.UserComponents
@using Microsoft.AspNetCore.Components.Web
@*This serves as a stub, which is then replaced with the user's components on the fly*@

0 comments on commit c5a18c3

Please sign in to comment.