DateTimeValueSerializer.ConvertFromString Method (String, IValueSerializerContext)

 

Converts a String into a DateTime.

Namespace:   System.Windows.Markup
Assembly:  System.Xaml (in System.Xaml.dll)

public override object ConvertFromString(
	string value,
	IValueSerializerContext context
)

Parameters

value
Type: System.String

The string to convert into a DateTime.

context
Type: System.Windows.Markup.IValueSerializerContext

Context information that is used for conversion.

Return Value

Type: System.Object

A new instance of DateTime based on the supplied value.

Exception Condition
NotSupportedException

value is null.

An empty string returns DateTime.MinValue.

The current implementation uses Parse internally, and also uses the following DateTimeStyles: DateTimeStyles.RoundtripKind | DateTimeStyles.NoCurrentDateDefault | DateTimeStyles.AllowLeadingWhite | DateTimeStyles.AllowTrailingWhite.

.NET Framework
Available since 3.0
Return to top
Show: