unoplatform/uno · error · ArgumentException
This converter does not use any parameters. You should remov
Error message
This converter does not use any parameters. You should remove "{parameter}" passed as parameter. What it means
Thrown by FromNullableBoolToCustomValueConverter.Convert when a ConverterParameter was supplied in the XAML binding. The converter ignores parameters by design, so any non-null parameter is treated as a programmer error rather than silently dropped.
Source
Thrown at src/SamplesApp/SamplesApp.Samples/Windows_UI_Xaml_Controls/CommandBar/CommandBar_Native_With_AppBarButton_Binding.xaml.cs:46
public sealed partial class CommandBar_Native_With_AppBarButton_Binding : Page
{
public CommandBar_Native_With_AppBarButton_Binding()
{
this.InitializeComponent();
}
}
public class FromNullableBoolToCustomValueConverter : IValueConverter
{
public object NullOrFalseValue { get; set; }
public object TrueValue { get; set; }
public object Convert(object value, Type targetType, object parameter, string language)
{
if (parameter != null)
{
throw new ArgumentException($"This converter does not use any parameters. You should remove \"{parameter}\" passed as parameter.");
}
if (value != null && !(value is bool))
{
throw new ArgumentException($"Value must either be null or of type bool. Got {value} ({value.GetType().FullName})");
}
if (value == null || !System.Convert.ToBoolean(value, CultureInfo.InvariantCulture))
{
return NullOrFalseValue;
}
else
{
return TrueValue;
}
}
public object ConvertBack(object value, Type targetType, object parameter, string language)View on GitHub (pinned to 0418340488)
Solutions
- Remove the ConverterParameter=... from the XAML binding that uses this converter.
- If you need parameterized behavior, use a different converter that supports it, or add a property to the converter and set it as a resource.
- Search the XAML for the converter's StaticResource key and audit every usage.
Example fix
<!-- before -->
<Binding Path="IsOn" Converter="{StaticResource FromNullableBoolToCustomValue}" ConverterParameter="Foo" />
<!-- after -->
<Binding Path="IsOn" Converter="{StaticResource FromNullableBoolToCustomValue}" /> Defensive patterns
Strategy: validation
Validate before calling
<!-- In XAML, ensure the binding has no ConverterParameter --> <!-- Use a static check: grep the page for 'ConverterParameter' on this converter's bindings -->
Prevention
- Document converters that take no parameter and audit XAML for stray ConverterParameter.
- Use distinct resource keys so the right converter is obvious in bindings.
- Add an XML doc comment on the converter class stating 'no ConverterParameter'.
When it happens
Trigger: XAML binding like {Binding IsOn, Converter={StaticResource C}, ConverterParameter=Foo} passes 'Foo' as parameter, which the Convert method rejects at the top.
Common situations: Copy-pasting a binding from a converter that does take a parameter (e.g. a visibility converter) into one that doesn't; leftover ConverterParameter from refactoring; misunderstanding which converter is being used.
Related errors
- Value must either be null or of type bool. Got {value} ({val
- Cannot convert back if both custom values are the same
- This converter does not use any parameters. You should remov
- Value must either be null or of type bool. Got {value} ({val
- This converter does not use any parameters. You should remov
AI-assisted analysis of unoplatform/uno@0418340488 (2026-08-13).
Data as JSON: /api/errors/498fe7805eacd5a1.
Report an issue: GitHub.