Thank you for contributing to HAVIT Blazor and making it even better. We are happy about every contribution! Issues, fixes, enahncements, new components...
- Align with official C# Coding Conventions and Framework Design Guidelines
- Respect our
.editorconfig
requirements (you can suggest changing them).
- Preserve original Bootstrap naming whenever possible (adjust to comply with .NET coding standards).
- Follow existing Blazor naming whenever possible.
- Prefix all event parameters with
On
, e.g.OnClosed
,OnShown
,OnFileUploaded
(exceptXyChanged
callbacks). - Suffix all
RenderFragment
-parameters withTemplate
(except very specific cases such asHxGrid.Columns
), e.g.HeaderTemplate
,ItemTemplate
,FooterTemplate
. - Suffix all
Func
-parameters returning a projection withSelector
, e.g.TextSelector
,CssClassSelector
,ValueSelector
. SeeHxSelect
for samples.
- Prefer ease of user over complex functionality.
- Allow interception of the events in derived components by using the virtual
InvokeOnEventNameAsync()
methods
[Parameter] public EventCallback OnClosed { get; set; }
protected virtual Task InvokeOnClosedAsync() => OnClosed.InvokeAsync();
- Allow setting application-wide defaults by using the
Defaults
static property. Allow extension of the defaults in derived components by using theGetDefaults()
virtual method.
public static ComponentNameSettings Defaults { get; set; } = new();
protected virtual ComponentNameSettings GetDefaults() => Defaults;
- Use CSS variables whenever possible. Prefer existing variables over creating new ones (use derived values if possible).
- Provide
/// <summary>
comments (extracted to API documentation). - Create simple demos presenting individual features. Bootstrap docs might be inspiration for you.