{"record":{"id":"8a379540dfa9641e","repo":"dotnet/wpf","slug":"notimplementedexception-8a3795","errorCode":null,"errorMessage":"NotImplementedException","messagePattern":"NotImplementedException","errorType":"exception","errorClass":"NotImplementedException","httpStatus":null,"severity":"error","filePath":"src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Controls/BooleanToSelectiveScrollingOrientationConverter.cs","lineNumber":44,"sourceCode":"            {\n                var valueAsBool = (bool)value;\n                var parameterSelectiveScrollingOrientation = (SelectiveScrollingOrientation)parameter;\n\n                if (valueAsBool)\n                {\n                    return parameterSelectiveScrollingOrientation;\n                }\n            }\n\n            return SelectiveScrollingOrientation.Both;\n        }\n\n        /// <summary>\n        ///     Not implemented\n        /// </summary>\n        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)\n        {\n            throw new NotImplementedException();\n        }\n    }\n}","sourceCodeStart":26,"sourceCodeEnd":47,"githubUrl":"https://github.com/dotnet/wpf/blob/81131a70a4c573cd62748a5c36908fc4d662daa9/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Controls/BooleanToSelectiveScrollingOrientationConverter.cs#L26-L47","documentation":"BooleanToSelectiveScrollingOrientationConverter.ConvertBack is intentionally not implemented; the converter is one-way only for DataGrid selective scrolling bindings. Any two-way binding that tries to convert back throws NotImplementedException.","triggerScenarios":"Binding BooleanToSelectiveScrollingOrientationConverter in a TwoWay or OneWayToSource binding; calling ConvertBack directly in code.","commonSituations":"Using the converter as a resource shared with other bindings that default to TwoWay; applying it to a Bindings collection in DataGrid with Mode=TwoWay.","solutions":["Set the binding Mode explicitly to OneWay","Write a custom IValueConverter that implements ConvertBack if reverse conversion is needed","Do not use this converter for two-way scenarios"],"exampleFix":"// before\nnew Binding(\"IsSelective\") { Converter = new BooleanToSelectiveScrollingOrientationConverter() };\n// after\nnew Binding(\"IsSelective\") { Converter = new BooleanToSelectiveScrollingOrientationConverter(), Mode = BindingMode.OneWay };","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"bool IsOneWayBinding(Binding b) => b.Mode == BindingMode.OneWay || b.Mode == BindingMode.Default;\n","tryCatchPattern":"try\n{\n    var result = converter.ConvertBack(value, targetType, parameter, culture);\n}\ncatch (NotImplementedException)\n{\n    // write custom converter for reverse mapping\n}\n","preventionTips":["Always set Mode=OneWay with this converter","Never share converter resources across TwoWay bindings","Implement custom IValueConverter for back-conversion"],"tags":["wpf","not-implemented","value-converter"],"backgroundTag":"method-not-implemented","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"}