diff --git a/Stars Assistant/Assets/DataGridStyles.axaml b/Stars Assistant/Assets/DataGridStyles.axaml
new file mode 100644
index 0000000..2ff96aa
--- /dev/null
+++ b/Stars Assistant/Assets/DataGridStyles.axaml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Stars Assistant/Assets/GridCellStyles.axaml b/Stars Assistant/Assets/GridCellStyles.axaml
deleted file mode 100644
index 55e7160..0000000
--- a/Stars Assistant/Assets/GridCellStyles.axaml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/Stars Assistant/ViewModels/DataGridColumn/PopulationCapacity.cs b/Stars Assistant/ViewModels/DataGridColumn/PopulationCapacity.cs
deleted file mode 100644
index da3e021..0000000
--- a/Stars Assistant/ViewModels/DataGridColumn/PopulationCapacity.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-using ReactiveUI.SourceGenerators;
-using Avalonia.Media;
-
-namespace StarsAssistant.ViewModels.DataGridColumn;
-
-public partial class PopulationCapacity(int value) : ViewModelBase
-{
- [Reactive] private int _value = value;
-
- public IBrush BackgroundColor => _value switch
- {
- < 25 => Brushes.Khaki,
- <= 33 => Brushes.PaleGreen,
- <= 50 => Brushes.Khaki,
- > 100 => Brushes.LightCoral,
- > 99 => Brushes.LightGray,
- _ => Brushes.White
- };
-}
\ No newline at end of file
diff --git a/Stars Assistant/ViewModels/PlayerPlanetViewModel.cs b/Stars Assistant/ViewModels/PlayerPlanetViewModel.cs
index 990883e..203fad1 100644
--- a/Stars Assistant/ViewModels/PlayerPlanetViewModel.cs
+++ b/Stars Assistant/ViewModels/PlayerPlanetViewModel.cs
@@ -189,8 +189,7 @@ public partial class PlayerPlanetViewModel : ViewModelBase
public int MaxTerraforming => Planet.MaxTerraforming ?? 0;
- // public int CapacityPercent => Planet.CapacityPercent ?? 0;
- public DataGridColumn.PopulationCapacity CapacityPercent => new(Planet.CapacityPercent ?? 0);
+ public int CapacityPercent => Planet.CapacityPercent ?? 0;
public int ScanRange => Planet.ScanRange ?? 0;
diff --git a/Stars Assistant/Views/BuColView.axaml b/Stars Assistant/Views/BuColView.axaml
index 6fc78fb..82248e5 100644
--- a/Stars Assistant/Views/BuColView.axaml
+++ b/Stars Assistant/Views/BuColView.axaml
@@ -3,6 +3,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:vm="using:StarsAssistant.ViewModels"
+ xmlns:helpers="using:StarsAssistant.Views.Helpers"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="200"
x:Class="StarsAssistant.Views.BuColView"
x:DataType="vm:BuColViewModel">
@@ -16,15 +17,9 @@
RowHeight="24" FontSize="12"
BorderThickness="1" BorderBrush="Gray"
>
-
-
-
-
-
-
-
+
@@ -32,7 +27,27 @@
-
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Stars Assistant/Views/Helpers/PlanetStyleConverters.cs b/Stars Assistant/Views/Helpers/PlanetStyleConverters.cs
new file mode 100644
index 0000000..39d7e6d
--- /dev/null
+++ b/Stars Assistant/Views/Helpers/PlanetStyleConverters.cs
@@ -0,0 +1,62 @@
+using Avalonia.Data.Converters;
+
+namespace StarsAssistant.Views.Helpers;
+
+public static class PlanetStyleConverters
+{
+ ///
+ /// Check, if the planet pop percentage is in the warning range
+ ///
+ public static FuncValueConverter PopulationPercentWarning { get; }
+ = new((value) =>
+ {
+ return value switch
+ {
+ null => false,
+ > 0 and < 25 or > 33 and <= 50 => true,
+ _ => false
+ };
+ });
+
+ ///
+ /// Check, if the planet pop percentage is in a bad range (overpop)
+ ///
+ public static FuncValueConverter PopulationPercentBad { get; }
+ = new((value) =>
+ {
+ return value switch
+ {
+ null => false,
+ > 100 => true,
+ _ => false
+ };
+ });
+
+ ///
+ /// Check, if the planet pop percentage is in a good range (growth-wise)
+ ///
+ public static FuncValueConverter PopulationPercentGood { get; }
+ = new((value) =>
+ {
+ return value switch
+ {
+ null => false,
+ >= 25 and <= 33 => true,
+ _ => false
+ };
+ });
+
+ ///
+ /// Check, if the planet pop percentage is not relevant (100%)
+ ///
+ public static FuncValueConverter PopulationPercentInactive { get; }
+ = new((value) =>
+ {
+ return value switch
+ {
+ null => false,
+ > 99 and <= 100 => true,
+ _ => false
+ };
+ });
+}
\ No newline at end of file