{"record":{"id":"28311cbd07c6fa72","repo":"MaterialDesignInXAML/MaterialDesignInXamlToolkit","slug":"combobox","errorCode":null,"errorMessage":"comboBox","messagePattern":"comboBox","errorType":"exception","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"src/MaterialDesignThemes.Wpf/HintProxyFabric.ComboBox.cs","lineNumber":12,"sourceCode":"﻿namespace MaterialDesignThemes.Wpf;\n\npublic static partial class HintProxyFabric\n{\n    private sealed class ComboBoxHintProxy : IHintProxy\n    {\n        private readonly ComboBox _comboBox;\n        private readonly TextChangedEventHandler _comboBoxTextChangedEventHandler;\n\n        public ComboBoxHintProxy(ComboBox comboBox)\n        {\n            if (comboBox is null) throw new ArgumentNullException(nameof(comboBox));\n\n            _comboBox = comboBox;\n            _comboBoxTextChangedEventHandler = ComboBoxTextChanged;\n            _comboBox.AddHandler(TextBoxBase.TextChangedEvent, _comboBoxTextChangedEventHandler);\n            _comboBox.SelectionChanged += ComboBoxSelectionChanged;\n            _comboBox.Loaded += ComboBoxLoaded;\n            _comboBox.IsVisibleChanged += ComboBoxIsVisibleChanged;\n            _comboBox.IsKeyboardFocusWithinChanged += ComboBoxIsKeyboardFocusWithinChanged;\n        }\n\n        public bool IsLoaded => _comboBox.IsLoaded;\n\n        public bool IsVisible => _comboBox.IsVisible;\n\n        public bool IsEmpty() => string.IsNullOrEmpty(_comboBox.Text);\n\n        public bool IsFocused() => _comboBox.IsEditable && _comboBox.IsKeyboardFocusWithin;\n","sourceCodeStart":1,"sourceCodeEnd":30,"githubUrl":"https://github.com/MaterialDesignInXAML/MaterialDesignInXamlToolkit/blob/98edec3a0b96ef272c587b14bcd67ef5f928a7ed/src/MaterialDesignThemes.Wpf/HintProxyFabric.ComboBox.cs#L1-L30","documentation":"ArgumentNullException(nameof(comboBox)) in ComboBoxHintProxy's constructor (HintProxyFabric.ComboBox.cs:12). The hint proxy wraps a ComboBox to drive the floating hint (SmartHint); a null ComboBox cannot be wrapped. Reachable when the internal HintProxyFabric (or a fork/test) constructs the proxy with null.","triggerScenarios":"Constructing ComboBoxHintProxy with a null ComboBox reference; typically invoked internally from the hint-attached behavior when a ComboBox is involved. Direct public construction is internal-only.","commonSituations":"Test doubles/fakes; a custom Style/ControlTemplate that breaks the ComboBox reference path; library fork invoking the proxy with null; reflection-based instantiation.","solutions":["Pass a valid ComboBox instance to the proxy; obtain it from the actual control being hinted.","Do not instantiate ComboBoxHintProxy directly; let the framework's HintProxyFabric pick the correct proxy.","In tests, use a real ComboBox rather than null; verify ControlTemplate/Style does not null-out the target."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (comboBox is null)\n    throw new ArgumentNullException(nameof(comboBox));\n\n// Let HintProxyFabric choose the adapter; do not construct ComboBoxHintProxy directly.","typeGuard":"static bool CanWrapComboBox(ComboBox? comboBox) => comboBox is not null;","tryCatchPattern":null,"preventionTips":["Do not instantiate ComboBoxHintProxy directly; let HintProxyFabric select the proxy.","Ensure ComboBox styles/templates do not null out the target.","In tests, use a real ComboBox rather than null."],"tags":["wpf","materialdesigninxaml","argument-null","combobox","hint","internal"],"backgroundTag":null,"analyzedSha":"98edec3a0b96ef272c587b14bcd67ef5f928a7ed","analyzedAt":"2026-08-13T14:31:19.111Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}