using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
namespace Tango.SharedUI.Converters
{
///
/// Represents a binding converter for returning true for valid object instances and false for null object reference.
///
public class NullObjectToBooleanConverter : IValueConverter
{
///
/// Converts a value.
///
/// The value produced by the binding source.
/// The type of the binding target property.
/// The converter parameter to use.
/// The culture to use in the converter.
///
/// A converted value. If the method returns null, the valid null value is used.
///
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
return (value != null);
}
///
/// Converts a value.
///
/// The value that is produced by the binding target.
/// The type to convert to.
/// The converter parameter to use.
/// The culture to use in the converter.
///
/// A converted value. If the method returns null, the valid null value is used.
///
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
return value;
}
}
}