Dreamine.UI.Wpf 1.0.1
Dreamine.UI.Wpf 사용자 인터페이스 기능과 구성 요소를 제공합니다.
로딩중...
검색중...
일치하는것 없음
EmptyStringToVisibilityConverter.cs
이 파일의 문서화 페이지로 가기
1using System.Globalization;
2using System.Windows;
3using System.Windows.Data;
4
6
15public class EmptyStringToVisibilityConverter : IValueConverter
16{
25 public bool Invert { get; set; } = false;
34 public bool UseHidden { get; set; } = false;
35
84 public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
85 {
86 bool isNullOrEmpty = string.IsNullOrWhiteSpace(value as string);
87
88 if (Invert)
89 isNullOrEmpty = !isNullOrEmpty;
90
91 return !isNullOrEmpty ? Visibility.Visible : (UseHidden ? Visibility.Hidden : Visibility.Collapsed);
92 }
93
150 public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
151 {
152 throw new NotImplementedException();
153 }
154}
object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
object Convert(object value, Type targetType, object parameter, CultureInfo culture)