first edit

This commit is contained in:
Курнат Андрей
2026-01-31 16:11:36 +03:00
commit f0e11d6379
148 changed files with 6986 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
using System;
using System.Windows.Data;
using System.Globalization;
namespace XLIMS.MVVM.Converters
{
[ValueConversion(typeof(DateTime), typeof(string))]
public class DateConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (!(value is DateTime)) return string.Empty;
DateTime test = (DateTime)value;
string date = test.ToString();
return (date);
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
var strValue = value.ToString();
DateTime resultDateTime;
return DateTime.TryParse(strValue, out resultDateTime) ? resultDateTime : value;
}
}
}