/// <summary>
        /// Converts the value into a string.
        /// </summary>
        public override string ConvertToString(object value, IValueSerializerContext context)
        {
            if (value is PathFigureCollection)
            {
                PathFigureCollection instance = (PathFigureCollection)value;
                // When invoked by the serialization engine we can convert to string only for some instances
                #pragma warning suppress 6506 // instance is obviously not null
                if (!instance.CanSerializeToString())
                {
                    // Let base throw an exception.
                    return(base.ConvertToString(value, context));
                }


                #pragma warning suppress 6506 // instance is obviously not null
                return(instance.ConvertToString(null, System.Windows.Markup.TypeConverterHelper.InvariantEnglishUS));
            }

            return(base.ConvertToString(value, context));
        }