stride3d/stride · error · InvalidOperationException

No multi value converter has been set.

Error message

No multi value converter has been set.

What it means

MultiChained.Convert first delegates to an inner IMultiValueConverter stored in the MultiConverter property. If that property was never set, there is no converter to call, so the method throws InvalidOperationException. The chained converter requires this wiring before use.

Solutions

  1. Set the MultiConverter property before the binding is evaluated.
  2. Initialize MultiConverter in the constructor or via XAML property element syntax.
  3. Verify the resource declaration in XAML includes the inner converter.

Example fix

// before
var chained = new MultiChained { ChainedConverter = new BoolToVisibilityConverter() };
// after
var chained = new MultiChained { MultiConverter = new MyMultiConverter(), ChainedConverter = new BoolToVisibilityConverter() };
Defensive patterns

Strategy: validation

Validate before calling

// C# - check before use
if (multiChained.MultiConverter == null) throw new InvalidOperationException("Configure MultiConverter first");

Type guard

static bool IsConfigured(MultiChained c) => c?.MultiConverter != null;

Try / catch

try { result = chained.Convert(values, targetType, param, culture); } catch (InvalidOperationException ex) { /* log misconfigured converter */ }

Prevention

When it happens

Trigger: Instantiating MultiChained (or using it in XAML) without assigning its MultiConverter property, then a binding evaluation triggers Convert(object[], ...).

Common situations: XAML resource declared without setting MultiConverter; code constructing MultiChained and forgetting the property; refactoring removed the initialization.

Understand the failure class

Background: "not installed", "pip install", "required for": how missing-dependency errors surface across open-source libraries — this error's family across 34 libraries.

Related errors


AI-assisted analysis of stride3d/stride@96fad776d2 (2026-09-14). Data as JSON: /api/errors/3ad708655dff166d. Report an issue: GitHub.

Appendix: source

Thrown at sources/presentation/Stride.Core.Presentation.Wpf/ValueConverters/MultiChained.cs:278

        /// Gets or sets the target type of the seventh converter to chain.
        /// </summary>
        public Type TargetType7 { get { return chainedConverter.TargetType7; } set { chainedConverter.TargetType7 = value; } }
        /// <summary>
        /// Gets or sets the target type of the eighth converter to chain.
        /// </summary>
        public Type TargetType8 { get { return chainedConverter.TargetType8; } set { chainedConverter.TargetType8 = value; } }

        /// <inheritdoc/>
        [NotNull]
        public override object ProvideValue(IServiceProvider serviceProvider)
        {
            return this;
        }

        /// <inheritdoc/>
        public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
        {
            if (MultiConverter == null) throw new InvalidOperationException("No multi value converter has been set.");
            var result = MultiConverter.Convert(values, MultiConverterTargetType ?? typeof(object), MultiConverterParameter, culture);
            return chainedConverter.Convert(result, targetType, parameter, culture);
        }

        /// <inheritdoc/>
        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
        {
            if (MultiConverter == null) throw new InvalidOperationException("No multi value converter has been set.");
            var result = chainedConverter.ConvertBack(value, MultiConverterTargetType ?? typeof(object), parameter, culture);
            return MultiConverter.ConvertBack(result, targetTypes, MultiConverterParameter, culture);
        }
    }
}

View on GitHub (pinned to 96fad776d2)