Dreamine.UI.Wpf 1.0.1
Dreamine.UI.Wpf 사용자 인터페이스 기능과 구성 요소를 제공합니다.
로딩중...
검색중...
일치하는것 없음
NullToVisibilityConverter.cs
이 파일의 문서화 페이지로 가기
1using System.Globalization;
2using System.Windows;
3using System.Windows.Data;
4
6{
15 public class NullToVisibilityConverter : IValueConverter
16 {
25 public bool Inverse { get; set; } = false;
26
75 public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
76 {
77 bool visible = value != null;
78 if (Inverse)
79 visible = !visible;
80
81 return visible ? Visibility.Visible : Visibility.Collapsed;
82 }
83
140 public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
141 {
142 throw new NotSupportedException("NullToVisibilityConverter does not support ConvertBack.");
143 }
144 }
145}
object Convert(object value, Type targetType, object parameter, CultureInfo culture)
object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)