navigation ajustments

pull/39/head
Leo TUAILLON 2 years ago
parent 00e91994bb
commit f981b89308

@ -11,7 +11,7 @@ public partial class App : Application
Account account = getUserAccount(); Account account = getUserAccount();
MainPage = new NavigationPage(new HomePage()); MainPage = new AppShell();
} }
private Account getUserAccount() private Account getUserAccount()

@ -17,7 +17,6 @@
Title="More" Title="More"
ContentTemplate="{DataTemplate pages:Splash}" ContentTemplate="{DataTemplate pages:Splash}"
Route="Splash" Route="Splash"
Icon="more.svg"
IsVisible="False"/> IsVisible="False"/>
<ShellContent <ShellContent
@ -48,6 +47,7 @@
Route="More" Route="More"
Icon="more.svg"/> Icon="more.svg"/>
</TabBar> </TabBar>
<FlyoutItem Title="Search"> <FlyoutItem Title="Search">
<ShellContent <ShellContent
Title="Search Page" Title="Search Page"

@ -8,10 +8,6 @@ public partial class AppShell : Shell
public AppShell() public AppShell()
{ {
InitializeComponent(); InitializeComponent();
ShowSplashPage();
}
private async void ShowSplashPage()
{
await Navigation.PushModalAsync(new Splash());
} }
} }

@ -15,13 +15,6 @@
ColumnDefinitions="*" ColumnDefinitions="*"
MaximumHeightRequest="60"> MaximumHeightRequest="60">
<ImageButton
Grid.Column="0"
HeightRequest="50"
WidthRequest="50"
Source="arrow_back.svg"
HorizontalOptions="Start"
Clicked="OnSyncButtonClicked"/>
<Label <Label
Grid.Column="0" Grid.Column="0"

@ -6,8 +6,5 @@ public partial class FavoritesPage : ContentPage
{ {
InitializeComponent(); InitializeComponent();
} }
private async void OnSyncButtonClicked(object sender, EventArgs e)
{
await Shell.Current.GoToAsync("//HomePage");
}
} }

@ -8,6 +8,6 @@ public partial class HomePage : ContentPage
} }
private async void OnSyncButtonClicked(object sender, EventArgs e) private async void OnSyncButtonClicked(object sender, EventArgs e)
{ {
await Shell.Current.GoToAsync("//Search"); await Shell.Current.Navigation.PushAsync(new SearchPage());
} }
} }

@ -14,12 +14,12 @@ public partial class MorePage : ContentPage
} }
private async void OnMyRecipesButtonTapped(object sender, EventArgs e) private async void OnMyRecipesButtonTapped(object sender, EventArgs e)
{ {
await Shell.Current.GoToAsync("//MyRecipe"); await Shell.Current.Navigation.PushAsync(new MyRecipesPage());
} }
private async void OnEditProfileButtonTapped(object sender, EventArgs e) private async void OnEditProfileButtonTapped(object sender, EventArgs e)
{ {
await Shell.Current.GoToAsync("//EditProfile"); await Shell.Current.Navigation.PushAsync(new ProfilePage());
} }
private async void OnLogoutButtonTapped(object sender, EventArgs e) private async void OnLogoutButtonTapped(object sender, EventArgs e)

@ -17,7 +17,8 @@
HeightRequest="50" HeightRequest="50"
WidthRequest="50" WidthRequest="50"
Source="arrow_back.svg" Source="arrow_back.svg"
HorizontalOptions="Start"/> HorizontalOptions="Start"
Clicked="OnBackButtonClicked"/>
<Label <Label
Grid.Column="0" Grid.Column="0"

@ -4,6 +4,11 @@ public partial class MyRecipesPage : ContentPage
{ {
public MyRecipesPage() public MyRecipesPage()
{ {
InitializeComponent(); InitializeComponent();
} }
private async void OnBackButtonClicked(object sender, EventArgs e)
{
await Navigation.PopAsync();
}
} }

@ -22,7 +22,8 @@
HeightRequest="50" HeightRequest="50"
WidthRequest="50" WidthRequest="50"
Source="arrow_back.svg" Source="arrow_back.svg"
HorizontalOptions="Start"/> HorizontalOptions="Start"
Clicked="OnBackButtonClicked"/>
<Label <Label
Grid.Column="0" Grid.Column="0"

@ -6,4 +6,8 @@ public partial class ProfilePage : ContentPage
{ {
InitializeComponent(); InitializeComponent();
} }
private async void OnBackButtonClicked(object sender, EventArgs e)
{
await Navigation.PopAsync();
}
} }

@ -24,7 +24,7 @@
AlignItems="Center"> AlignItems="Center">
<ImageButton <ImageButton
Source="arrow_back.svg" Source="arrow_back.svg"
Clicked="OnSyncButtonClicked"/> Clicked="OnBackButtonClicked"/>
<Label <Label
Style="{StaticResource h1}" Style="{StaticResource h1}"
x:Name="RecipeName" x:Name="RecipeName"

@ -95,9 +95,9 @@ public partial class RecipePage : ContentPage
Favorite.Source = ImageSource.FromFile("hearth_off.svg"); Favorite.Source = ImageSource.FromFile("hearth_off.svg");
} }
} }
private async void OnSyncButtonClicked(object sender, EventArgs e) private async void OnBackButtonClicked(object sender, EventArgs e)
{ {
await Shell.Current.GoToAsync("//Search"); await Navigation.PopAsync();
} }
} }

@ -23,7 +23,7 @@
WidthRequest="50" WidthRequest="50"
Source="arrow_back.svg" Source="arrow_back.svg"
HorizontalOptions="Start" HorizontalOptions="Start"
Clicked="OnSyncButtonClicked"/> Clicked="OnBackButtonClicked"/>
<Label <Label
Grid.Column="0" Grid.Column="0"

@ -6,8 +6,8 @@ public partial class SearchPage : ContentPage
{ {
InitializeComponent(); InitializeComponent();
} }
private async void OnSyncButtonClicked(object sender, EventArgs e) private async void OnBackButtonClicked(object sender, EventArgs e)
{ {
await Shell.Current.GoToAsync("//HomePage"); await Navigation.PopAsync();
} }
} }

@ -5,8 +5,6 @@ VisualStudioVersion = 17.0.31611.283
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ShoopNCook", "ShoopNCook.csproj", "{8ED2FB1D-C04D-478D-9271-CC91FE110396}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ShoopNCook", "ShoopNCook.csproj", "{8ED2FB1D-C04D-478D-9271-CC91FE110396}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests", "Tests\Tests.csproj", "{D93F5FCA-0362-49F5-8EB5-CB3D5371DC50}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@ -19,10 +17,6 @@ Global
{8ED2FB1D-C04D-478D-9271-CC91FE110396}.Release|Any CPU.ActiveCfg = Release|Any CPU {8ED2FB1D-C04D-478D-9271-CC91FE110396}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8ED2FB1D-C04D-478D-9271-CC91FE110396}.Release|Any CPU.Build.0 = Release|Any CPU {8ED2FB1D-C04D-478D-9271-CC91FE110396}.Release|Any CPU.Build.0 = Release|Any CPU
{8ED2FB1D-C04D-478D-9271-CC91FE110396}.Release|Any CPU.Deploy.0 = Release|Any CPU {8ED2FB1D-C04D-478D-9271-CC91FE110396}.Release|Any CPU.Deploy.0 = Release|Any CPU
{D93F5FCA-0362-49F5-8EB5-CB3D5371DC50}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D93F5FCA-0362-49F5-8EB5-CB3D5371DC50}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D93F5FCA-0362-49F5-8EB5-CB3D5371DC50}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D93F5FCA-0362-49F5-8EB5-CB3D5371DC50}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE

@ -1,25 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="3.1.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
</Project>

@ -1,11 +0,0 @@
namespace Tests
{
public class UnitTest1
{
[Fact]
public void Test1()
{
Assert.Equal(1, 2);
}
}
}

@ -1 +0,0 @@
global using Xunit;

@ -1,3 +1,5 @@
using ShoopNCook.Pages;
namespace ShoopNCook.Views; namespace ShoopNCook.Views;
public partial class RecipeView : ContentView public partial class RecipeView : ContentView
@ -45,6 +47,6 @@ public partial class RecipeView : ContentView
} }
private async void OnRecipeTapped(object sender, EventArgs e) private async void OnRecipeTapped(object sender, EventArgs e)
{ {
await Shell.Current.GoToAsync("//RecipePage"); await Shell.Current.Navigation.PushAsync(new RecipePage());
} }
} }
Loading…
Cancel
Save