Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 29, 2026

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 .pkgdef registration for Razor/C#/HTML contexts

Static Import Snippets

Enable concise enumeration usage:

  • bwfall - All common enum static imports
  • bwfrepeat - RepeatLayout
  • bwfdatalist - DataListEnum
  • bwfvalidation - 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.yml and README.md with snippets section

Example

Before (verbose):

<DataList RepeatLayout="BlazorWebFormsComponents.Enums.RepeatLayout.Table" 
          RepeatDirection="BlazorWebFormsComponents.Enums.DataListEnum.Horizontal">

After (with bwfall snippet + static imports):

@using static BlazorWebFormsComponents.Enums.RepeatLayout
@using static BlazorWebFormsComponents.Enums.DataListEnum

<DataList RepeatLayout="Table" RepeatDirection="Horizontal">
Original prompt

This section details on the original issue you should resolve

<issue_title>Create a Snippet package</issue_title>
<issue_description>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</issue_description>

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.

Copilot AI and others added 2 commits January 29, 2026 20:27
Co-authored-by: csharpfritz <78577+csharpfritz@users.noreply.github.com>
Co-authored-by: csharpfritz <78577+csharpfritz@users.noreply.github.com>
Copilot AI changed the title [WIP] Add Snippet package for static imports and markup Add Visual Studio snippets extension for static imports and component patterns Jan 29, 2026
Copilot AI requested a review from csharpfritz January 29, 2026 20:34
@csharpfritz csharpfritz marked this pull request as ready for review January 29, 2026 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create a Snippet package

2 participants