--- source_files: - DataPRO/Modules/Groups/GroupList/View/GroupListView.xaml.cs generated_at: "2026-04-17T16:47:04.094415+00:00" model: "zai-org/GLM-5-FP8" schema_version: 1 sha256: "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`, 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