first full rendering sample of pop% cap with styling
This commit is contained in:
@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user