Dreamine.PLC.Wpf 1.0.1
Dreamine.PLC.Wpf 산업 자동화 및 I/O 기능을 제공합니다.
로딩중...
검색중...
일치하는것 없음
PlcConnectionStateBrushConverter.cs
이 파일의 문서화 페이지로 가기
1using System.Globalization;
2using System.Windows.Data;
3using System.Windows.Media;
4using Dreamine.PLC.Abstractions.Connections;
5
7
16public sealed class PlcConnectionStateBrushConverter : IValueConverter
17{
66 public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
67 {
68 return value switch
69 {
70 PlcConnectionState.Connected => Brushes.ForestGreen,
71 PlcConnectionState.Connecting => Brushes.DarkOrange,
72 PlcConnectionState.Disconnecting => Brushes.DarkOrange,
73 PlcConnectionState.Faulted => Brushes.Firebrick,
74 _ => Brushes.Gray
75 };
76 }
77
126 public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
127 {
128 return Binding.DoNothing;
129 }
130}
object Convert(object value, Type targetType, object parameter, CultureInfo culture)
object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)