diff options
Diffstat (limited to 'Gestor.Common/Gestor.Common.Converters/TipoTelefoneVisibilityConverter.cs')
| -rw-r--r-- | Gestor.Common/Gestor.Common.Converters/TipoTelefoneVisibilityConverter.cs | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/Gestor.Common/Gestor.Common.Converters/TipoTelefoneVisibilityConverter.cs b/Gestor.Common/Gestor.Common.Converters/TipoTelefoneVisibilityConverter.cs new file mode 100644 index 0000000..d857625 --- /dev/null +++ b/Gestor.Common/Gestor.Common.Converters/TipoTelefoneVisibilityConverter.cs @@ -0,0 +1,37 @@ +using System; +using System.Globalization; +using System.Windows; +using System.Windows.Data; +using Gestor.Model.Common; + +namespace Gestor.Common.Converters; + +public class TipoTelefoneVisibilityConverter : IMultiValueConverter +{ + public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) + { + //IL_0019: Unknown result type (might be due to invalid IL or missing references) + //IL_001e: Unknown result type (might be due to invalid IL or missing references) + //IL_001f: Unknown result type (might be due to invalid IL or missing references) + //IL_0021: Invalid comparison between Unknown and I4 + if (values[0] == null) + { + return (object)(Visibility)2; + } + if (values[0] is TipoTelefone val && (int)val != 3) + { + return (object)(Visibility)2; + } + object obj = values[1]; + if (obj is bool && (bool)obj) + { + return (object)(Visibility)2; + } + return (object)(Visibility)0; + } + + public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) + { + return null; + } +} |