{"record":{"id":"4412b0979afd2324","repo":"dotnet/wpf","slug":"elementnotenabledexception-gridsplitterautomationpeer","errorCode":null,"errorMessage":"ElementNotEnabledException","messagePattern":"ElementNotEnabledException","errorType":"exception","errorClass":"ElementNotEnabledException","httpStatus":null,"severity":"error","filePath":"src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Automation/Peers/GridSplitterAutomationPeer.cs","lineNumber":40,"sourceCode":"        /// \n        public override object GetPattern(PatternInterface patternInterface)\n        {\n            if (patternInterface == PatternInterface.Transform)\n                return this;\n            else\n                return base.GetPattern(patternInterface); \n        }\n\n        #region ITransformProvider\n\n        bool ITransformProvider.CanMove { get { return true; } }\n        bool ITransformProvider.CanResize { get { return false; } }\n        bool ITransformProvider.CanRotate { get { return false; } }\n\n        void ITransformProvider.Move(double x, double y)\n        {\n            if (!IsEnabled())\n                throw new ElementNotEnabledException();\n\n            if (double.IsInfinity(x) || double.IsNaN(x))\n                throw new ArgumentOutOfRangeException(nameof(x));\n\n            if (double.IsInfinity(y) || double.IsNaN(y))\n                throw new ArgumentOutOfRangeException(nameof(y));\n\n            ((GridSplitter)Owner).KeyboardMoveSplitter(x, y);\n        }\n        void ITransformProvider.Resize(double width, double height)\n        {\n            throw new InvalidOperationException(SR.UIA_OperationCannotBePerformed);\n        }\n        void ITransformProvider.Rotate(double degrees)\n        {\n            throw new InvalidOperationException(SR.UIA_OperationCannotBePerformed);\n        }\n","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/dotnet/wpf/blob/81131a70a4c573cd62748a5c36908fc4d662daa9/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Automation/Peers/GridSplitterAutomationPeer.cs#L22-L58","documentation":"GridSplitterAutomationPeer's ITransformProvider.Move throws ElementNotEnabledException when IsEnabled() returns false, i.e. the underlying GridSplitter control (or an ancestor) is disabled. UIA requires that transform operations be rejected with this specific exception when the element is not enabled.","triggerScenarios":"A UIA client invokes ITransformProvider.Move on a GridSplitterAutomationPeer whose Owner GridSplitter has IsEnabled=false (directly or inherited from a disabled ancestor).","commonSituations":"Test suites or assistive tech driving splitter movement while the window/panel containing the splitter is disabled; forgetting to re-enable the control after showing a loading overlay that disables it.","solutions":["Enable the GridSplitter (IsEnabled=true) and all disabled ancestors before calling Move.","Check IsEnabled property on the UIA element before invoking the Transform pattern.","Catch ElementNotEnabledException in the automation client and skip or defer the move.","Fix application logic that leaves the splitter (or parent) disabled when it should be interactive."],"exampleFix":"// before\n((ITransformProvider)peer).Move(50, 0);\n// after\nif (peer.IsEnabled()) ((ITransformProvider)peer).Move(50, 0);","handlingStrategy":"validation","validationCode":"bool canMove = peer.IsEnabled();\nif (!canMove) throw new SkipTestException(\"GridSplitter disabled\");","typeGuard":null,"tryCatchPattern":"try { ((ITransformProvider)peer).Move(x, y); }\ncatch (ElementNotEnabledException) { /* enable control or abort */ }","preventionTips":["Check IsEnabled on the UIA element before transform calls","Avoid disabling splitter ancestors during automation","Re-enable controls after busy/loading states"],"tags":["wpf","ui-automation","grid-splitter","disabled-element"],"backgroundTag":"permission-denied","analyzedSha":"81131a70a4c573cd62748a5c36908fc4d662daa9","analyzedAt":"2026-09-14T10:12:48.479Z","contentChangedAt":"2026-09-14T10:12:48.479Z","schemaVersion":2},"datasetVersion":"2026-09-22T01:17:13.364Z"}