diff options
Diffstat (limited to 'Codemerx/Gestor.Application/Converters/ExpanderHeaderConverter.cs')
| -rw-r--r-- | Codemerx/Gestor.Application/Converters/ExpanderHeaderConverter.cs | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/Codemerx/Gestor.Application/Converters/ExpanderHeaderConverter.cs b/Codemerx/Gestor.Application/Converters/ExpanderHeaderConverter.cs new file mode 100644 index 0000000..66c167b --- /dev/null +++ b/Codemerx/Gestor.Application/Converters/ExpanderHeaderConverter.cs @@ -0,0 +1,41 @@ +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;
+ }
+ }
+}
\ No newline at end of file |