Implemented update system
This commit is contained in:
31
Converters/BoolToVisibilityConverter.cs
Normal file
31
Converters/BoolToVisibilityConverter.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Windows;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace DebtMgr.Converters
|
||||
{
|
||||
[ValueConversion(typeof(bool), typeof(Visibility))]
|
||||
public class BoolToVisibilityConverter : IValueConverter
|
||||
{
|
||||
public Visibility TrueValue { get; set; }
|
||||
public Visibility FalseValue { get; set; }
|
||||
|
||||
public BoolToVisibilityConverter()
|
||||
{
|
||||
// set defaults
|
||||
FalseValue = Visibility.Hidden;
|
||||
TrueValue = Visibility.Visible;
|
||||
}
|
||||
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
return (bool)value ? TrueValue : FalseValue;
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user