$ show RWS/Multiselect-ComboBox
This repository provides a WPF custom control library, Sdl.MultiSelectComboBox, which is a fully-featured multi-select combo box with support for item selection, grouping, sorting, filtering, autocomplete, and suggestion providers. The library includes a set of well-defined interfaces (IFilterService, IAutoCompleteService, ISuggestionProvider, IItemGroup, IItemEnabledAware) that allow developers to plug in custom logic. The main control class (MultiSelectComboBox) is a large, self-contained WPF custom control that handles all UI interactions, including keyboard and mouse input, popup management, and visual state management. The codebase also includes a reusable event behaviour factory for attaching commands to routed events, visual tree helper utilities, and a theme manager for dynamic resource switching. The example project demonstrates a realistic usage scenario with a language selection UI, flag icons, and multiple configuration options. The code is well-structured and follows MVVM patterns, though the core control is monolithic due to the nature of WPF custom control development. The library is published as a NuGet package and targets .NET 4.8 and .NET 6.0 (Windows).
The LLM identified 2 files worth highlighting for reuse:
Provides a generic factory for creating attached dependency properties that bind a command to any routed event. This is a reusable pattern for WPF MVVM applications, allowing developers to avoid code-behind event handlers by declaratively binding commands to events. The internal ExecuteCommandOnRoutedEventBehaviour class handles attaching/detaching event handlers based on the command's presence. This component can be extracted and used in any WPF project.
A static utility class that provides generic methods for traversing the WPF visual tree: FindVisualChild (searches by type and optional name) and FindVisualTemplatedParent (walks up the templated parent chain). This is a common requirement in WPF custom control development, and this implementation is clean, recursive, and handles both regular and templated parents. It can be reused in any WPF project that needs to locate elements within a visual tree.