{"record":{"id":"17282aa7832dd805","repo":"dotnet/wpf","slug":"the-method-or-operation-is-not-implemented-17282a","errorCode":null,"errorMessage":"The method or operation is not implemented.","messagePattern":"The method or operation is not implemented\\.","errorType":"exception","errorClass":"NotImplementedException","httpStatus":null,"severity":"error","filePath":"src/Microsoft.DotNet.Wpf/src/ReachFramework/Serialization/ImageSourceTypeConverter.cs","lineNumber":115,"sourceCode":"        /// An Object that represents the converted value.\n        /// </returns>\n        public\n        override\n        object\n        ConvertFrom(\n            ITypeDescriptorContext              context,\n            System.Globalization.CultureInfo    culture,\n            object                              value\n            )\n        {\n            ArgumentNullException.ThrowIfNull(value);\n\n            if (!IsSupportedType(value.GetType()))\n            {\n                throw new NotSupportedException(SR.Converter_ConvertFromNotSupported);\n            }\n\n            throw new NotImplementedException();\n        }\n\n        /// <summary>\n        /// Converts the given value object to the specified type,\n        /// using the arguments.\n        /// </summary>\n        /// <param name=\"context\">\n        /// An ITypeDescriptorContext that provides a format context.\n        /// </param>\n        /// <param name=\"culture\">\n        /// A CultureInfo object. If null is passed, the current\n        /// culture is assumed.\n        /// </param>\n        /// <param name=\"value\">\n        /// The Object to convert.\n        /// </param>\n        /// <param name=\"destinationType\">\n        /// The Type to convert the value parameter to.","sourceCodeStart":97,"sourceCodeEnd":133,"githubUrl":"https://github.com/dotnet/wpf/blob/81131a70a4c573cd62748a5c36908fc4d662daa9/src/Microsoft.DotNet.Wpf/src/ReachFramework/Serialization/ImageSourceTypeConverter.cs#L97-L133","documentation":"This is the same unimplemented ImageSourceTypeConverter.ConvertFrom body: it validates null and supported type first, then always throws NotImplementedException. The library intentionally provides no from-conversion for image sources in XPS serialization; only ConvertTo is functional.","triggerScenarios":"Any invocation of ConvertFrom with a non-null value whose type passes IsSupportedType — the throw is unconditional after validation.","commonSituations":"Generic TypeConverter-based data binding or XAML loading of image source properties; unit tests exercising the full converter API surface.","solutions":["Use BitmapImage/BitmapFrame constructors instead of this converter's ConvertFrom.","Override or replace the converter if from-conversion is genuinely required.","Guard calls with a capability check or catch NotImplementedException."],"exampleFix":"// before\nobject result = converter.ConvertFrom(context, culture, stream);\n\n// after\nBitmapSource result = BitmapFrame.Create(stream);\nresult.Freeze();","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"try\n{\n    source = (BitmapSource)converter.ConvertFrom(context, culture, stream);\n}\ncatch (NotImplementedException)\n{\n    stream.Position = 0;\n    source = BitmapFrame.Create(stream);\n}","preventionTips":["Treat ConvertFrom on ImageSourceTypeConverter as permanently unsupported.","Use BitmapFrame.Create overloads (Uri, stream) for all image construction.","Add a unit test that exercises your conversion path so NotImplementedException surfaces early."],"tags":["wpf","xps","typeconverter","not-implemented"],"backgroundTag":"method-not-implemented","analyzedSha":"81131a70a4c573cd62748a5c36908fc4d662daa9","analyzedAt":"2026-09-14T10:12:48.479Z","contentChangedAt":"2026-09-14T10:12:48.479Z","schemaVersion":2},"datasetVersion":"2026-09-22T01:17:13.364Z"}