1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-13 05:48:35 +00:00
Artemis/src/Artemis.UI/Converters/NullToVisibilityConverter.cs
SpoinkyNL f917728ac8 Profile editor - Fixed new layers not saving in some situations
Profile tree - Improved buttons visibility
Layer brushes - Support transformation by default, unless a RGB.NET brush
2020-06-11 21:16:13 +02:00

41 lines
1.1 KiB
C#

using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
namespace Artemis.UI.Converters
{
public class NullToVisibilityConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
Parameters direction;
if (parameter == null)
direction = Parameters.Normal;
else
direction = (Parameters) Enum.Parse(typeof(Parameters), (string) parameter);
if (direction == Parameters.Normal)
{
if (value == null)
return Visibility.Collapsed;
return Visibility.Visible;
}
if (value == null)
return Visibility.Visible;
return Visibility.Collapsed;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
private enum Parameters
{
Normal,
Inverted
}
}
}