Skip to content

Conversation

w-ahmad
Copy link
Owner

@w-ahmad w-ahmad commented Oct 16, 2025

PR Summary

This pull request introduces row details functionality, refactors row layout handling, and replaces TableViewCellsPresenter with TableViewRowPresenter for better customization and maintainability.

New Properties

  • RowDetailsVisibilityMode: Gets or sets the visibility mode of the row details.
  • RowDetailsTemplate: Gets or sets the data template for the row details.
  • RowDetailsTemplateSelector: Gets or sets the data template selector for the row details.
  • AreRowDetailsFrozen: Gets or sets a value indicating whether the row details are frozen during horizontal scrolling.

Row Details Visibility Mode

  • Collapsed: Row details are never displayed.
  • Visible: Row details are always displayed for all rows.
  • VisibleWhenSelected: Row details are displayed only for the selected row or rows.
  • VisibleWhenExpanded: default Row details are displayed only when the user expands a row using the toggle button in the row header.

Breaking Change

  • Renamed CellsPresenter to TableViewRowPresenter to manage row-specific layout, animations, and row details.

Example Usage

<tv:TableView ItemsSource="{Binding Items}"
              RowDetailsVisibilityMode="VisibleWhenExpanded">
    <tv:TableView.RowDetailsTemplate>
        <DataTemplate x:DataType="local:ExampleModel">
            <StackPanel Orientation="Horizontal"
                        Spacing="12">
                <PersonPicture ProfilePicture="{Binding Avatar}" />
                <StackPanel Spacing="8"
                            Margin="0,8">
                    <TextBlock>
                        <Run Text="Id:" FontWeight="Bold" />
                        <Run Text="{Binding Id}" />
                    </TextBlock>
                    <TextBlock>
                        <Run Text="FirstName:" FontWeight="Bold" />
                        <Run Text="{Binding FirstName}" />
                    </TextBlock>
                    <TextBlock>
                        <Run Text="LastName:" FontWeight="Bold" />
                        <Run Text="{Binding LastName}" />
                    </TextBlock>
                    <TextBlock>
                        <Run Text="Designation:" FontWeight="Bold" />
                        <Run Text="{Binding Designation}" />
                    </TextBlock>
                </StackPanel>
            </StackPanel>
        </DataTemplate>
    </tv:TableView.RowDetailsTemplate>
</tv:TableView>
Recording.2025-10-16.162829.mp4

@w-ahmad w-ahmad marked this pull request as ready for review October 16, 2025 11:31
@w-ahmad w-ahmad requested a review from Copilot October 17, 2025 13:20
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Introduces row details support for TableView, refactors row layout from CellsPresenter to a new TableViewRowPresenter, and adds properties to control row details visibility and templating.

  • Replace TableViewCellsPresenter with TableViewRowPresenter and update templates
  • Add RowDetailsVisibilityMode, RowDetailsTemplate, and RowDetailsTemplateSelector
  • Implement visual states and toggle button for expandable row details

Reviewed Changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 12 comments.

Show a summary per file
File Description
src/VisualStates.cs Adds visual state names/groups for row details and details button.
src/Themes/TableViewRowPresenter.xaml New control template for row with header, cells, and details area, plus VisualStates.
src/Themes/TableViewRow.xaml Switch item template root to custom ListViewItemPresenter; adjust MinHeight.
src/Themes/TableViewHeaderRow.xaml Adjust corner button panel and grid lines; bind width to new CellsHorizontalOffset.
src/Themes/TableViewCellsPresenter.xaml Remove legacy CellsPresenter template.
src/Themes/TableView.xaml Use TableViewRowPresenter in item template; rename attached property usage.
src/Themes/Resources.xaml Add row details resources and toggle button style with animated chevron.
src/Themes/Generic.xaml Replace CellsPresenter resource with RowPresenter resource and style.
src/TableViewRowPresenter.cs New control managing row header, cells, details layout, and states.
src/TableViewRowHeader.cs Update sizing and gridline height logic.
src/TableViewRowDetailsVisibilityMode.cs New enum for row details visibility control.
src/TableViewRow.cs Integrate with RowPresenter, adjust selection visuals and layout.
src/TableViewHeaderRow.cs Bind corner panel width to cell offset; refine gridline visibility logic.
src/TableViewCell.cs Adjust measuring logic and gridline height calculation.
src/TableView.cs Wire up new presenter, update helper usage, and row details/template propagation.
src/TableView.Properties.cs Add DPs for row details and CellsHorizontalOffset, with change handlers.
src/Primitives/ListViewItemPresenter.cs Custom presenter arranges TableViewRowPresenter height.
src/Helpers/AttachedPropertiesHelper.cs Rename/relocate attached property helper for scrollbar spacing.

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

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.

1 participant