Feat : Changement appshell et pile, fonctionnement semi fonctionnel
continuous-integration/drone/push Build is passing Details

Popup_qui_marche_pas
Jade VAN BRABANDT 2 years ago
parent 725bcf9f7e
commit 31f2e01bc3

@ -6,7 +6,7 @@ using System.Diagnostics.CodeAnalysis;
namespace AppConsole namespace AppConsole
{ {
[ExcludeFromCodeCoverage] [ExcludeFromCodeCoverage]
class Program static class Program
{ {
static void Main(string[] args) static void Main(string[] args)
{ {

@ -10,7 +10,8 @@ public partial class App : Application
public App() public App()
{ {
InitializeComponent(); InitializeComponent();
MainPage = new AppShell(); //Faut changer le boot sur LoginPage plus tard, j'ai mit create là pour pouvoir use l'appli, ce référer au comment sur create et loginpage.
MainPage = new Create();
if (File.Exists(Path.Combine(FileSystem.Current.AppDataDirectory, "games.xml"))) Manager = new Manager(new Persistance(FileSystem.Current.AppDataDirectory)); if (File.Exists(Path.Combine(FileSystem.Current.AppDataDirectory, "games.xml"))) Manager = new Manager(new Persistance(FileSystem.Current.AppDataDirectory));
else Manager = new(new Stub()); else Manager = new(new Stub());
} }

@ -10,9 +10,6 @@
> >
<FlyoutItem> <FlyoutItem>
<ShellContent Title="Login"
ContentTemplate="{DataTemplate views:LoginPage}"
Route="LoginPage"/>
<ShellContent Title="Accueil" <ShellContent Title="Accueil"
ContentTemplate="{DataTemplate views:MainPage}" ContentTemplate="{DataTemplate views:MainPage}"
Route="MainPage"/> Route="MainPage"/>

@ -5,5 +5,5 @@ public partial class AppShell : Shell
public AppShell() public AppShell()
{ {
InitializeComponent(); InitializeComponent();
} }
} }

@ -34,9 +34,9 @@
<RowDefinition Height="auto"/> <RowDefinition Height="auto"/>
<RowDefinition Height="auto"/> <RowDefinition Height="auto"/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Entry Placeholder="Adresse Mail" PlaceholderColor="{StaticResource Primary}" IsPassword="False" x:Name="Email" HeightRequest="50" ClearButtonVisibility="WhileEditing"/> <Entry Text="Adresse@adresse.com" Placeholder="Adresse Mail" PlaceholderColor="{StaticResource Primary}" IsPassword="False" x:Name="Email" HeightRequest="50" ClearButtonVisibility="WhileEditing"/>
<Entry Placeholder="Username" PlaceholderColor="{StaticResource Primary}" IsPassword="False" x:Name="Username" HeightRequest="50" Grid.Row="1" ClearButtonVisibility="WhileEditing"/> <Entry Placeholder="Username" PlaceholderColor="{StaticResource Primary}" IsPassword="False" x:Name="Username" HeightRequest="50" Grid.Row="1" ClearButtonVisibility="WhileEditing"/>
<Entry Placeholder="Mot de passe" PlaceholderColor="{StaticResource Primary}" IsPassword="True" x:Name="Pswd" HeightRequest="50" Grid.Row="2" ClearButtonVisibility="WhileEditing"/> <Entry Text="Azerty123*" Placeholder="Mot de passe" PlaceholderColor="{StaticResource Primary}" IsPassword="True" x:Name="Pswd" HeightRequest="50" Grid.Row="2" ClearButtonVisibility="WhileEditing"/>
<Grid Grid.Row="3" Margin="10,0,0,10"> <Grid Grid.Row="3" Margin="10,0,0,10">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/> <ColumnDefinition Width="*"/>

@ -19,7 +19,8 @@ public partial class Create : ContentPage
{ {
((App)App.Current).Manager.AddUsertoUserList(new("", Username.Text, "", Email.Text, Pswd.Text)); ((App)App.Current).Manager.AddUsertoUserList(new("", Username.Text, "", Email.Text, Pswd.Text));
((App)App.Current).Manager.CurrentUser = ((App)App.Current).Manager.SearchUser(Username.Text); ((App)App.Current).Manager.CurrentUser = ((App)App.Current).Manager.SearchUser(Username.Text);
await Navigation.PushAsync(new MainPage()); Application.Current.MainPage = new AppShell();
await Shell.Current.GoToAsync("//MainPage");
} }
else throw new NotImplementedException(); else throw new NotImplementedException();
} }
@ -28,6 +29,7 @@ public partial class Create : ContentPage
} }
private async void Se_connecter(object sender, EventArgs e) private async void Se_connecter(object sender, EventArgs e)
{ {
//Ca ça marche pas faut une autre commande, Marc svp aide moi
await Navigation.PushAsync(new LoginPage()); await Navigation.PushAsync(new LoginPage());
} }
} }

@ -20,10 +20,11 @@ public partial class LoginPage : ContentPage
if (user.Password == Pswd.Text) if (user.Password == Pswd.Text)
{ {
((App)App.Current).Manager.CurrentUser = user; ((App)App.Current).Manager.CurrentUser = user;
await Navigation.PushAsync(new MainPage()); Application.Current.MainPage = new AppShell();
} await Shell.Current.GoToAsync("//MainPage");
}
else throw new NotImplementedException(); else throw new NotImplementedException();
} }
else else
{ {
@ -34,6 +35,6 @@ public partial class LoginPage : ContentPage
private async void Creer_un_compte(object sender, EventArgs e) private async void Creer_un_compte(object sender, EventArgs e)
{ {
await Navigation.PushAsync(new Create()); await Shell.Current.GoToAsync("//MainPage");
} }
} }
Loading…
Cancel
Save