Skip to content

Add internal methods in DataColumn#786

Open
9rnsr wants to merge 2 commits intoCommunityToolkit:mainfrom
9rnsr:ImproveDataTable-4
Open

Add internal methods in DataColumn#786
9rnsr wants to merge 2 commits intoCommunityToolkit:mainfrom
9rnsr:ImproveDataTable-4

Conversation

@9rnsr
Copy link
Copy Markdown
Contributor

@9rnsr 9rnsr commented Feb 24, 2026

Separate PR from #781

Currently there are three DataColumn types for the layout logic. I'll add two more types for later improvement.

@9rnsr 9rnsr force-pushed the ImproveDataTable-4 branch from 189d772 to 479420d Compare April 25, 2026 00:36

private WeakReference<DataTable>? _parent;

internal DataTable? DataTable => _parent?.TryGetTarget(out DataTable? parent) == true ? parent : null;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
internal DataTable? DataTable => _parent?.TryGetTarget(out DataTable? parent) == true ? parent : null;
//// Pass-thru convenience helper to get reference from WeakReference; computed each time, do not store result!
private DataTable? DataTable => _parent?.TryGetTarget(out DataTable? parent) == true ? parent : null;

Does this need to be internal? I'm a little leery of exposing the reference. I was trying to see where in #781 it was used, but it's been a bit hard to follow.

Should the other properties below be public though to help others understand the current mode of the control for IsAbsolute, IsAuto, and IsStar.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You’re absolutely right. Since this DataTable property is only used internally within the DataColumn class, it can be made private. I’ll update it accordingly.

As for IsAbsolute, IsAuto, and IsStar, making those properties public would certainly make the current mode of the control easier to understand. However, doing so would also mean adding new public interfaces, which I wanted to avoid.

@9rnsr 9rnsr force-pushed the ImproveDataTable-4 branch from 479420d to 9f56bf8 Compare April 29, 2026 03:11
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.

2 participants