Skip to content

Commit af4f55c

Browse files
authored
Blazor UE improvements (#18304)
1 parent 8f16e6f commit af4f55c

6 files changed

Lines changed: 59 additions & 36 deletions

File tree

aspnetcore/blazor/components.md

Lines changed: 51 additions & 30 deletions
Large diffs are not rendered by default.

aspnetcore/blazor/event-handling.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ It's often convenient to close over additional values, such as when iterating ov
125125
126126
## EventCallback
127127

128-
A common scenario with nested components is the desire to run a parent component's method when a child component event occurs—for example, when an `onclick` event occurs in the child. To expose events across components, use an `EventCallback`. A parent component can assign a callback method to a child component's `EventCallback`.
128+
A common scenario with nested components is the desire to run a parent component's method when a child component event occurs. An `onclick` event occurring in the child component is a common use case. To expose events across components, use an `EventCallback`. A parent component can assign a callback method to a child component's `EventCallback`.
129129

130130
The `ChildComponent` in the sample app (*Components/ChildComponent.razor*) demonstrates how a button's `onclick` handler is set up to receive an `EventCallback` delegate from the sample's `ParentComponent`. The `EventCallback` is typed with `MouseEventArgs`, which is appropriate for an `onclick` event from a peripheral device:
131131

aspnetcore/blazor/handle-errors.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ Blazor Server is a stateful framework. While users interact with an app, they ma
8181

8282
If a user opens the app in multiple browser tabs, they have multiple independent circuits.
8383

84-
Blazor treats most unhandled exceptions as fatal to the circuit where they occur. If a circuit is terminated due to an unhandled exception, the user can only continue to interact with the app by reloading the page to create a new circuit. Circuits outside of the one that's terminated, which are circuits for other users or other browser tabs, aren't affected. This scenario is similar to a desktop app that crashes—the crashed app must be restarted, but other apps aren't affected.
84+
Blazor treats most unhandled exceptions as fatal to the circuit where they occur. If a circuit is terminated due to an unhandled exception, the user can only continue to interact with the app by reloading the page to create a new circuit. Circuits outside of the one that's terminated, which are circuits for other users or other browser tabs, aren't affected. This scenario is similar to a desktop app that crashes. The crashed app must be restarted, but other apps aren't affected.
8585

8686
A circuit is terminated when an unhandled exception occurs for the following reasons:
8787

aspnetcore/blazor/layouts.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ uid: blazor/layouts
1313

1414
By [Rainer Stropek](https://www.timecockpit.com) and [Luke Latham](https://github.com/guardrex)
1515

16-
Some app elements, such as menus, copyright messages, and company logos, are usually part of app's overall layout and used by every component in the app. Copying the code of these elements into all of the components of an app isn't an efficient approach—every time one of the elements requires an update, every component must be updated. Such duplication is difficult to maintain and can lead to inconsistent content over time. *Layouts* solve this problem.
16+
Some app elements, such as menus, copyright messages, and company logos, are usually part of app's overall layout and used by every component in the app. Copying the code of these elements into all of the components of an app isn't an efficient approach. Every time one of the elements requires an update, every component must be updated. Such duplication is difficult to maintain and can lead to inconsistent content over time. *Layouts* solve this problem.
1717

1818
Technically, a layout is just another component. A layout is defined in a Razor template or in C# code and can use [data binding](xref:blazor/data-binding), [dependency injection](xref:blazor/dependency-injection), and other component scenarios.
1919

aspnetcore/blazor/state-management.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Blazor Server is a stateful app framework. Most of the time, the app maintains a
1919

2020
Examples of state held for a user's circuit include:
2121

22-
* The rendered UI—the hierarchy of component instances and their most recent render output.
22+
* The rendered UI: The hierarchy of component instances and their most recent render output.
2323
* The values of any fields and properties in component instances.
2424
* Data held in [dependency injection (DI)](xref:fundamentals/dependency-injection) service instances that are scoped to the circuit.
2525

@@ -45,7 +45,7 @@ In some scenarios, preserving state across circuits is desirable. An app can ret
4545

4646
In general, maintaining state across circuits applies to scenarios where users are actively creating data, not simply reading data that already exists.
4747

48-
To preserve state beyond a single circuit, *don't merely store the data in the server's memory*. The app must persist the data to some other storage location. State persistence isn't automatic—you must take steps when developing the app to implement stateful data persistence.
48+
To preserve state beyond a single circuit, *don't merely store the data in the server's memory*. The app must persist the data to some other storage location. State persistence isn't automatic. You must take steps when developing the app to implement stateful data persistence.
4949

5050
Data persistence is typically only required for high-value state that users have expended effort to create. In the following examples, persisting state either saves time or aids in commercial activities:
5151

@@ -88,7 +88,7 @@ For transient data representing navigation state, model the data as a part of th
8888
The contents of the browser's address bar are retained:
8989

9090
* If the user manually reloads the page.
91-
* If the web server becomes unavailable—the user is forced to reload the page in order to connect to a different server.
91+
* If the web server becomes unavailable, and the user is forced to reload the page in order to connect to a different server.
9292

9393
For information on defining URL patterns with the `@page` directive, see <xref:blazor/routing>.
9494

aspnetcore/mvc/views/razor.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,8 @@ In [Razor components](xref:blazor/components), `@using` also controls which comp
704704

705705
## Directive attributes
706706

707+
Razor directive attributes are represented by implicit expressions with reserved keywords following the `@` symbol. A directive attribute typically changes the way an element is parsed or enables different functionality.
708+
707709
### \@attributes
708710

709711
*This scenario only applies to Razor components (.razor).*

0 commit comments

Comments
 (0)