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

Same design as error 105 but in the unit-test converter FromNullableBoolToDefaultValueConverter.Convert: it rejects any non-null ConverterParameter because parameterization is not supported. Used in UITests to assert clean binding usage.

Source

Thrown at src/SamplesApp/SamplesApp.UnitTests.Shared/Controls/UITests/Views/Converters/FromNullableBoolToDefaultValueConverter.cs:20

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 FromNullableBoolToDefaultValueConverter : 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 ConverterParameter from the test binding using this converter.
  2. Use a parameterized converter if the test genuinely needs a parameter.
  3. Audit the test page for the converter's resource key.

Example fix

<!-- before -->
<Binding Path="Flag" Converter="{StaticResource Def}" ConverterParameter="x"/>
<!-- after -->
<Binding Path="Flag" Converter="{StaticResource Def}"/>
Defensive patterns

Strategy: validation

Validate before calling

<!-- Audit test XAML: no ConverterParameter on this converter's bindings -->

Prevention

When it happens

Trigger: A test binding supplies ConverterParameter to this converter; the Convert guard throws.

Common situations: Test XAML copied from a parameterized converter; leftover ConverterParameter after refactoring a test fixture.

Related errors


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