using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;

namespace Ion.Sdk.DemoApp.Framework.Converters
{
    /// <summary>
    /// Converts value to Visibility. Returns Visible when value is null.
    /// </summary>
    public class NullToVisibilityConverter:IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value == null)
                return Visibility.Visible;
            return Visibility.Collapsed;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
