{"record":{"id":"c70d52fabc512838","repo":"dotnet/wpf","slug":"the-method-or-operation-is-not-implemented-fonttypeconverter","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/FontTypeConverter.cs","lineNumber":109,"sourceCode":"        /// <returns>\n        /// 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            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":91,"sourceCodeEnd":127,"githubUrl":"https://github.com/dotnet/wpf/blob/81131a70a4c573cd62748a5c36908fc4d662daa9/src/Microsoft.DotNet.Wpf/src/ReachFramework/Serialization/FontTypeConverter.cs#L91-L127","documentation":"FontTypeConverter.ConvertFrom ends with an unconditional 'throw new NotImplementedException()': even when the input type is supported, conversion from is not implemented in ReachFramework's font converter.","triggerScenarios":"Any successful path through FontTypeConverter.ConvertFrom with a value type that passes IsSupportedType.","commonSituations":"Indirect invocation from XAML/TypeDescriptor or serialization frameworks that honor TypeConverter contracts.","solutions":["Bypass the converter and construct the font object (FontFamily, Typeface, GlyphRun) directly.","Handle NotImplementedException if the converter is invoked by framework code you cannot change.","Substitute a custom TypeConverter with a real ConvertFrom implementation.","Refactor calling code to not rely on conversion-from for fonts."],"exampleFix":"// before\nvar glyphRun = (GlyphRun)converter.ConvertFrom(null, null, data);\n// after\nvar glyphRun = BuildGlyphRunFromData(data); // own construction logic","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { return converter.ConvertFrom(context, culture, value); }\ncatch (NotImplementedException) { return ConstructFontDirectly(value); }","preventionTips":["Build FontFamily/Typeface/GlyphRun directly instead of via converter.","Do not wire FontTypeConverter into XAML conversion paths.","Provide a custom TypeConverter where conversion-from is genuinely needed."],"tags":["wpf","type-converter","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"}