Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit c622fd1

Browse files
authoredFeb 28, 2025··
fix
1 parent 01fa531 commit c622fd1

File tree

1 file changed

+33
-33
lines changed

1 file changed

+33
-33
lines changed
 
+33-33
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)
Please sign in to comment.