Skip to content

Commit c622fd1

Browse files
fix
1 parent 01fa531 commit c622fd1

File tree

1 file changed

+33
-33
lines changed

1 file changed

+33
-33
lines changed
Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
1-
using System;
2-
using Windows.UI;
3-
using Coder.Desktop.App.ViewModels;
4-
using Microsoft.UI.Xaml.Data;
5-
using Microsoft.UI.Xaml.Media;
6-
7-
namespace Coder.Desktop.App.Converters;
8-
9-
public class AgentStatusToColorConverter : IValueConverter
10-
{
11-
private static readonly SolidColorBrush Green = new(Color.FromArgb(255, 52, 199, 89));
12-
private static readonly SolidColorBrush Red = new(Color.FromArgb(255, 255, 59, 48));
13-
private static readonly SolidColorBrush Gray = new(Color.FromArgb(255, 142, 142, 147));
14-
private static readonly SolidColorBrush Yellow = new(Color.FromArgb(255, 204, 1, 0));
15-
16-
public object Convert(object value, Type targetType, object parameter, string language)
17-
{
18-
if (value is not AgentConnectionStatus status) return Gray;
19-
20-
return status switch
21-
{
22-
AgentConnectionStatus.Green => Green,
23-
AgentConnectionStatus.Red => Red,
24-
AgentConnectionStatus.Yellow => Yellow,
25-
_ => Gray,
26-
};
27-
}
28-
29-
public object ConvertBack(object value, Type targetType, object parameter, string language)
30-
{
31-
throw new NotImplementedException();
32-
}
33-
}
1+
using System;
2+
using Windows.UI;
3+
using Coder.Desktop.App.ViewModels;
4+
using Microsoft.UI.Xaml.Data;
5+
using Microsoft.UI.Xaml.Media;
6+
7+
namespace Coder.Desktop.App.Converters;
8+
9+
public class AgentStatusToColorConverter : IValueConverter
10+
{
11+
private static readonly SolidColorBrush Green = new(Color.FromArgb(255, 52, 199, 89));
12+
private static readonly SolidColorBrush Red = new(Color.FromArgb(255, 255, 59, 48));
13+
private static readonly SolidColorBrush Gray = new(Color.FromArgb(255, 142, 142, 147));
14+
private static readonly SolidColorBrush Yellow = new(Color.FromArgb(255, 204, 1, 0));
15+
16+
public object Convert(object value, Type targetType, object parameter, string language)
17+
{
18+
if (value is not AgentConnectionStatus status) return Gray;
19+
20+
return status switch
21+
{
22+
AgentConnectionStatus.Green => Green,
23+
AgentConnectionStatus.Red => Red,
24+
AgentConnectionStatus.Yellow => Yellow,
25+
_ => Gray,
26+
};
27+
}
28+
29+
public object ConvertBack(object value, Type targetType, object parameter, string language)
30+
{
31+
throw new NotImplementedException();
32+
}
33+
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy