Skip to content

Commit

Permalink
inject correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
kuzmins-85 committed Sep 7, 2024
1 parent 8d7405e commit 497549f
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions samples/WebAssembly/Shared/MainLayout.razor
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@using MudBlazor.Markdown.Core.Services
@inherits LayoutComponentBase
@inject IThemeService ThemeService

<MudLayout>
<MudAppBar Fixed="true" Elevation="5">
Expand All @@ -19,14 +20,8 @@

@code
{
[Inject]
private IThemeService? ThemeService { get; init; }

private async Task ToggleThemeAsync()
{
if (ThemeService == null)
return;

await ThemeService.ToggleThemeAsync()
.ConfigureAwait(false);
}
Expand Down

0 comments on commit 497549f

Please sign in to comment.