using ShoopNCook.Controllers;

namespace ShoopNCook.Pages;

public partial class RegisterPage : ContentPage
{
    private readonly RegisterController controller;
	public RegisterPage(RegisterController controller)
	{
		InitializeComponent();
        this.controller = controller;
	}
    private async void LoginTapped(object sender, EventArgs e)
    {
        await Shell.Current.GoToAsync("//Login");
    }
    private void RegisterTapped(object sender, EventArgs e)
    {
        string email = EmailEntry.Text;
        string password = PasswordEntry.Text;
        string username = UserNameEntry.Text;
        controller.Register(username, email, password);
    }
}