26 lines
590 B
C#
26 lines
590 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Globalization;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Jugenddienst_Stunden.Converter;
|
|
public class IntBoolConverter : IValueConverter {
|
|
|
|
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture) {
|
|
if (value is int) {
|
|
return (int)value != 0;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
|
|
public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) {
|
|
if (value is bool) {
|
|
return (bool)value ? 1 : 0;
|
|
}
|
|
return 0;
|
|
}
|
|
}
|