Spelrundebilden påbörjad , kommunikation mellan bilder fungerar

This commit is contained in:
2025-09-17 12:21:11 +02:00
parent a955218c7a
commit 12002b65dd
13 changed files with 134 additions and 33 deletions

View File

@ -1,6 +1,7 @@
using Common.Library;
using GreadyPoang.DataLayer;
using GreadyPoang.EntityLayer;
using GreadyPoang.Services;
using System.Collections.ObjectModel;
using System.Diagnostics;
@ -18,12 +19,14 @@ public class RoundStartingViewModel : ViewModelBase
IRepository<GameRound> roundsRepo,
IRepository<GamePoint> pointsRepo,
IMethodSharingService<Participant> sharingService,
ICombinedRepository combined) : base()
ICombinedRepository combined,
IObjectMessageService objectMessage) : base()
{
_roundsRepo = roundsRepo;
_pointsRepo = pointsRepo;
_sharingService = sharingService;
_combined = combined;
_objectMessage = objectMessage;
_roundElements = new ObservableCollection<RoundBuilderElement>();
}
@ -36,6 +39,7 @@ public class RoundStartingViewModel : ViewModelBase
private readonly IRepository<GamePoint> _pointsRepo;
private readonly IMethodSharingService<Participant> _sharingService;
private readonly ICombinedRepository _combined;
private readonly IObjectMessageService _objectMessage;
private Participant _selectedItem;
private ObservableCollection<RoundBuilderElement> _roundElements;
@ -228,7 +232,13 @@ public class RoundStartingViewModel : ViewModelBase
public void RoundSelected(RoundBuilderElement element)
{
var rbGroup = GameRoundList.FirstOrDefault(g => g.GameRoundId == element.GameRoundId);
Debug.WriteLine($"Du valde raden med Runda {element.GameRoundId} och spelare: {element.ParticipantName}");
if (rbGroup != null)
{
_objectMessage.CurrentGroup = rbGroup;
Shell.Current.GoToAsync("//RoundRunningView");
}
}
public void SelectNewlyAddedParticipant(RoundBuilderElement roundBuilder)