Dreamine.UI.Wpf 1.0.1
Dreamine.UI.Wpf 사용자 인터페이스 기능과 구성 요소를 제공합니다.
로딩중...
검색중...
일치하는것 없음
LedBrushConverter.cs
이 파일의 문서화 페이지로 가기
1using System;
2using System.Collections.Generic;
3using System.Globalization;
4using System.Linq;
5using System.Text;
6using System.Threading.Tasks;
7using System.Windows.Data;
8
10{
19 public sealed class LedBrushConverter : IMultiValueConverter
20 {
69 public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
70 {
71 bool isOn = (values != null && values.Length > 0 && values[0] is bool b) && b;
72 var onBrush = (values != null && values.Length > 1) ? values[1] : null;
73 var offBrush = (values != null && values.Length > 2) ? values[2] : null;
74 return (isOn ? onBrush : offBrush) ?? null!;
75 }
76
133 public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) =>
134 throw new NotSupportedException();
135 }
136}
object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)