Disable DElButton when nothing to delete

This commit is contained in:
2024-10-12 22:24:03 +02:00
parent ac1941b134
commit bd707ec0a0
2 changed files with 33 additions and 1 deletions

View File

@@ -0,0 +1,25 @@
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;
}
}