{"record":{"id":"e36b483b03ae4bc0","repo":"HandyOrg/HandyControl","slug":"icon","errorCode":null,"errorMessage":"icon","messagePattern":"icon","errorType":"exception","errorClass":"InvalidEnumArgumentException","httpStatus":null,"severity":"error","filePath":"src/Shared/HandyControl_Shared/Controls/Window/MessageBox.cs","lineNumber":487,"sourceCode":"    }\n\n    private static MessageBox CreateMessageBox(\n        System.Windows.Window owner,\n        string messageBoxText,\n        string caption,\n        MessageBoxButton button,\n        MessageBoxImage icon,\n        MessageBoxResult defaultResult\n    )\n    {\n        if (!IsValidMessageBoxButton(button))\n        {\n            throw new InvalidEnumArgumentException(nameof(button), (int) button, typeof(MessageBoxButton));\n        }\n\n        if (!IsValidMessageBoxImage(icon))\n        {\n            throw new InvalidEnumArgumentException(nameof(icon), (int) icon, typeof(MessageBoxImage));\n        }\n\n        if (!IsValidMessageBoxResult(defaultResult))\n        {\n            throw new InvalidEnumArgumentException(nameof(defaultResult), (int) defaultResult,\n                typeof(MessageBoxResult));\n        }\n\n        var ownerWindow = owner ?? WindowHelper.GetActiveWindow();\n        var ownerIsNull = ownerWindow is null;\n\n        return new MessageBox\n        {\n            Message = messageBoxText,\n            Owner = ownerWindow,\n            WindowStartupLocation =\n                ownerIsNull ? WindowStartupLocation.CenterScreen : WindowStartupLocation.CenterOwner,\n            ShowTitle = true,","sourceCodeStart":469,"sourceCodeEnd":505,"githubUrl":"https://github.com/HandyOrg/HandyControl/blob/2c0875ebd67326e0c67282967e3e809c69282fee/src/Shared/HandyControl_Shared/Controls/Window/MessageBox.cs#L469-L505","documentation":"Validation helper in MessageBox.CreateMessageBox: throws InvalidEnumArgumentException for 'icon' when the MessageBoxImage value is not a defined member (None, Hand, Question, Exclamation, Asterisk, Stop, Error, Warning, Information). It fires when an out-of-range icon enum reaches the factory.","triggerScenarios":"Thrown at src/Shared/HandyControl_Shared/Controls/Window/MessageBox.cs:487 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Map public helper methods (Success/Info/Warning/Error/Fatal/Ask) to fixed valid MessageBoxImage constants","Reject or default undefined icon values at the API boundary before CreateMessageBox","Validate with Enum.IsDefined before calling the factory"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2c0875ebd67326e0c67282967e3e809c69282fee","analyzedAt":"2026-09-14T14:45:29.754Z","contentChangedAt":"2026-09-14T14:45:29.754Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}