More style testing

This commit is contained in:
2025-02-12 21:49:18 +01:00
parent c2f710bf67
commit 45cca4d8e3
6 changed files with 69 additions and 4 deletions

View File

@ -0,0 +1,19 @@
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
};
}

View File

@ -189,7 +189,8 @@ public partial class PlayerPlanetViewModel : ViewModelBase
public int MaxTerraforming => Planet.MaxTerraforming ?? 0;
public int CapacityPercent => Planet.CapacityPercent ?? 0;
// public int CapacityPercent => Planet.CapacityPercent ?? 0;
public DataGridColumn.PopulationCapacity CapacityPercent => new(Planet.CapacityPercent ?? 0);
public int ScanRange => Planet.ScanRange ?? 0;