Skip to content

Commit a12b7a1

Browse files
chore: update readme
1 parent 6a7a7e1 commit a12b7a1

File tree

1 file changed

+9
-19
lines changed

1 file changed

+9
-19
lines changed

README.md

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# Blazor Desktop
66
Blazor Desktop allows you to create desktop apps using Blazor. Apps run inside of a .NET generic host with a WPF window thats fully managed using a similar template to Blazor WASM.
7-
![app](https://user-images.githubusercontent.com/2308261/212734109-a405ebe1-bd39-495b-b663-b8522b88f36c.png)
7+
![preview](https://github.com/DotNetExtension/BlazorDesktop/assets/2308261/7d025b49-e2f8-4b07-a57d-35f9a319d859)
88

99
# Getting Started
1010
The easiest way to get started with Blazor Desktop is to install the templates, you can do so using the dotnet cli as follows:
@@ -14,7 +14,7 @@ dotnet new install BlazorDesktop.Templates::8.0.0
1414
```
1515

1616
Once you have the templates installed, you can either create a new project from the template either in Visual Studio in the template picker:
17-
![desktop](https://user-images.githubusercontent.com/2308261/153132853-5430710e-a4d7-434d-a46c-1269b9865711.png)
17+
![create](https://github.com/DotNetExtension/BlazorDesktop/assets/2308261/5ac50c95-9b90-4d5f-bb4f-7aa8a242d823)
1818

1919
Or, you can create a new project using the cli as follows:
2020
```powershell
@@ -26,19 +26,14 @@ The Blazor Desktop template is set up very similar to the Blazor WASM template,
2626

2727
```csharp
2828
using BlazorDesktop.Hosting;
29-
using HelloWorld;
30-
using HelloWorld.Data;
29+
using HelloWorld.Components;
3130
using Microsoft.AspNetCore.Components.Web;
3231

3332
var builder = BlazorDesktopHostBuilder.CreateDefault(args);
3433

35-
builder.UseWebViewInstaller();
36-
37-
builder.RootComponents.Add<App>("#app");
34+
builder.RootComponents.Add<Routes>("#app");
3835
builder.RootComponents.Add<HeadOutlet>("head::after");
3936

40-
builder.Services.AddSingleton<WeatherForecastService>();
41-
4237
if (builder.HostEnvironment.IsDevelopment())
4338
{
4439
builder.UseDeveloperTools();
@@ -65,7 +60,7 @@ builder.Window
6560
.UseWidth(1920)
6661
.UseHeight(1080)
6762
.UseMinWidth(1280)
68-
.UseMinHeight(720);
63+
.UseMinHeight(720)
6964
.UseMaxWidth(2560)
7065
.UseMaxHeight(1440);
7166
```
@@ -102,17 +97,13 @@ It is also possible to configure these values through `appsettings.json` like so
10297
},
10398
"Logging": {
10499
"LogLevel": {
105-
"Default": "Information"
100+
"Default": "Information",
101+
"Microsoft.AspNetCore": "Warning"
106102
}
107103
}
108104
}
109105
```
110106

111-
Blazor Desktop will automatically install a web view runtime for the user if they do not already have it installed, you can disable this if you wish:
112-
```csharp
113-
builder.UseWebViewInstaller(false);
114-
```
115-
116107
**The `Window` object itself is also made available inside of the DI container, so you can access all properties on it by using the inject Razor keyword or requesting it through the constructor of a class added as a service.**
117108

118109
## Custom Window Chrome & Draggable Regions
@@ -134,7 +125,7 @@ Using the base template, if you were to edit `MainLayout.razor` and add a `-webk
134125
135126
<main>
136127
<div class="top-row px-4" style="-webkit-app-region: drag;">
137-
<a href="https://docs.microsoft.com/aspnet/" target="_blank">About</a>
128+
<a href="https://learn.microsoft.com/aspnet/core/" target="_blank">About</a>
138129
</div>
139130
140131
<article class="content px-4">
@@ -161,11 +152,10 @@ Here is an example changing `MainLayout.razor`:
161152
162153
<main>
163154
<div class="top-row px-4" style="-webkit-app-region: drag;">
164-
<a href="https://docs.microsoft.com/aspnet/" target="_blank">About</a>
155+
<a href="https://learn.microsoft.com/aspnet/core/" target="_blank">About</a>
165156
</div>
166157
167158
<article class="content px-4">
168-
<button @onclick="CloseWindow">Close Window</button>
169159
@Body
170160
</article>
171161
</main>

0 commit comments

Comments
 (0)