Observable properties och RelayCommands införda

This commit is contained in:
2025-10-14 21:57:37 +02:00
parent b4d6c6d530
commit 21eb0d5498
17 changed files with 87 additions and 302 deletions

View File

@ -1,5 +1,6 @@
using Common.Library;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using GreadyPoang.DataLayer;
using GreadyPoang.EntityLayer;
using GreadyPoang.Services;
@ -98,8 +99,8 @@ public partial class RoundRunningViewModel : ObservableObject
return RoundElements;
}
public void StoreAndHandlePoints()
[RelayCommand]
private void StoreAndHandlePointsAsync()
{
var game = _roundsRepo.Get(BuilderObject.GameRoundId).GetAwaiter().GetResult();
var regNr = RoundElements.Count > 0 ? RoundElements.Max(e => e.GameRoundRegNr) + 1 : 1;
@ -147,6 +148,8 @@ public partial class RoundRunningViewModel : ObservableObject
RoundElements.FirstOrDefault(e => e.ParticipantId == col.PlayerId).GameRegPoints = col.PlayerPoints;
}
TriggerRebuild();
Shell.Current.GoToAsync("..").GetAwaiter().GetResult();
}
private int nextPlayerElement()