stride3d/stride · error · ArgumentException

Property unsupported by method UpdateValueFromComponent.

Error message

Property unsupported by method UpdateValueFromComponent.

What it means

DateTimeEditor.UpdateValueFromComponent maps component dependency properties (Year/Month/Day/Hour/Minute/Second) to the editor's Value. Reaching the trailing throw means a property was routed to this method that none of its branches handle — an internal dispatch invariant, typically after extending the control with new component properties.

Solutions

  1. Add a branch for the unsupported property in UpdateValueFromComponent.
  2. Route only the documented component properties (through OnComponentPropertyChanged) to this method.
  3. If unmodified, verify Stride version and report a regression.

Example fix

// before
if (property == MinuteProperty) { /* ... */ }
throw new ArgumentException("Property unsupported by method UpdateValueFromComponent.");
// after
if (property == MinuteProperty) { /* ... */ }
if (property == MillisecondProperty)
    return ComposeValueWithMillisecond();
throw new ArgumentException("Property unsupported by method UpdateValueFromComponent.");
Defensive patterns

Strategy: try-catch

Validate before calling

// Verify only documented component properties are routed
if (!componentProperties.Contains(property)) { log.Warn($"{property} not a DateTimeEditor component property"); return; }

Try / catch

try { editor.OnComponentPropertyChanged(sender, e); }
catch (ArgumentException ex) { log.Error("DateTimeEditor got unsupported component property", ex); }

Prevention

When it happens

Trigger: OnComponentPropertyChanged forwarding a component property change to UpdateValueFromComponent for a DependencyProperty with no corresponding branch — e.g. new properties added to a derived DateTimeEditor.

Common situations: Subclassing DateTimeEditor with extra component editors; custom property registration reusing the same change handler; library upgrade altering property routing.

Understand the failure class

Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.

Related errors


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

Appendix: source

Thrown at sources/presentation/Stride.Core.Presentation.Wpf/Controls/DateTimeEditor.cs:208

            }

            if (property == MinuteProperty)
            {
                if (!Minute.HasValue || !Value.HasValue)
                    return null;
                long ticks = new DateTime(Value.Value.Year, Value.Value.Month, Value.Value.Day, Value.Value.Hour, Minute.Value, 0).Ticks;
                return new DateTime(ticks + Value.Value.Ticks % TimeSpan.TicksPerMinute);
            }
            
            if (property == SecondProperty)
            {
                if (!Second.HasValue || !Value.HasValue)
                    return null;
                long ticks = Value.Value.Ticks - (Value.Value.Ticks % TimeSpan.TicksPerMinute);
                return new DateTime(ticks + (long)(Second.Value * TimeSpan.TicksPerSecond));
            }

            throw new ArgumentException("Property unsupported by method UpdateValueFromComponent.");
        }

        /// <summary>
        /// Raised when the <see cref="Value"/> property is modified.
        /// </summary>
        private void OnValueValueChanged()
        {
            var isInitializing = !templateApplied && initializingProperty == null;
            if (isInitializing)
                initializingProperty = ValueProperty;

            if (!interlock)
            {
                interlock = true;
                UpdateComponentsFromValue(Value);
                interlock = false;
            }

View on GitHub (pinned to 96fad776d2)