diff --git a/Netling.Client/App.xaml b/Netling.Client/App.axaml
similarity index 51%
rename from Netling.Client/App.xaml
rename to Netling.Client/App.axaml
index 3d850f1..c26c844 100644
--- a/Netling.Client/App.xaml
+++ b/Netling.Client/App.axaml
@@ -1,9 +1,15 @@
+ xmlns="https://github.com/avaloniaui"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
+
+
+
+
+
+
+
-
+
@@ -11,4 +17,4 @@
-
+
\ No newline at end of file
diff --git a/Netling.Client/App.axaml.cs b/Netling.Client/App.axaml.cs
new file mode 100644
index 0000000..c29caa5
--- /dev/null
+++ b/Netling.Client/App.axaml.cs
@@ -0,0 +1,24 @@
+using Avalonia;
+using Avalonia.Controls.ApplicationLifetimes;
+using Avalonia.Markup.Xaml;
+
+namespace Netling.Client
+{
+ public partial class App : Application
+ {
+ public override void Initialize()
+ {
+ AvaloniaXamlLoader.Load(this);
+ }
+
+ public override void OnFrameworkInitializationCompleted()
+ {
+ if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
+ {
+ desktop.MainWindow = new MainWindow();
+ }
+
+ base.OnFrameworkInitializationCompleted();
+ }
+ }
+}
\ No newline at end of file
diff --git a/Netling.Client/App.xaml.cs b/Netling.Client/App.xaml.cs
deleted file mode 100644
index 56ed28b..0000000
--- a/Netling.Client/App.xaml.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-using System.Windows;
-
-namespace Netling.Client
-{
- ///
- /// Interaction logic for App.xaml
- ///
- public partial class App : Application
- {
- }
-}
diff --git a/Netling.Client/LineGraphControl.xaml b/Netling.Client/LineGraphControl.axaml
similarity index 62%
rename from Netling.Client/LineGraphControl.xaml
rename to Netling.Client/LineGraphControl.axaml
index 0ae9ba4..5657df6 100644
--- a/Netling.Client/LineGraphControl.xaml
+++ b/Netling.Client/LineGraphControl.axaml
@@ -1,12 +1,12 @@
-
-
+
\ No newline at end of file
diff --git a/Netling.Client/LineGraphControl.axaml.cs b/Netling.Client/LineGraphControl.axaml.cs
new file mode 100644
index 0000000..438595b
--- /dev/null
+++ b/Netling.Client/LineGraphControl.axaml.cs
@@ -0,0 +1,69 @@
+using System.Collections.Generic;
+using OxyPlot;
+using OxyPlot.Axes;
+using OxyPlot.Series;
+using Avalonia.Controls;
+using Avalonia.Input;
+using Avalonia.Interactivity;
+using Avalonia.Markup.Xaml;
+
+namespace Netling.Client;
+
+public partial class LineGraphControl : UserControl
+{
+ public LineGraphControl()
+ {
+ InitializeComponent();
+ }
+
+ public void Draw(IEnumerable points, string? trackerFormatString = null)
+ {
+ var plotModel = new PlotModel
+ {
+ PlotMargins = new OxyThickness(0),
+ PlotAreaBorderThickness = new OxyThickness(0)
+ };
+
+ plotModel.Axes.Add(new LinearAxis
+ {
+ MinimumPadding = 0.01,
+ MaximumPadding = 0.01,
+ IsAxisVisible = false,
+ IsZoomEnabled = false,
+ IsPanEnabled = false,
+ Position = AxisPosition.Bottom
+ });
+
+ plotModel.Axes.Add(new LinearAxis
+ {
+ Minimum = 0.0,
+ MaximumPadding = 0.1,
+ TickStyle = TickStyle.None,
+ MajorGridlineStyle = LineStyle.Solid,
+ MinorGridlineStyle = LineStyle.Dot,
+ IsZoomEnabled = false,
+ IsPanEnabled = false,
+ LabelFormatter = d => "",
+ AxisTickToLabelDistance = 0
+ });
+
+ var ls = new LineSeries
+ {
+ Color = OxyColor.Parse("#ff0079c5"),
+ CanTrackerInterpolatePoints = false
+ };
+
+ if (trackerFormatString != null)
+ {
+ ls.TrackerFormatString = trackerFormatString;
+ }
+
+ foreach (var point in points)
+ {
+ ls.Points.Add(point);
+ }
+
+ plotModel.Series.Add(ls);
+ Graph.Model = plotModel;
+ }
+}
\ No newline at end of file
diff --git a/Netling.Client/LineGraphControl.xaml.cs b/Netling.Client/LineGraphControl.xaml.cs
deleted file mode 100644
index db91cf6..0000000
--- a/Netling.Client/LineGraphControl.xaml.cs
+++ /dev/null
@@ -1,66 +0,0 @@
-using System.Collections.Generic;
-using OxyPlot;
-using OxyPlot.Axes;
-using OxyPlot.Series;
-
-namespace Netling.Client
-{
- public partial class LineGraphControl
- {
- public LineGraphControl()
- {
- InitializeComponent();
- }
-
- public void Draw(IEnumerable points, string trackerFormatString = null)
- {
- var plotModel = new PlotModel
- {
- PlotMargins = new OxyThickness(0),
- PlotAreaBorderThickness = new OxyThickness(0)
- };
-
- plotModel.Axes.Add(new LinearAxis
- {
- MinimumPadding = 0.01,
- MaximumPadding = 0.01,
- IsAxisVisible = false,
- IsZoomEnabled = false,
- IsPanEnabled = false,
- Position = AxisPosition.Bottom
- });
-
- plotModel.Axes.Add(new LinearAxis
- {
- Minimum = 0.0,
- MaximumPadding = 0.1,
- TickStyle = TickStyle.None,
- MajorGridlineStyle = LineStyle.Solid,
- MinorGridlineStyle = LineStyle.Dot,
- IsZoomEnabled = false,
- IsPanEnabled = false,
- LabelFormatter = d => "",
- AxisTickToLabelDistance = 0
- });
-
- var ls = new LineSeries
- {
- Color = OxyColor.Parse("#ff0079c5"),
- CanTrackerInterpolatePoints = false
- };
-
- if (trackerFormatString != null)
- {
- ls.TrackerFormatString = trackerFormatString;
- }
-
- foreach (var point in points)
- {
- ls.Points.Add(point);
- }
-
- plotModel.Series.Add(ls);
- Graph.Model = plotModel;
- }
- }
-}
diff --git a/Netling.Client/MainWindow.xaml b/Netling.Client/MainWindow.axaml
similarity index 55%
rename from Netling.Client/MainWindow.xaml
rename to Netling.Client/MainWindow.axaml
index 5204192..24de81f 100644
--- a/Netling.Client/MainWindow.xaml
+++ b/Netling.Client/MainWindow.axaml
@@ -1,16 +1,28 @@
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
+ Title="Netling" Width="500" Height="223">
-
-
+
+
+
+
+
+
+
+
+
-
-
+
+
10 seconds
20 seconds
1 minute
@@ -25,11 +37,16 @@
-
-
-
-
-
+
+
+
+
-
+
\ No newline at end of file
diff --git a/Netling.Client/MainWindow.xaml.cs b/Netling.Client/MainWindow.axaml.cs
similarity index 83%
rename from Netling.Client/MainWindow.xaml.cs
rename to Netling.Client/MainWindow.axaml.cs
index 7d12877..3ab504e 100644
--- a/Netling.Client/MainWindow.xaml.cs
+++ b/Netling.Client/MainWindow.axaml.cs
@@ -1,26 +1,32 @@
using System;
using System.Collections.Generic;
+using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Globalization;
+using System.Linq;
+using System.Text;
using System.Threading;
using System.Threading.Tasks;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Input;
+using Avalonia;
+using Avalonia.Controls;
+using Avalonia.Input;
+using Avalonia.Interactivity;
using Netling.Core;
using Netling.Core.Models;
using Netling.Core.SocketWorker;
+using Netling.Core.SocketWorker.Performance;
namespace Netling.Client
{
- public partial class MainWindow
+ public partial class MainWindow : Window
{
private bool _running;
private CancellationTokenSource _cancellationTokenSource;
private Task _task;
- private List _resultWindows;
+ private readonly List _resultWindows;
private ResultWindowItem _baselineResult;
+ private readonly IList> _threadItems = new List>();
public MainWindow()
{
@@ -29,24 +35,26 @@ public MainWindow()
Thread.CurrentThread.CurrentUICulture = new CultureInfo("en");
Thread.CurrentThread.CurrentCulture = new CultureInfo("en");
Thread.CurrentThread.CurrentCulture.NumberFormat.NumberGroupSeparator = " ";
- Loaded += OnLoaded;
+ Opened += OnLoaded;
+
+#if DEBUG
+ this.AttachDevTools();
+#endif
}
- private void OnLoaded(object sender, RoutedEventArgs routedEventArgs)
+ private void OnLoaded(object sender, EventArgs routedEventArgs)
{
- Threads.SelectedValuePath = "Key";
- Threads.DisplayMemberPath = "Value";
-
for (var i = 1; i <= Environment.ProcessorCount; i++)
{
- Threads.Items.Add(new KeyValuePair(i, i.ToString()));
+ _threadItems.Add(new KeyValuePair(i, i.ToString()));
}
for (var i = 2; i <= 20; i++)
{
- Threads.Items.Add(new KeyValuePair(Environment.ProcessorCount * i, $"{Environment.ProcessorCount * i} - ({i} per core)"));
+ _threadItems.Add(new KeyValuePair(Environment.ProcessorCount * i, $"{Environment.ProcessorCount * i} - ({i} per core)"));
}
+ Threads.Items = _threadItems;
Threads.SelectedIndex = 0;
Url.Focus();
}
@@ -57,8 +65,8 @@ private async void StartButton_Click(object sender, RoutedEventArgs e)
{
var duration = default(TimeSpan);
int? count = null;
- var threads = Convert.ToInt32(((KeyValuePair)Threads.SelectionBoxItem).Key);
- var durationText = (string)((ComboBoxItem)Duration.SelectedItem).Content;
+ var threads = Convert.ToInt32(((KeyValuePair)Threads.SelectedItem).Key);
+ var durationText = (string)((ComboBoxItem)Duration.SelectedItem)?.Content ?? "10 seconds";
StatusProgressbar.IsIndeterminate = false;
switch (durationText)
@@ -102,7 +110,6 @@ private async void StartButton_Click(object sender, RoutedEventArgs e)
count = 10000;
StatusProgressbar.IsIndeterminate = true;
break;
-
}
if (string.IsNullOrWhiteSpace(Url.Text))
@@ -125,7 +132,7 @@ private async void StartButton_Click(object sender, RoutedEventArgs e)
var cancellationToken = _cancellationTokenSource.Token;
StatusProgressbar.Value = 0;
- StatusProgressbar.Visibility = Visibility.Visible;
+ StatusProgressbar.IsVisible = true;
var worker = new Worker(new SocketWorkerJob(uri));
@@ -138,10 +145,7 @@ private async void StartButton_Click(object sender, RoutedEventArgs e)
_task = worker.Run(uri.ToString(), threads, duration, cancellationToken);
}
- _task.GetAwaiter().OnCompleted(async () =>
- {
- await JobCompleted();
- });
+ _task.GetAwaiter().OnCompleted(async () => { await JobCompleted(); });
if (StatusProgressbar.IsIndeterminate)
{
@@ -152,7 +156,7 @@ private async void StartButton_Click(object sender, RoutedEventArgs e)
while (!cancellationToken.IsCancellationRequested && duration.TotalMilliseconds > sw.Elapsed.TotalMilliseconds)
{
- await Task.Delay(500);
+ await Task.Delay(500, cancellationToken);
StatusProgressbar.Value = 100.0 / duration.TotalMilliseconds * sw.Elapsed.TotalMilliseconds;
}
@@ -166,7 +170,7 @@ private async void StartButton_Click(object sender, RoutedEventArgs e)
}
else
{
- if (_cancellationTokenSource != null && !_cancellationTokenSource.IsCancellationRequested)
+ if (!_cancellationTokenSource.IsCancellationRequested)
{
_cancellationTokenSource.Cancel();
}
@@ -186,7 +190,7 @@ private void Urls_OnKeyUp(object sender, KeyEventArgs e)
private async Task JobCompleted()
{
- if (_cancellationTokenSource != null && !_cancellationTokenSource.IsCancellationRequested)
+ if (!_cancellationTokenSource.IsCancellationRequested)
{
_cancellationTokenSource.Cancel();
}
@@ -204,7 +208,7 @@ private async Task JobCompleted()
await result.Load(_task.Result, _baselineResult);
result.Show();
_task = null;
- StatusProgressbar.Visibility = Visibility.Hidden;
+ StatusProgressbar.IsVisible = false;
StartButton.IsEnabled = true;
StartButton.Content = "Run";
}
@@ -231,4 +235,4 @@ public void SetBaseline(ResultWindowItem baselineResult)
}
}
}
-}
+}
\ No newline at end of file
diff --git a/Netling.Client/Netling.Client.csproj b/Netling.Client/Netling.Client.csproj
index eded8d8..63c98dd 100644
--- a/Netling.Client/Netling.Client.csproj
+++ b/Netling.Client/Netling.Client.csproj
@@ -1,20 +1,35 @@
-
+
+
+ WinExe
+ net6.0
+ enable
+
+ copyused
+ true
+ netling-icon.ico
+
-
- WinExe
- net6.0-windows
- true
- netling-icon.ico
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
\ No newline at end of file
diff --git a/Netling.Client/Program.cs b/Netling.Client/Program.cs
new file mode 100644
index 0000000..9c8ea5a
--- /dev/null
+++ b/Netling.Client/Program.cs
@@ -0,0 +1,21 @@
+using Avalonia;
+using System;
+
+namespace Netling.Client
+{
+ class Program
+ {
+ // Initialization code. Don't use any Avalonia, third-party APIs or any
+ // SynchronizationContext-reliant code before AppMain is called: things aren't initialized
+ // yet and stuff might break.
+ [STAThread]
+ public static void Main(string[] args) => BuildAvaloniaApp()
+ .StartWithClassicDesktopLifetime(args);
+
+ // Avalonia configuration, don't remove; also used by visual designer.
+ public static AppBuilder BuildAvaloniaApp()
+ => AppBuilder.Configure()
+ .UsePlatformDetect()
+ .LogToTrace();
+ }
+}
\ No newline at end of file
diff --git a/Netling.Client/ResultWindow.xaml b/Netling.Client/ResultWindow.axaml
similarity index 87%
rename from Netling.Client/ResultWindow.xaml
rename to Netling.Client/ResultWindow.axaml
index 6a23768..dea5525 100644
--- a/Netling.Client/ResultWindow.xaml
+++ b/Netling.Client/ResultWindow.axaml
@@ -1,8 +1,10 @@
-
+
@@ -47,7 +49,7 @@
-
+
@@ -63,8 +65,8 @@
-
-
+
+
diff --git a/Netling.Client/ResultWindow.xaml.cs b/Netling.Client/ResultWindow.axaml.cs
similarity index 76%
rename from Netling.Client/ResultWindow.xaml.cs
rename to Netling.Client/ResultWindow.axaml.cs
index 974dd02..6a7e995 100644
--- a/Netling.Client/ResultWindow.xaml.cs
+++ b/Netling.Client/ResultWindow.axaml.cs
@@ -2,23 +2,38 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
-using System.Windows;
+using Avalonia;
+using Avalonia.Controls;
+using Avalonia.Interactivity;
using Netling.Core.Models;
using OxyPlot;
namespace Netling.Client
{
- public partial class ResultWindow
+ public partial class ResultWindow : Window
{
private ResultWindowItem _resultWindowItem;
private readonly MainWindow _sender;
+ public ResultWindow()
+ {
+ InitializeComponent(true);
+#if DEBUG
+ this.AttachDevTools();
+#endif
+ }
+
public ResultWindow(MainWindow sender)
{
_sender = sender;
- InitializeComponent();
+ InitializeComponent(true);
+#if DEBUG
+ this.AttachDevTools();
+#endif
}
+
+
public async Task Load(WorkerResult workerResult, ResultWindowItem baselineResult)
{
var taskResult = await GenerateAsync(workerResult);
@@ -44,14 +59,14 @@ public async Task Load(WorkerResult workerResult, ResultWindowItem baselineResul
if (workerResult.StatusCodes.Any(s => s.Key != 200))
{
- StatusCodesTab.Visibility = Visibility.Visible;
- StatusCodesListBox.ItemsSource = workerResult.StatusCodes
- .Select(s => new
- {
- Name = $"{s.Key} - {(s.Key > 0 ? ((System.Net.HttpStatusCode)s.Key).ToString() : "")}",
- Count = s.Value
- })
- .ToList();
+ StatusCodesTab.IsVisible = true;
+ StatusCodesListBox.Items = workerResult.StatusCodes
+ .Select(s => new
+ {
+ Name = $"{s.Key} - {(s.Key > 0 ? ((System.Net.HttpStatusCode)s.Key).ToString() : "")}",
+ Count = s.Value
+ })
+ .ToList();
if (!workerResult.Exceptions.Any())
{
@@ -61,7 +76,7 @@ public async Task Load(WorkerResult workerResult, ResultWindowItem baselineResul
if (workerResult.Exceptions.Any())
{
- ExceptionsTab.Visibility = Visibility.Visible;
+ ExceptionsTab.IsVisible = true;
ExceptionsTextBox.Text = string.Join("\r\n\r\n----\r\n\r\n", workerResult.Exceptions.Select(e => e.ToString()));
ExceptionsTab.Focus();
}
@@ -75,21 +90,21 @@ public async Task Load(WorkerResult workerResult, ResultWindowItem baselineResul
private Task GenerateAsync(WorkerResult workerResult)
{
return Task.Run(() =>
- {
- var result = ResultWindowItem.Parse(workerResult);
- var max = (int) Math.Floor(workerResult.Elapsed.TotalMilliseconds / 1000);
-
- var throughput = workerResult.Seconds
- .Where(r => r.Key < max && r.Value.Count > 0)
- .OrderBy(r => r.Key)
- .Select(r => new DataPoint(r.Key, r.Value.Count));
-
- return new JobTaskResult
- {
- ResultWindowItem = result,
- Throughput = throughput
- };
- });
+ {
+ var result = ResultWindowItem.Parse(workerResult);
+ var max = (int)Math.Floor(workerResult.Elapsed.TotalMilliseconds / 1000);
+
+ var throughput = workerResult.Seconds
+ .Where(r => r.Key < max && r.Value.Count > 0)
+ .OrderBy(r => r.Key)
+ .Select(r => new DataPoint(r.Key, r.Value.Count));
+
+ return new JobTaskResult
+ {
+ ResultWindowItem = result,
+ Throughput = throughput
+ };
+ });
}
private void UseBaseline(object sender, RoutedEventArgs e)
@@ -175,4 +190,4 @@ internal class JobTaskResult
public ResultWindowItem ResultWindowItem { get; set; }
public IEnumerable Throughput { get; set; }
}
-}
+}
\ No newline at end of file
diff --git a/Netling.Client/ValueUserControl.xaml b/Netling.Client/ValueUserControl.axaml
similarity index 50%
rename from Netling.Client/ValueUserControl.xaml
rename to Netling.Client/ValueUserControl.axaml
index af206da..8a2cb1e 100644
--- a/Netling.Client/ValueUserControl.xaml
+++ b/Netling.Client/ValueUserControl.axaml
@@ -1,28 +1,32 @@
-
-
-
-
+
+
+
-
-
+
+
-
-
-
-
+
+
+
+
+
+
-
+
\ No newline at end of file
diff --git a/Netling.Client/ValueUserControl.axaml.cs b/Netling.Client/ValueUserControl.axaml.cs
new file mode 100644
index 0000000..7de21d7
--- /dev/null
+++ b/Netling.Client/ValueUserControl.axaml.cs
@@ -0,0 +1,79 @@
+using Avalonia;
+using Avalonia.Controls;
+using Avalonia.Markup.Xaml;
+using Avalonia.Media;
+
+namespace Netling.Client;
+
+public partial class ValueUserControl : UserControl
+{
+ public ValueUserControl()
+ {
+ InitializeComponent(true);
+ }
+
+ public string Title
+ {
+ get { return TitleTextBlock.Text; }
+ set { TitleTextBlock.Text = value?.ToUpper(); }
+ }
+
+ public string Value
+ {
+ get { return ValueTextBlock.Text; }
+ set { ValueTextBlock.Text = value; }
+ }
+
+ public string Unit
+ {
+ get { return UnitTextBlock.Text; }
+ set { UnitTextBlock.Text = value?.ToLower(); }
+ }
+
+ public string BaselineValue
+ {
+ get { return BaselineValueTextBlock.Text; }
+ set
+ {
+ BaselineValueTextBlock.Text = value;
+ BaselineValueTextBlock.IsVisible = !string.IsNullOrWhiteSpace(value) ? true : false;
+ }
+ }
+
+ private BaseLine _baseLine;
+
+ public BaseLine BaseLine
+ {
+ get { return _baseLine; }
+ set
+ {
+ _baseLine = value;
+
+ switch (value)
+ {
+ case BaseLine.Equal:
+ ValueTextBlock.Foreground = new SolidColorBrush(Colors.Black);
+ UnitTextBlock.Foreground = new SolidColorBrush(Colors.Black);
+ ValueBorder.BorderBrush = new SolidColorBrush(Colors.DarkGray);
+ break;
+ case BaseLine.Worse:
+ ValueTextBlock.Foreground = new SolidColorBrush(Colors.Red);
+ UnitTextBlock.Foreground = new SolidColorBrush(Colors.Red);
+ ValueBorder.BorderBrush = new SolidColorBrush(Colors.Red);
+ break;
+ case BaseLine.Better:
+ ValueTextBlock.Foreground = new SolidColorBrush(Colors.Green);
+ UnitTextBlock.Foreground = new SolidColorBrush(Colors.Green);
+ ValueBorder.BorderBrush = new SolidColorBrush(Colors.Green);
+ break;
+ }
+ }
+ }
+}
+
+public enum BaseLine
+{
+ Equal,
+ Worse,
+ Better
+}
\ No newline at end of file
diff --git a/Netling.Client/ValueUserControl.xaml.cs b/Netling.Client/ValueUserControl.xaml.cs
deleted file mode 100644
index 54be6fa..0000000
--- a/Netling.Client/ValueUserControl.xaml.cs
+++ /dev/null
@@ -1,78 +0,0 @@
-using System.Windows;
-using System.Windows.Media;
-
-namespace Netling.Client
-{
- public partial class ValueUserControl
- {
- public ValueUserControl()
- {
- InitializeComponent();
- }
-
- public string Title
- {
- get { return TitleTextBlock.Text; }
- set { TitleTextBlock.Text = value?.ToUpper(); }
- }
-
- public string Value
- {
- get { return ValueTextBlock.Text; }
- set { ValueTextBlock.Text = value; }
- }
-
- public string Unit
- {
- get { return UnitTextBlock.Text; }
- set { UnitTextBlock.Text = value?.ToLower(); }
- }
-
- public string BaselineValue
- {
- get { return BaselineValueTextBlock.Text; }
- set
- {
- BaselineValueTextBlock.Text = value;
- BaselineValueTextBlock.Visibility = !string.IsNullOrWhiteSpace(value) ? Visibility.Visible : Visibility.Collapsed;
- }
- }
-
- private BaseLine _baseLine;
-
- public BaseLine BaseLine
- {
- get { return _baseLine; }
- set
- {
- _baseLine = value;
-
- switch (value)
- {
- case BaseLine.Equal:
- ValueTextBlock.Foreground = new SolidColorBrush(Colors.Black);
- UnitTextBlock.Foreground = new SolidColorBrush(Colors.Black);
- ValueBorder.BorderBrush = new SolidColorBrush(Colors.DarkGray);
- break;
- case BaseLine.Worse:
- ValueTextBlock.Foreground = new SolidColorBrush(Colors.Red);
- UnitTextBlock.Foreground = new SolidColorBrush(Colors.Red);
- ValueBorder.BorderBrush = (Brush)Application.Current.Resources["RedBrush"];
- break;
- case BaseLine.Better:
- ValueTextBlock.Foreground = new SolidColorBrush(Colors.Green);
- UnitTextBlock.Foreground = new SolidColorBrush(Colors.Green);
- ValueBorder.BorderBrush = new SolidColorBrush(Colors.Green);
- break;
- }
- }
- }
- }
-
- public enum BaseLine
- {
- Equal,
- Worse,
- Better
- }
-}