--- source_files: - DTS Viewer/DTS.Viewer/RegionAdapters/StackPanelRegionAdapter.cs generated_at: "2026-04-17T16:13:40.918650+00:00" model: "zai-org/GLM-5-FP8" schema_version: 1 sha256: "02157f0db2bb8b54" --- # RegionAdapters ### Purpose This module provides a custom Prism Region Adapter for `StackPanel` controls, enabling the Prism region management system to dynamically add and remove UI elements within a `StackPanel`. It bridges the gap between Prism's region architecture and WPF's `StackPanel` container, allowing views to be composed dynamically at runtime. ### Public Interface - **`StackPanelRegionAdapter(IRegionBehaviorFactory regionBehaviorFactory)`** (Constructor) - Initializes the adapter with the specified `IRegionBehaviorFactory`. Required by the base `RegionAdapterBase`. - **`protected override void Adapt(IRegion region, StackPanel regionTarget)`** - Subscribes to the `region.Views.CollectionChanged` event and synchronizes the `StackPanel.Children` collection with the region's views. Handles `NotifyCollection