Files
FModel/FModel/Views/Resources/Converters/DateTimeToStringConverter.cs
GMatrixGames e21a3be55b Update/net7 (#290)
* file-scoped namespace & net7.0

* Workflow
2022-06-11 20:07:59 -04:00

20 lines
639 B
C#

using System;
using System.Globalization;
using System.Windows.Data;
namespace FModel.Views.Resources.Converters;
public class DateTimeToStringConverter : IValueConverter
{
public static readonly DateTimeToStringConverter Instance = new();
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
return value is not DateTime dateTime ? value : $"{dateTime.ToLongDateString()}, {dateTime.ToShortTimeString()}";
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}