[]
Represents a Binding converter that converts a DateTime to one of its string representations.
[ValueConversion(typeof(DateTime), typeof(string))]
public class DateTimeToStringConverter : IValueConverter
DateTimeToStringConverter is a two-way converter. The source value must be the DateTime, and a target value is a string that represents the DateTime according to a format specifier defined in a converter parameter. The format specifier definition rules are the same as used in the System.DateTime.ToString(format) method. A back conversion is performed via the DateTime.DateTime.TryParseExact method if converter parameter is specified; otherwise, the DateTime.DateTime.TryParse method is used.
Name | Description |
---|---|
DateTimeToStringConverter() | Initializes a new instance of the DateTimeToStringConverter. |
Name | Description |
---|---|
Default | Gets an instance of DateTimeToStringConverter. |
Name | Description |
---|---|
Convert(object, Type, object, CultureInfo) | Converts a value. The data binding engine calls this method when it propagates a value from the binding source to the binding target. |
ConvertBack(object, Type, object, CultureInfo) | Converts a value. The data binding engine calls this method when it propagates a value from the binding target to the binding source. |