PIbd-42_Kashin_M.I_CPO_Cour.../EmployeeManagmentDataModels/Enums/BooleanToSalaryConverter.cs

29 lines
888 B
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System;
using System.Windows.Data;
namespace EmployeeManagmentDataModels.Enums
{
public class BooleanToSalaryConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value is bool booleanValue)
{
return booleanValue ? "Заплачено" : "Не заплачено";
}
return "Неизвестно";
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException("Обратное преобразование не поддерживается.");
}
}
}