Skip to content

Unify RepeatDirection to use DataListEnum for simplified enum binding#326

Merged
csharpfritz merged 3 commits intodevfrom
copilot/simplify-enum-references
Jan 31, 2026
Merged

Unify RepeatDirection to use DataListEnum for simplified enum binding#326
csharpfritz merged 3 commits intodevfrom
copilot/simplify-enum-references

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 31, 2026

Problem

RepeatDirection was implemented as a standard enum while GridLines used the DataListEnum class hierarchy pattern. Both types have Horizontal and Vertical values in the same namespace, causing ambiguity that forced verbose qualified syntax:

GridLines="Enums.GridLines.Horizontal"
RepeatDirection="Enums.RepeatDirection.Horizontal"

This inconsistency created friction for Web Forms migration and deviated from the simpler markup patterns used elsewhere.

Changes

Unified parameter types

  • RadioButtonList.RepeatDirection now uses DataListEnum (matching DataList and CheckBoxList)
  • All three list components now share the same enum pattern for RepeatDirection

Removed duplicate enum

  • Deleted RepeatDirection class hierarchy from Enums/RepeatDirection.cs
  • Only DataListEnum remains, serving both GridLines and RepeatDirection

Updated comparison logic

  • Changed from is VerticalRepeatDirection to == DataListEnum.Vertical
  • Consistent with DataList's existing pattern

Result

Clean, unqualified syntax now works across all components:

<!-- Before -->
<RadioButtonList RepeatDirection="RepeatDirection.Horizontal" ... />
<DataList GridLines="Both" RepeatDirection="DataListEnum.Vertical" ... />

<!-- After -->
<RadioButtonList RepeatDirection="Horizontal" ... />
<DataList GridLines="Both" RepeatDirection="Vertical" ... />

Screenshots

RadioButtonList with horizontal and vertical layouts using simplified syntax:

RadioButtonList horizontal layout

RadioButtonList vertical layout

Original prompt

This section details on the original issue you should resolve

<issue_title>Attribute Value Conflicts</issue_title>
<issue_description>from @grleachman in #21

Attribute Value Conflicts

Adding RepeatDirection has caused a conflict with GridLines

There's now an ugly problem where the static enums require the markup to be messy:

Gridlines="Enums.GridLines.Horizontal"
RepeatDirection="Enums.RepeatDirection.Horizontal"

This is going to be painful for migration.</issue_description>

<agent_instructions>Investigate.. I want to simplify the references to the enums as much as possible so that developers don't need to include a bunch of using statements. </agent_instructions>

Comments on the Issue (you are @copilot in this section)

@csharpfritz There are other features we need to these enums and by taking this approach we get pattern matching to check if the enum is selected

Jeff

On Feb 23, 2020, at 16:07, Hisham Bin Ateya notifications@github.com wrote:


Is there a reason to declare enum as abstract class?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits January 31, 2026 15:26
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] Fix attribute value conflicts with enums Unify RepeatDirection to use DataListEnum for simplified enum binding Jan 31, 2026
Copilot AI requested a review from csharpfritz January 31, 2026 15:35
@csharpfritz csharpfritz marked this pull request as ready for review January 31, 2026 15:37
@csharpfritz csharpfritz merged commit 8e555f1 into dev Jan 31, 2026
4 checks passed
@csharpfritz csharpfritz deleted the copilot/simplify-enum-references branch January 31, 2026 15:40
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.

Attribute Value Conflicts

2 participants