diff options
Diffstat (limited to 'Gestor.Common/Gestor.Common.Converters/TipoCriticaConverter.cs')
| -rw-r--r-- | Gestor.Common/Gestor.Common.Converters/TipoCriticaConverter.cs | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/Gestor.Common/Gestor.Common.Converters/TipoCriticaConverter.cs b/Gestor.Common/Gestor.Common.Converters/TipoCriticaConverter.cs new file mode 100644 index 0000000..b45f5d3 --- /dev/null +++ b/Gestor.Common/Gestor.Common.Converters/TipoCriticaConverter.cs @@ -0,0 +1,34 @@ +using System; +using System.Globalization; +using System.Windows.Data; + +namespace Gestor.Common.Converters; + +public class TipoCriticaConverter : IMultiValueConverter +{ + public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) + { + try + { + string text = (string)values[0]; + if (!(text == "0")) + { + if (!(text == "1")) + { + return ""; + } + return (string)values[2]; + } + return (string)values[1]; + } + catch (Exception) + { + return ""; + } + } + + public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) + { + return null; + } +} |