Tafflig lösning på sidbyte

This commit is contained in:
2025-10-04 10:05:15 +02:00
parent 11f0594233
commit a449dbeab3
4 changed files with 23 additions and 15 deletions

View File

@ -22,7 +22,8 @@ public class RoundStartingViewModel : ViewModelBase
ICombinedRepository combined,
IObjectMessageService objectMessage,
INavigationService nav,
IPageFactory factory) : base()
IPageFactory factory,
ISplashService splashService) : base()
{
_roundsRepo = roundsRepo;
_pointsRepo = pointsRepo;
@ -31,6 +32,7 @@ public class RoundStartingViewModel : ViewModelBase
_objectMessage = objectMessage;
_nav = nav;
_factory = factory;
_splashService = splashService;
_roundElements = new ObservableCollection<RoundBuilderElement>();
}
@ -46,6 +48,7 @@ public class RoundStartingViewModel : ViewModelBase
private readonly IObjectMessageService _objectMessage;
private readonly INavigationService _nav;
private readonly IPageFactory _factory;
private readonly ISplashService _splashService;
private Participant _selectedItem;
private ObservableCollection<RoundBuilderElement> _roundElements;
@ -238,16 +241,18 @@ public class RoundStartingViewModel : ViewModelBase
RoundElements.Clear();
}
public void RoundSelected(RoundBuilderElement element)
public async 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("//RoundRunningPage");
var page = _factory.CreateRoundPage();
_nav.NavigateToPageAsync(page);
await _splashService.ShowSplash("Runda vald, gå till\r 'Påbörja eller fortsätt Runda'", 3000);
// await Shell.Current.GoToAsync("RoundRunning");
//var page = _factory.CreateRoundPage();
//await _nav.NavigateToPageAsync(page);
}
}