This module provides a WPF view component (ExtraPropertiesListView) for displaying, editing, sorting, and filtering a list of "extra properties" (key-value pairs) in an ISO-related context. It serves as the code-behind for an XAML user control, mediating user interactions (clicks, text changes, selection) to a view model and handling visual tree hit-testing for column header interactions.
Public Interface
ExtraPropertiesListView() (Constructor)
Initializes the component by calling InitializeComponent().
Extracts a search term from e.OriginalSource (as string) and a column tag from the sender. Calls viewModel.Filter(columnTag, searchTerm) on the IExtraPropertiesListViewModel DataContext.
Performs multiple hit-tests using VisualTreeHelper.HitTest and InputHitTest. Handles sorting when clicking on KeyColumnHeader or ValueColumnHeader (or their descendant TextBlocks). Ignores clicks on ScrollViewer.
Invariants
The DataContext must be castable to IExtraPropertiesListViewModel for most operations; handlers early-return if not.
Items in the ListView must implement IExtraProperty for selection handling.
The view expects GridViewColumnHeaderSearchable controls with Tag properties for column identification.
KeyColumnHeader and ValueColumnHeader are named XAML elements that must exist.
ExtraProperties.Resources.StringResources (localized strings for "Key" and "Value")
Depended on by: Unclear from source alone; likely consumed by ISO module views.
Gotchas
The Validate method is called with two throwaway List<string> instances (notUsed1, notUsed2) that are never examined. The validation results are discarded, which may indicate incomplete error handling or a side-effect-based validation pattern.
Multiple hit-tests are required in ExtraPropertiesListView_PreviewMouseLeftButtonUp due to visual tree complexity (borders, rectangles). This is fragile and may break with template changes.
The handler casts DataContext to the concrete ExtraPropertiesListViewModel in text/keydown handlers, but to the interface IExtraPropertiesListViewModel elsewhere—inconsistent pattern.