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

  1. Remove the ConverterParameter=... from the XAML binding that uses this converter.
  2. 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.
  3. 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

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


AI-assisted analysis of unoplatform/uno@0418340488 (2026-08-13). Data as JSON: /api/errors/498fe7805eacd5a1. Report an issue: GitHub.