dotnet/wpf · error · NotImplementedException
NotImplementedException
Error message
NotImplementedException
What it means
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.
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
Example fix
// before
new Binding("IsSelective") { Converter = new BooleanToSelectiveScrollingOrientationConverter() };
// after
new Binding("IsSelective") { Converter = new BooleanToSelectiveScrollingOrientationConverter(), Mode = BindingMode.OneWay }; Defensive patterns
Strategy: type-guard
Type guard
bool IsOneWayBinding(Binding b) => b.Mode == BindingMode.OneWay || b.Mode == BindingMode.Default;
Try / catch
try
{
var result = converter.ConvertBack(value, targetType, parameter, culture);
}
catch (NotImplementedException)
{
// write custom converter for reverse mapping
}
Prevention
- Always set Mode=OneWay with this converter
- Never share converter resources across TwoWay bindings
- Implement custom IValueConverter for back-conversion
When it happens
Trigger: Binding BooleanToSelectiveScrollingOrientationConverter in a TwoWay or OneWayToSource binding; calling ConvertBack directly in code.
Common situations: 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.
Related errors
- 0x80004001
- ArgumentException: path
- ArgumentException: relativeTo
- ArgumentNullException: path
- ArgumentNullException: relativeTo
AI-assisted analysis of dotnet/wpf@81131a70a4 (2026-09-14).
Data as JSON: /api/errors/8a379540dfa9641e.
Report an issue: GitHub.
Appendix: source
Thrown at src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Controls/BooleanToSelectiveScrollingOrientationConverter.cs:44
{
var valueAsBool = (bool)value;
var parameterSelectiveScrollingOrientation = (SelectiveScrollingOrientation)parameter;
if (valueAsBool)
{
return parameterSelectiveScrollingOrientation;
}
}
return SelectiveScrollingOrientation.Both;
}
/// <summary>
/// Not implemented
/// </summary>
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}View on GitHub (pinned to 81131a70a4)