dotnet/wpf · error · NotImplementedException

The method or operation is not implemented.

Error message

The method or operation is not implemented.

What it means

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.

Solutions

  1. Bypass the converter and construct the font object (FontFamily, Typeface, GlyphRun) directly.
  2. Handle NotImplementedException if the converter is invoked by framework code you cannot change.
  3. Substitute a custom TypeConverter with a real ConvertFrom implementation.
  4. Refactor calling code to not rely on conversion-from for fonts.

Example fix

// before
var glyphRun = (GlyphRun)converter.ConvertFrom(null, null, data);
// after
var glyphRun = BuildGlyphRunFromData(data); // own construction logic
Defensive patterns

Strategy: try-catch

Try / catch

try { return converter.ConvertFrom(context, culture, value); }
catch (NotImplementedException) { return ConstructFontDirectly(value); }

Prevention

When it happens

Trigger: Any successful path through FontTypeConverter.ConvertFrom with a value type that passes IsSupportedType.

Common situations: Indirect invocation from XAML/TypeDescriptor or serialization frameworks that honor TypeConverter contracts.

Related errors


AI-assisted analysis of dotnet/wpf@81131a70a4 (2026-09-14). Data as JSON: /api/errors/c70d52fabc512838. Report an issue: GitHub.

Appendix: source

Thrown at src/Microsoft.DotNet.Wpf/src/ReachFramework/Serialization/FontTypeConverter.cs:109

        /// <returns>
        /// An Object that represents the converted value.
        /// </returns>
        public
        override
        object
        ConvertFrom(
            ITypeDescriptorContext              context,
            System.Globalization.CultureInfo    culture,
            object                              value
            )
        {
            ArgumentNullException.ThrowIfNull(value);
            if (!IsSupportedType(value.GetType()))
            {
                throw new NotSupportedException(SR.Converter_ConvertFromNotSupported);
            }

            throw new NotImplementedException();
        }

        /// <summary>
        /// Converts the given value object to the specified type,
        /// using the arguments.
        /// </summary>
        /// <param name="context">
        /// An ITypeDescriptorContext that provides a format context.
        /// </param>
        /// <param name="culture">
        /// A CultureInfo object. If null is passed, the current
        /// culture is assumed.
        /// </param>
        /// <param name="value">
        /// The Object to convert.
        /// </param>
        /// <param name="destinationType">
        /// The Type to convert the value parameter to.

View on GitHub (pinned to 81131a70a4)