using System; using System.Globalization; using System.Windows.Data; using System.Windows.Markup; namespace Gestor.Application.Converters { public class ExpanderHeaderConverter : MarkupExtension, IValueConverter { public ExpanderHeaderConverter() { } public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { if (value == null) { return ""; } if (!(value is bool)) { return ""; } if (!(bool)value) { return string.Format("MOSTRAR {0}", parameter); } return string.Format("OCULTAR {0}", parameter); } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { return null; } public override object ProvideValue(IServiceProvider serviceProvider) { return this; } } }