24 lines
611 B
C#
24 lines
611 B
C#
// Copyright (c) 2023 schick Informatik
|
|
// Description: Helper for combobox binding of bool to combobox
|
|
//
|
|
|
|
using System;
|
|
using System.Globalization;
|
|
using System.Windows.Data;
|
|
|
|
namespace BreCalClient
|
|
{
|
|
public class BoolToIndexConverter : IValueConverter
|
|
{
|
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
return ((bool) value == true) ? 0 : 1;
|
|
}
|
|
|
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
return ((int)value == 0);
|
|
}
|
|
}
|
|
}
|