mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 19:26:39 +02:00
26 lines
689 B
C#
26 lines
689 B
C#
using System;
|
|
using System.Globalization;
|
|
using System.Windows;
|
|
|
|
namespace Wox.Converters
|
|
{
|
|
class VisibilityConverter : ConvertorBase<VisibilityConverter>
|
|
{
|
|
public override object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
if (value == null || value == DependencyProperty.UnsetValue)
|
|
{
|
|
return null;
|
|
}
|
|
|
|
return bool.Parse(value.ToString()) ? Visibility.Visible : Visibility.Collapsed;
|
|
}
|
|
|
|
public override object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
return null;
|
|
}
|
|
}
|
|
|
|
}
|