Head material was added
This commit is contained in:
33
Infrastructure/UI/Converters/Common/InvertBoolConverter.cs
Normal file
33
Infrastructure/UI/Converters/Common/InvertBoolConverter.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace StructureHelper.Infrastructure.UI.Converters.Common
|
||||
{
|
||||
[ValueConversion(typeof(bool), typeof(bool))]
|
||||
public class InvertBoolConverter : IValueConverter
|
||||
{
|
||||
public InvertBoolConverter()
|
||||
{
|
||||
}
|
||||
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
if (value != null && value is bool)
|
||||
{
|
||||
return !((bool)value);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
return Convert(value, targetType, parameter, culture);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user