728x90
728x170
public class BooleanToVisibilityConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (true.Equals(value))
{
return Visibility.Visible;
}
if ("Hidden".Equals((parameter ?? "").ToString()))
{
return Visibility.Hidden;
}
return Visibility.Collapsed;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
728x90
그리드형
'C# > WPF' 카테고리의 다른 글
[WPF] StringFormat 으로 소수점 세자리 표시 및 문자열 넣기 (0) | 2022.04.18 |
---|---|
[WPF] ComboBox Command Binding 하기 (0) | 2022.04.15 |
[WPF] Action 비동기 수행하기 (0) | 2022.04.01 |
[WPF] DevExpress 컨트롤 이용한 Waiting/Progress Dialog 띄우기 (0) | 2022.03.21 |
[WPF] Image to BitmapImage(ImageSource) (0) | 2022.02.18 |