Skip to content

Commit 5ce798b

Browse files
feat: allow injecting BlazorDesktopWindow
1 parent 1fa2a02 commit 5ce798b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,10 @@ In terms of handling things such as the close button, you can inject the Window
140140

141141
Here is an example changing `MainLayout.razor`:
142142
```razor
143-
@using System.Windows
143+
@using BlazorDesktop.Wpf
144144
145145
@inherits LayoutComponentBase
146-
@inject Window window
146+
@inject BlazorDesktopWindow window
147147
148148
<div class="page">
149149
<div class="sidebar">

src/BlazorDesktop/Hosting/BlazorDesktopHostBuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ private void InitializeDefaultServices()
123123
Services.AddWpfBlazorWebView();
124124
Services.AddSingleton<WebViewInstaller>();
125125
Services.AddSingleton<Application>();
126-
Services.AddSingleton<Window, BlazorDesktopWindow>();
126+
Services.AddSingleton<BlazorDesktopWindow>();
127127
Services.AddHostedService<BlazorDesktopService>();
128128
}
129129

0 commit comments

Comments
 (0)