From a449dbeab305443de4bb933e803c38731c1c6755 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tommy=20=C3=96man?= Date: Sat, 4 Oct 2025 10:05:15 +0200 Subject: [PATCH] =?UTF-8?q?Tafflig=20l=C3=B6sning=20p=C3=A5=20sidbyte?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ViewModelClasses/RoundStartingViewModel.cs | 15 ++++++++++----- GreadyPoang/AppShell.xaml | 9 ++++++--- GreadyPoang/AppShell.xaml.cs | 8 +++----- .../RoundStartingViewModelCommands.cs | 6 ++++-- 4 files changed, 23 insertions(+), 15 deletions(-) diff --git a/GreadyPoang.ViewModelLayer/ViewModelClasses/RoundStartingViewModel.cs b/GreadyPoang.ViewModelLayer/ViewModelClasses/RoundStartingViewModel.cs index a657911..d9b5e93 100644 --- a/GreadyPoang.ViewModelLayer/ViewModelClasses/RoundStartingViewModel.cs +++ b/GreadyPoang.ViewModelLayer/ViewModelClasses/RoundStartingViewModel.cs @@ -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(); } @@ -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 _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); } } diff --git a/GreadyPoang/AppShell.xaml b/GreadyPoang/AppShell.xaml index 9e3d921..8102721 100644 --- a/GreadyPoang/AppShell.xaml +++ b/GreadyPoang/AppShell.xaml @@ -16,11 +16,14 @@ Title="Home" ContentTemplate="{DataTemplate local:MainPage}" Route="MainPage" /> + Title="Deltagare" ContentTemplate="{DataTemplate pages:ParticipantListPage}" + Route="Deltagare"/> + Title="Ny Runda" ContentTemplate="{DataTemplate pages:RoundStartingPage}" + Route="RoundStart"/> + Title="Påbörja eller fortsätt Runda" ContentTemplate="{DataTemplate pages:RoundRunningPage}" + Route="RoundRunning"/>