I\'m deep in a XAML stack of elements binding to orders.
The order date displays as e.g. \"12/31/2008 12:00:00 AM\".
I want it to display as e.g. \"31.12
XAML
C#
public class DateTimeConverter : IValueConverter
{
public object Convert(object value,
Type targetType,
object parameter,
CultureInfo culture)
{
if (value != null)
{
return ((DateTime)value).ToString("dd.MM.yyyy");
}
else
{
return String.Empty;
}
}
public object ConvertBack(object value,
Type targetType,
object parameter,
CultureInfo culture)
{
return DateTime.Parse(value.ToString());
}
}