dotnet / docs

This repository contains .NET Documentation.
https://learn.microsoft.com/dotnet
Creative Commons Attribution 4.0 International
4.26k stars 5.89k forks source link

Code-Behind Syntax #20877

Open mysteryx93 opened 4 years ago

mysteryx93 commented 4 years ago

2 little details on that page. For code-behind, it recommends to add "Base" to the code-behind file and use @inherit.

By doing so, whenever we use the component and type <MyComponent, it appears double, the base class and the actual class.

It should mention that you can have the code-behind with the same name (without Base), mark it as "partial", and you no longer need @inherit, and it connects the file correctly. This avoids having double-components in the list.

Also for Event Handlers, it could be good to mention that @on... syntax is only for built-in events, and that custom events do not use that syntax. Should custom events start with "On" by convention or not? The syntax is

<MyComponent Processing="Component_Processing" />

Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

danroth27 commented 4 years ago

It sounds like the content wasn't updated after we added partial class support and is using the old base class model for code-behind files.