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

FromNullableBoolToReverseBoolConverter.Convert rejects a non-null ConverterParameter, mirroring the family's no-parameter convention. This converter inverts a nullable bool.

Source

Thrown at src/SamplesApp/SamplesApp.UnitTests.Shared/Controls/UITests/Views/Converters/FromNullableBoolToReverseBoolConverter.cs:17

using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Data;
using Microsoft.UI.Xaml.Media;

namespace Uno.UI.Samples.Converters
{
	public class FromNullableBoolToReverseBoolConverter : IValueConverter
	{
		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})");
			}

			var valueToConvert = value != null && System.Convert.ToBoolean(value, CultureInfo.InvariantCulture);

			return !valueToConvert;
		}

		public object ConvertBack(object value, Type targetType, object parameter, string language)
		{
			throw new NotSupportedException();
		}
	}
}

View on GitHub (pinned to 0418340488)

Solutions

  1. Remove ConverterParameter from the binding.
  2. Use a parameter-aware converter if parameterization is needed.

Example fix

<!-- before -->
{Binding Flag, Converter={StaticResource Rev}, ConverterParameter="1"}
<!-- after -->
{Binding Flag, Converter={StaticResource Rev}}
Defensive patterns

Strategy: validation

Validate before calling

<!-- Ensure no ConverterParameter on bindings using this converter -->

Prevention

When it happens

Trigger: Supplying ConverterParameter in a binding that uses this reverse converter.

Common situations: Copy-paste from a parameterized converter; leftover parameter after refactor.

Related errors


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