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

namespace NorthwindBackend
{
	/// <summary>
	/// This converter converts null/not null to Visibility.Collapsed/Visible. It is used 
	/// to hide the Product info panel when there is no selected product.
	/// </summary>
	public class VisibilityNullConverter : IValueConverter
	{
		public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
		{
			return value == null ? Visibility.Collapsed : Visibility.Visible;
		}

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