PrismLibrary/Prism · info · NotImplementedException
Not implemented
Error message
Not implemented
What it means
RelativeContentSizeConverter converts a RelativeSize to pixels for one-way sizing of dialogs; the reverse conversion has no meaningful implementation, so ConvertBack throws NotImplementedException. Two-way binding to a property using this converter is unsupported by design.
Solutions
- Change the binding to Mode=OneWay (the only supported direction for this converter).
- Remove the converter from any editable/target-updating binding.
- If reverse conversion is needed, write a custom IValueConverter implementing ConvertBack.
Example fix
// before
<BindableProperty Binding="{Binding Width, Converter={StaticResource RelativeContentSize}, Mode=TwoWay}" />
// after
<BindableProperty Binding="{Binding Width, Converter={StaticResource RelativeContentSize}, Mode=OneWay}" /> Defensive patterns
Strategy: validation
Validate before calling
// audit bindings using the converter
if (binding.Mode is BindingMode.TwoWay or BindingMode.OneWayToSource)
throw new InvalidOperationException("RelativeContentSizeConverter only supports OneWay"); Prevention
- Always declare Mode=OneWay on bindings using RelativeContentSizeConverter.
- Never attach this converter to editable controls.
- Write a custom converter if two-way relative sizing is truly needed.
When it happens
Trigger: Binding with Mode=TwoWay (or OneWayToSource) on a property whose Binding uses RelativeContentSizeConverter, causing WPF/MAUI to call ConvertBack.
Common situations: Copy-pasting a dialog XAML snippet and changing the size binding to TwoWay; applying the converter to an editable control's value (e.g. an Entry bound to the sized property); using the converter outside Prism's relative-size scenario.
Related errors
- An error occurred while initializing the Modules.
- An error was encountered while configuring the Module…
- An error was encountered while invoking the OnInitialized…
- ArgumentNullException for 'regionTarget'
- ArgumentNullException for 'target'
AI-assisted analysis of PrismLibrary/Prism@358118cd64 (2026-09-15).
Data as JSON: /api/errors/4784f1a1de41511b.
Report an issue: GitHub.
Appendix: source
Thrown at src/Maui/Prism.Maui/Dialogs/RelativeContentSizeConverter.cs:39
else
{
relativeSize = value;
}
}
}
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
var pageSize = double.Parse(value.ToString());
if (pageSize < 0)
return pageSize;
return RelativeSize * pageSize;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
View on GitHub (pinned to 358118cd64)