{"record":{"id":"af90524062535efe","repo":"stride3d/stride","slug":"property-unsupported-by-method-updatevaluefromcomponent-af9052","errorCode":null,"errorMessage":"Property unsupported by method UpdateValueFromComponent.","messagePattern":"Property unsupported by method UpdateValueFromComponent\\.","errorType":"exception","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"sources/presentation/Stride.Core.Presentation.Wpf/Controls/DateTimeEditor.cs","lineNumber":208,"sourceCode":"            }\n\n            if (property == MinuteProperty)\n            {\n                if (!Minute.HasValue || !Value.HasValue)\n                    return null;\n                long ticks = new DateTime(Value.Value.Year, Value.Value.Month, Value.Value.Day, Value.Value.Hour, Minute.Value, 0).Ticks;\n                return new DateTime(ticks + Value.Value.Ticks % TimeSpan.TicksPerMinute);\n            }\n            \n            if (property == SecondProperty)\n            {\n                if (!Second.HasValue || !Value.HasValue)\n                    return null;\n                long ticks = Value.Value.Ticks - (Value.Value.Ticks % TimeSpan.TicksPerMinute);\n                return new DateTime(ticks + (long)(Second.Value * TimeSpan.TicksPerSecond));\n            }\n\n            throw new ArgumentException(\"Property unsupported by method UpdateValueFromComponent.\");\n        }\n\n        /// <summary>\n        /// Raised when the <see cref=\"Value\"/> property is modified.\n        /// </summary>\n        private void OnValueValueChanged()\n        {\n            var isInitializing = !templateApplied && initializingProperty == null;\n            if (isInitializing)\n                initializingProperty = ValueProperty;\n\n            if (!interlock)\n            {\n                interlock = true;\n                UpdateComponentsFromValue(Value);\n                interlock = false;\n            }\n","sourceCodeStart":190,"sourceCodeEnd":226,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/presentation/Stride.Core.Presentation.Wpf/Controls/DateTimeEditor.cs#L190-L226","documentation":"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.","triggerScenarios":"OnComponentPropertyChanged forwarding a component property change to UpdateValueFromComponent for a DependencyProperty with no corresponding branch — e.g. new properties added to a derived DateTimeEditor.","commonSituations":"Subclassing DateTimeEditor with extra component editors; custom property registration reusing the same change handler; library upgrade altering property routing.","solutions":["Add a branch for the unsupported property in UpdateValueFromComponent.","Route only the documented component properties (through OnComponentPropertyChanged) to this method.","If unmodified, verify Stride version and report a regression."],"exampleFix":"// before\nif (property == MinuteProperty) { /* ... */ }\nthrow new ArgumentException(\"Property unsupported by method UpdateValueFromComponent.\");\n// after\nif (property == MinuteProperty) { /* ... */ }\nif (property == MillisecondProperty)\n    return ComposeValueWithMillisecond();\nthrow new ArgumentException(\"Property unsupported by method UpdateValueFromComponent.\");","handlingStrategy":"try-catch","validationCode":"// Verify only documented component properties are routed\nif (!componentProperties.Contains(property)) { log.Warn($\"{property} not a DateTimeEditor component property\"); return; }","typeGuard":null,"tryCatchPattern":"try { editor.OnComponentPropertyChanged(sender, e); }\ncatch (ArgumentException ex) { log.Error(\"DateTimeEditor got unsupported component property\", ex); }","preventionTips":["Only route the built-in Year/Month/Day/Hour/Minute/Second properties to UpdateValueFromComponent.","Extend the method when adding component properties to a derived editor.","Test all component editors end-to-end after subclassing."],"tags":["wpf","internal-invariant","property-dispatch"],"backgroundTag":"internal-invariant-violation","analyzedSha":"96fad776d210c221682aac1ccdf4c79dc046fc38","analyzedAt":"2026-09-14T02:59:31.279Z","contentChangedAt":"2026-09-14T02:59:31.279Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}