Merge 55ace6e1e9bcd45b8064cac7d1a28b08de02708e into f5dcdf0af998ca81402c2f0c78186571abd05428
This commit is contained in:
commit
04f06317b4
32
Filtration/Converters/InverseBooleanVisibilityConverter.cs
Normal file
32
Filtration/Converters/InverseBooleanVisibilityConverter.cs
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
using System;
|
||||||
|
using System.Globalization;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Data;
|
||||||
|
|
||||||
|
namespace Filtration.Converters
|
||||||
|
{
|
||||||
|
internal class InverseBooleanVisibilityConverter : IValueConverter
|
||||||
|
{
|
||||||
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||||
|
{
|
||||||
|
if (value is bool && targetType == typeof (Visibility))
|
||||||
|
{
|
||||||
|
if ((bool) value)
|
||||||
|
return Visibility.Collapsed;
|
||||||
|
if (parameter is Visibility)
|
||||||
|
return parameter;
|
||||||
|
return Visibility.Visible;
|
||||||
|
}
|
||||||
|
if (value != null)
|
||||||
|
return Visibility.Collapsed;
|
||||||
|
if (parameter is Visibility)
|
||||||
|
return parameter;
|
||||||
|
return Visibility.Visible;
|
||||||
|
}
|
||||||
|
|
||||||
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user