Skip to content

Conversation

w-ahmad
Copy link
Owner

@w-ahmad w-ahmad commented Aug 10, 2025

Closes #20

This PR improves TableViewColumnsCollection to work with XAMLHot Reload by inheriting from DependencyObjectCollection. A new interface ITableViewColumnsCollection is added to use as a contract for the TableViewColumnsCollection, it is necessary to force the InteliSence to only show TableViewColumns when adding columns from the XAML.

Here is the new implementation:

// Interface with some other properties like 'TableView', 'VisibleColumns'
public interface ITableViewColumnsCollection : IList<TableViewColumn>, INotifyCollectionChanged {  }

// Implementation
public partial class TableViewColumnsCollection : DependencyObjectCollection, ITableViewColumnsCollection {  }

// Actual Columns property in TableView
public ITableViewColumnsCollection Columns { get; }

Limitations:

It seems that WinUI3 cannot update properties of type Binding with XAML hot reload, so the TableViewBoundColumn.Binding property won't reflect any changes made in XAML.

@w-ahmad
Copy link
Owner Author

w-ahmad commented Aug 13, 2025

Thank you so much @michael-hawker for your support to make this happen. Just a small hickup, the Binding properties of the columns are not useful through the Xaml editor due to a bug in WinUI3.

microsoft/microsoft-ui-xaml#10719

@w-ahmad w-ahmad merged commit 916cd9b into main Aug 14, 2025
1 check passed
@w-ahmad w-ahmad deleted the columns_collection branch August 14, 2025 20:23
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.

XAML Hot Reload Support
1 participant