Files
DP44/docs/ai/DataPRO/Modules/Groups/GroupList/View.md
2026-04-17 14:55:32 -04:00

2.3 KiB

source_files, generated_at, model, schema_version, sha256
source_files generated_at model schema_version sha256
DataPRO/Modules/Groups/GroupList/View/GroupListView.xaml.cs
2026-04-17T16:47:04.094415+00:00 zai-org/GLM-5-FP8 1 1c720369523e38e0

GroupListView Documentation

1. Purpose

GroupListView is a WPF view component that provides a sortable, filterable list interface for displaying groups. It serves as the code-behind for GroupListView.xaml and implements IGroupListView. The view handles user interactions—column header clicks for sorting, search input for filtering, and mouse double-clicks for item selection—delegating all business logic to an IGroupListViewModel via the DataContext.


2. Public Interface

GroupListView() (Constructor)

Signature: public GroupListView()

Initializes the view component by calling InitializeComponent(), which loads the associated XAML layout.

IGroupListView (Implemented Interface)

The class implements IGroupListView from DTS.Common.Interface.Groups.GroupTemplateList. The specific interface members are not visible in this source file.

Private Event Handlers (wired to XAML events)

Method Signature Behavior
ListViewHeader_Click void ListViewHeader_Click(object sender, RoutedEventArgs e) Extracts the clicked GridViewColumnHeader from e.OriginalSource, retrieves IGroupListViewModel from the header's DataContext, and calls viewModel.Sort(colHeader.Tag, true).
GridViewColumnHeaderSearchable_OnSearch void GridViewColumnHeaderSearchable_OnSearch(object sender, RoutedEventArgs e) Extracts search term from e.OriginalSource (cast to string), retrieves column tag from sender, and calls vm.Filter(columnTag, searchTerm) on the view model.
GridViewColumnHeader_OnClick void GridViewColumnHeader_OnClick(object sender, RoutedEventArgs e) Handles sorting for searchable column headers. Retrieves column tag either directly from sender or by traversing the visual tree via Utils.FindChild<GridViewColumnHeaderSearchable>, then calls vm.Sort(columnTag, true).
MouseDoubleClick void MouseDoubleClick(object sender, MouseButtonEventArgs e) Determines which ListView item is under the mouse cursor using hit-testing, validates the index is within bounds, and