{"record":{"id":"d045dc3cb71cacdd","repo":"MaterialDesignInXAML/MaterialDesignInXamlToolkit","slug":"textbox-d045dc","errorCode":null,"errorMessage":"textBox","messagePattern":"textBox","errorType":"exception","errorClass":"ArgumentNullException","httpStatus":null,"severity":"info","filePath":"src/MaterialDesignThemes.Wpf/HintProxyFabric.TextBox.cs","lineNumber":24,"sourceCode":"    {\n        private readonly TextBox _textBox;\n\n        public bool IsLoaded => _textBox.IsLoaded;\n\n        public bool IsVisible => _textBox.IsVisible;\n\n        public bool IsEmpty() => string.IsNullOrEmpty(_textBox.Text);\n\n        public bool IsFocused() => _textBox.IsKeyboardFocusWithin;\n\n        public event EventHandler? ContentChanged;\n        public event EventHandler? IsVisibleChanged;\n        public event EventHandler? Loaded;\n        public event EventHandler? FocusedChanged;\n\n        public TextBoxHintProxy(TextBox textBox)\n        {\n            _textBox = textBox ?? throw new ArgumentNullException(nameof(textBox));\n            _textBox.TextChanged += TextBoxTextChanged;\n            _textBox.Loaded += TextBoxLoaded;\n            _textBox.IsVisibleChanged += TextBoxIsVisibleChanged;\n            _textBox.IsKeyboardFocusWithinChanged += TextBoxIsKeyboardFocusedChanged;\n        }\n\n        private void TextBoxIsKeyboardFocusedChanged(object sender, DependencyPropertyChangedEventArgs e)\n            => FocusedChanged?.Invoke(sender, EventArgs.Empty);\n\n        private void TextBoxIsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)\n            => IsVisibleChanged?.Invoke(sender, EventArgs.Empty);\n\n        private void TextBoxLoaded(object sender, RoutedEventArgs e)\n            => Loaded?.Invoke(sender, EventArgs.Empty);\n\n        private void TextBoxTextChanged(object sender, TextChangedEventArgs e)\n            => ContentChanged?.Invoke(sender, EventArgs.Empty);\n","sourceCodeStart":6,"sourceCodeEnd":42,"githubUrl":"https://github.com/MaterialDesignInXAML/MaterialDesignInXamlToolkit/blob/98edec3a0b96ef272c587b14bcd67ef5f928a7ed/src/MaterialDesignThemes.Wpf/HintProxyFabric.TextBox.cs#L6-L42","documentation":"TextBoxHintProxy is the private adapter binding a WPF TextBox to SmartHint. Its constructor throws ArgumentNullException(nameof(textBox)) if given a null TextBox. Like the RichTextBox proxy it is a private nested class instantiated only by HintProxyFabric.Get(), which already filters nulls, so the guard is defensive and not reachable through the supported public API.","triggerScenarios":"Only reachable via reflection over the private constructor, or if a future HintProxyFabric change bypasses its existing null check before casting the control to TextBox.","commonSituations":"Forking/extending the fabric or using reflection to add hint support to a custom control; ordinary SmartHint usage does not trigger it.","solutions":["Use HintProxyFabric.Get(control) instead of the private proxy constructor.","When registering a custom builder, have the build delegate return null for unsupported/null controls rather than building a proxy with null."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (control is null) return null;\nvar proxy = HintProxyFabric.Get(control);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use HintProxyFabric.Get() rather than the private TextBoxHintProxy constructor.","Let the fabric's built-in null guard handle null controls."],"tags":["wpf","smarthint","defensive-code","argument-null"],"backgroundTag":null,"analyzedSha":"98edec3a0b96ef272c587b14bcd67ef5f928a7ed","analyzedAt":"2026-08-13T14:31:19.111Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}