{"record":{"id":"5b9a08b23907e5e7","repo":"stride3d/stride","slug":"property-unsupported-by-method-updatevaluefromcomponent-5b9a08","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/Int3Editor.cs","lineNumber":63,"sourceCode":"            if (value != null)\n            {\n                SetCurrentValue(XProperty, value.Value.X);\n                SetCurrentValue(YProperty, value.Value.Y);\n                SetCurrentValue(ZProperty, value.Value.Z);\n            }\n        }\n\n        /// <inheritdoc/>\n        protected override Int3? UpdateValueFromComponent(DependencyProperty property)\n        {\n            if (property == XProperty)\n                return X.HasValue && Value.HasValue ? (Int3?)new Int3(X.Value, Value.Value.Y, Value.Value.Z) : null;\n            if (property == YProperty)\n                return Y.HasValue && Value.HasValue ? (Int3?)new Int3(Value.Value.X, Y.Value, Value.Value.Z) : null;\n            if (property == ZProperty)\n                return Z.HasValue && Value.HasValue ? (Int3?)new Int3(Value.Value.X, Value.Value.Y, Z.Value) : null;\n\n            throw new ArgumentException(\"Property unsupported by method UpdateValueFromComponent.\");\n        }\n\n        /// <inheritdoc/>\n        protected override Int3? UpdateValueFromFloat(float value)\n        {\n            return new Int3((int)Math.Round(value, MidpointRounding.AwayFromZero));\n        }\n    }\n}\n","sourceCodeStart":45,"sourceCodeEnd":73,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/presentation/Stride.Core.Presentation.Wpf/Controls/Int3Editor.cs#L45-L73","documentation":"Int3Editor.UpdateValueFromComponent rebuilds an Int3 from whichever of XProperty/YProperty/ZProperty changed. Receiving any other DependencyProperty means the caller violated the editor's contract, so ArgumentException is thrown instead of producing a partial or wrong Int3.","triggerScenarios":"Invoking UpdateValueFromComponent with a DependencyProperty not in {XProperty, YProperty, ZProperty}, typically from subclass code or mis-wired property-change callbacks.","commonSituations":"Adding a new DependencyProperty to a custom Int3 editor without extending the mapping chain; copy-pasted property-changed handlers forwarding the wrong DP; base/editor-framework code assuming only vector-component properties change.","solutions":["Route only XProperty, YProperty, and ZProperty through UpdateValueFromComponent","Extend the if-chain when adding new component properties to a subclass","Override UpdateValueFromComponent in the subclass to handle custom properties","Log or inspect property.Name at the throw site to find the mis-routed dependency property"],"exampleFix":"// before\nif (property == ZProperty)\n    return Z.HasValue && Value.HasValue ? (Int3?)new Int3(Value.Value.X, Value.Value.Y, Z.Value) : null;\nthrow new ArgumentException(\"Property unsupported by method UpdateValueFromComponent.\");\n// after\nif (property == ZProperty)\n    return Z.HasValue && Value.HasValue ? (Int3?)new Int3(Value.Value.X, Value.Value.Y, Z.Value) : null;\nDebug.Assert(false, $\"Unexpected property {property.Name} in UpdateValueFromComponent\");\nreturn Value; // or handle explicitly before throwing","handlingStrategy":"validation","validationCode":"bool ok = property == Int3Editor.XProperty || property == Int3Editor.YProperty || property == Int3Editor.ZProperty;\nif (!ok) throw new InvalidOperationException($\"{property.Name} is not an Int3 component property\");","typeGuard":"bool IsInt3ComponentProperty(DependencyProperty p) => p == Int3Editor.XProperty || p == Int3Editor.YProperty || p == Int3Editor.ZProperty;","tryCatchPattern":"try { editor.UpdateValueFromComponent(prop); }\ncatch (ArgumentException ex) { log.Warn($\"Unsupported property for Int3Editor: {ex.Message}\"); }","preventionTips":["Route only X/Y/Z property changes into the component update path","Extend the chain when adding new DPs to subclasses","Assert in debug builds before calling the method"],"tags":["wpf","argumentexception","property-binding"],"backgroundTag":"invalid-argument-value","analyzedSha":"96fad776d210c221682aac1ccdf4c79dc046fc38","analyzedAt":"2026-09-14T02:59:31.279Z","contentChangedAt":"2026-09-14T02:59:31.279Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}