|
1 |
| -usingSystem; |
2 |
| -usingWindows.UI; |
3 |
| -usingCoder.Desktop.App.ViewModels; |
4 |
| -usingMicrosoft.UI.Xaml.Data; |
5 |
| -usingMicrosoft.UI.Xaml.Media; |
6 |
| - |
7 |
| -namespaceCoder.Desktop.App.Converters; |
8 |
| - |
9 |
| -publicclassAgentStatusToColorConverter:IValueConverter |
10 |
| -{ |
11 |
| -privatestaticreadonlySolidColorBrushGreen=new(Color.FromArgb(255,52,199,89)); |
12 |
| -privatestaticreadonlySolidColorBrushRed=new(Color.FromArgb(255,255,59,48)); |
13 |
| -privatestaticreadonlySolidColorBrushGray=new(Color.FromArgb(255,142,142,147)); |
14 |
| -privatestaticreadonlySolidColorBrushYellow=new(Color.FromArgb(255,204,1,0)); |
15 |
| - |
16 |
| -publicobjectConvert(objectvalue,TypetargetType,objectparameter,stringlanguage) |
17 |
| -{ |
18 |
| -if(valueis notAgentConnectionStatusstatus)returnGray; |
19 |
| - |
20 |
| -returnstatusswitch |
21 |
| -{ |
22 |
| -AgentConnectionStatus.Green=>Green, |
23 |
| -AgentConnectionStatus.Red=>Red, |
24 |
| -AgentConnectionStatus.Yellow=>Yellow, |
25 |
| - _=>Gray, |
26 |
| -}; |
27 |
| -} |
28 |
| - |
29 |
| -publicobjectConvertBack(objectvalue,TypetargetType,objectparameter,stringlanguage) |
30 |
| -{ |
31 |
| -thrownewNotImplementedException(); |
32 |
| -} |
33 |
| -} |
| 1 | +usingSystem; |
| 2 | +usingWindows.UI; |
| 3 | +usingCoder.Desktop.App.ViewModels; |
| 4 | +usingMicrosoft.UI.Xaml.Data; |
| 5 | +usingMicrosoft.UI.Xaml.Media; |
| 6 | + |
| 7 | +namespaceCoder.Desktop.App.Converters; |
| 8 | + |
| 9 | +publicclassAgentStatusToColorConverter:IValueConverter |
| 10 | +{ |
| 11 | +privatestaticreadonlySolidColorBrushGreen=new(Color.FromArgb(255,52,199,89)); |
| 12 | +privatestaticreadonlySolidColorBrushRed=new(Color.FromArgb(255,255,59,48)); |
| 13 | +privatestaticreadonlySolidColorBrushGray=new(Color.FromArgb(255,142,142,147)); |
| 14 | +privatestaticreadonlySolidColorBrushYellow=new(Color.FromArgb(255,204,1,0)); |
| 15 | + |
| 16 | +publicobjectConvert(objectvalue,TypetargetType,objectparameter,stringlanguage) |
| 17 | +{ |
| 18 | +if(valueis notAgentConnectionStatusstatus)returnGray; |
| 19 | + |
| 20 | +returnstatusswitch |
| 21 | +{ |
| 22 | +AgentConnectionStatus.Green=>Green, |
| 23 | +AgentConnectionStatus.Red=>Red, |
| 24 | +AgentConnectionStatus.Yellow=>Yellow, |
| 25 | + _=>Gray, |
| 26 | +}; |
| 27 | +} |
| 28 | + |
| 29 | +publicobjectConvertBack(objectvalue,TypetargetType,objectparameter,stringlanguage) |
| 30 | +{ |
| 31 | +thrownewNotImplementedException(); |
| 32 | +} |
| 33 | +} |