-
Notifications
You must be signed in to change notification settings - Fork 72
Conversation
BlazorWebFormsComponents uses static classes for enumeration types, requiring verbose fully-qualified names in markup. This adds a VSIX extension to provide code snippets for static imports and common component patterns.
Changes
New Project: BlazorWebFormsComponents.Snippets
- VSIX extension targeting VS 2022 (17.0+)
- Contains 13 snippets with
.pkgdefregistration for Razor/C#/HTML contexts
Static Import Snippets
Enable concise enumeration usage:
bwfall- All common enum static importsbwfrepeat-RepeatLayoutbwfdatalist-DataListEnumbwfvalidation- Validation enums
Component Pattern Snippets
Templates with tab-navigable placeholders:
- Data controls:
bwfgridview,bwfdl,bwfrepeater,bwfformview - Form controls:
bwfbutton,bwftextbox,bwfcheckboxlist - Validation:
bwfrequired,bwfvalsummary
All snippets use correct generic parameter names (ItemType for most components, TItem for CheckBoxList).
Documentation
docs/UtilityFeatures/Snippets.md- Usage guide and snippet reference- Updated
mkdocs.ymlandREADME.mdwith snippets section
Example
Before (verbose):
RepeatDirection="BlazorWebFormsComponents.Enums.DataListEnum.Horizontal">
After (with bwfall snippet + static imports):
@using static BlazorWebFormsComponents.Enums.DataListEnum
<DataList RepeatLayout="Table" RepeatDirection="Horizontal">
Original prompt
This section details on the original issue you should resolve
Create a Snippet package
Suggestion to publish a Snippet package for the static imports to anabe phau enumeration types as well as other useful markup snippets. Another option may be an extension or project templates
Comments on the Issue (you are @copilot in this section)
@csharpfritz Coming back to this and getting some Copilot assistance. This is a good idea
You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.