Ionite
1 year ago
2 changed files with 36 additions and 0 deletions
@ -0,0 +1,19 @@
|
||||
using System; |
||||
using System.Globalization; |
||||
using System.Windows; |
||||
using System.Windows.Data; |
||||
|
||||
namespace StabilityMatrix.Converters; |
||||
|
||||
public class NullToVisibilityConverter : IValueConverter |
||||
{ |
||||
public object Convert(object? value, Type targetType, object parameter, CultureInfo culture) |
||||
{ |
||||
return value == null ? Visibility.Collapsed : Visibility.Visible; |
||||
} |
||||
|
||||
public object ConvertBack(object? value, Type targetType, object parameter, CultureInfo culture) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
@ -0,0 +1,17 @@
|
||||
using System; |
||||
using System.Windows; |
||||
using System.Windows.Data; |
||||
|
||||
namespace StabilityMatrix.Converters; |
||||
|
||||
public class StringNullOrEmptyToVisibilityConverter : IValueConverter |
||||
{ |
||||
public object Convert(object? value, Type targetType, object parameter, System.Globalization.CultureInfo culture) |
||||
{ |
||||
return string.IsNullOrEmpty(value as string) ? Visibility.Collapsed : Visibility.Visible; |
||||
} |
||||
public object? ConvertBack(object? value, Type targetType, object parameter, System.Globalization.CultureInfo culture) |
||||
{ |
||||
return null; |
||||
} |
||||
} |
Loading…
Reference in new issue