Skip to content

Commit

Permalink
feat: allow injecting BlazorDesktopWindow
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewBabbitt97 committed Jul 25, 2024
1 parent 1fa2a02 commit 5ce798b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,10 @@ In terms of handling things such as the close button, you can inject the Window

Here is an example changing `MainLayout.razor`:
```razor
@using System.Windows
@using BlazorDesktop.Wpf
@inherits LayoutComponentBase
@inject Window window
@inject BlazorDesktopWindow window
<div class="page">
<div class="sidebar">
Expand Down
2 changes: 1 addition & 1 deletion src/BlazorDesktop/Hosting/BlazorDesktopHostBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ private void InitializeDefaultServices()
Services.AddWpfBlazorWebView();
Services.AddSingleton<WebViewInstaller>();
Services.AddSingleton<Application>();
Services.AddSingleton<Window, BlazorDesktopWindow>();
Services.AddSingleton<BlazorDesktopWindow>();
Services.AddHostedService<BlazorDesktopService>();
}

Expand Down

0 comments on commit 5ce798b

Please sign in to comment.