first full rendering sample of pop% cap with styling

This commit is contained in:
torben committed 2025-03-16 12:45:09 +01:00
1 parent 2c9ff99502
commit 7bb34a4b51
6 files changed
+112 -42

No files matched your search

@@ -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
};
}
@@ -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;