diff --git a/Qwirkle/QwirkleViews/App.xaml.cs b/Qwirkle/QwirkleViews/App.xaml.cs index bb478eb..a769596 100644 --- a/Qwirkle/QwirkleViews/App.xaml.cs +++ b/Qwirkle/QwirkleViews/App.xaml.cs @@ -19,6 +19,7 @@ namespace Qwirkle InitializeComponent(); + //MainPage = new NavigationPage(new MainPage()); MainPage = new AppShell(); Routing.RegisterRoute(nameof(SetPlayers), typeof(SetPlayers)); diff --git a/Qwirkle/QwirkleViews/MainPage.xaml.cs b/Qwirkle/QwirkleViews/MainPage.xaml.cs index e4bfe0f..f5e3ed7 100644 --- a/Qwirkle/QwirkleViews/MainPage.xaml.cs +++ b/Qwirkle/QwirkleViews/MainPage.xaml.cs @@ -20,7 +20,8 @@ namespace Qwirkle { DisplayAlert("Game notification", "Enter minimun 2 player and max 4 player !", "Ok ! Lets's go !"); - Navigation.PushAsync(new SetPlayers()); + Shell.Current.GoToAsync("SetPlayers"); + //Navigation.PushAsync(new SetPlayers()); } public async void OnContinueClicked(object sender, EventArgs e) @@ -29,7 +30,8 @@ namespace Qwirkle try { ((App)Application.Current!).Game = gameLoad.LoadGame(); - await Navigation.PushAsync(new Gameboard()); + await Shell.Current.GoToAsync("Gameboard"); + //await Navigation.PushAsync(new Gameboard()); } catch { diff --git a/Qwirkle/QwirkleViews/Pages/GameBoard.xaml.cs b/Qwirkle/QwirkleViews/Pages/GameBoard.xaml.cs index b3eb3e0..af80d46 100644 --- a/Qwirkle/QwirkleViews/Pages/GameBoard.xaml.cs +++ b/Qwirkle/QwirkleViews/Pages/GameBoard.xaml.cs @@ -252,5 +252,10 @@ public partial class Gameboard : ContentPage Navigation.PushAsync(new Rules()); } + private void OnButtonSettingsClicked(object? sender, EventArgs e) + { + Navigation.PushAsync(new Settings()); + } + } diff --git a/Qwirkle/QwirkleViews/Pages/Gameboard.xaml b/Qwirkle/QwirkleViews/Pages/Gameboard.xaml index d1d4b34..1413b28 100644 --- a/Qwirkle/QwirkleViews/Pages/Gameboard.xaml +++ b/Qwirkle/QwirkleViews/Pages/Gameboard.xaml @@ -62,6 +62,7 @@ HorizontalOptions="Start" Grid.Row="2" Grid.Column="1" Text="Settings" + Clicked="OnButtonSettingsClicked" ToolTipProperties.Text="Click to check your settings -_-" Style="{StaticResource GameButton}" /> diff --git a/Qwirkle/QwirkleViews/Pages/SetPlayers.xaml.cs b/Qwirkle/QwirkleViews/Pages/SetPlayers.xaml.cs index 9bcced0..b029414 100644 --- a/Qwirkle/QwirkleViews/Pages/SetPlayers.xaml.cs +++ b/Qwirkle/QwirkleViews/Pages/SetPlayers.xaml.cs @@ -53,7 +53,8 @@ public partial class SetPlayers : ContentPage game.StartGame(); game.GiveTilesToPlayers(); game.SetNextPlayer(); - Navigation.PushAsync(new Gameboard()); + Shell.Current.GoToAsync("Gameboard"); + //Navigation.PushAsync(new Gameboard()); } diff --git a/Qwirkle/QwirkleViews/Pages/Settings.xaml.cs b/Qwirkle/QwirkleViews/Pages/Settings.xaml.cs index 90515bf..aa7a7fd 100644 --- a/Qwirkle/QwirkleViews/Pages/Settings.xaml.cs +++ b/Qwirkle/QwirkleViews/Pages/Settings.xaml.cs @@ -6,9 +6,4 @@ public partial class Settings : ContentPage { InitializeComponent(); } - - public void OnGoBackClicked(object sender, EventArgs e) - { - Navigation.PopAsync(); - } } \ No newline at end of file diff --git a/Qwirkle/QwirkleViews/Views/GoBack.xaml.cs b/Qwirkle/QwirkleViews/Views/GoBack.xaml.cs index cc77872..b157937 100644 --- a/Qwirkle/QwirkleViews/Views/GoBack.xaml.cs +++ b/Qwirkle/QwirkleViews/Views/GoBack.xaml.cs @@ -9,8 +9,8 @@ public partial class GoBack : ContentView InitializeComponent(); } - private async void Button_OnClicked(object? sender, EventArgs e) + private void Button_OnClicked(object? sender, EventArgs e) { - await Navigation.PopToRootAsync(); + Navigation.PopAsync(); } } \ No newline at end of file