diff --git a/MoviesTracker/App.xaml b/MoviesTracker/App.xaml new file mode 100644 index 0000000..a34988f --- /dev/null +++ b/MoviesTracker/App.xaml @@ -0,0 +1,14 @@ + + + + + + + + + + + diff --git a/MoviesTracker/App.xaml.cs b/MoviesTracker/App.xaml.cs new file mode 100644 index 0000000..3bca980 --- /dev/null +++ b/MoviesTracker/App.xaml.cs @@ -0,0 +1,39 @@ +using MoviesTracker.Services; +using MoviesTracker.ViewModels; +using MoviesTracker.Models; +using Microsoft.Extensions.DependencyInjection; + +namespace MoviesTracker +{ + public partial class App : Application + { + public static Supabase.Client SupabaseClient { get; private set; } + public static IServiceProvider ServiceProvider { get; private set; } + + public App() + { + InitializeComponent(); + + SupabaseClient = new Supabase.Client(AppConfig.SUPABASE_URL, AppConfig.SUPABASE_KEY); + SupabaseClient.InitializeAsync().Wait(); + + var services = new ServiceCollection(); + ConfigureServices(services); + + ServiceProvider = services.BuildServiceProvider(); + var mainPage = ServiceProvider.GetRequiredService(); + + MainPage = mainPage; + } + + private void ConfigureServices(IServiceCollection services) + { + services.AddSingleton(); + services.AddSingleton(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddSingleton(); + } + } +} diff --git a/MoviesTracker/AppShell.xaml b/MoviesTracker/AppShell.xaml new file mode 100644 index 0000000..074f21f --- /dev/null +++ b/MoviesTracker/AppShell.xaml @@ -0,0 +1,12 @@ + + + + + + + diff --git a/MoviesTracker/AppShell.xaml.cs b/MoviesTracker/AppShell.xaml.cs new file mode 100644 index 0000000..1c01c10 --- /dev/null +++ b/MoviesTracker/AppShell.xaml.cs @@ -0,0 +1,20 @@ +using MoviesTracker.Views; + +namespace MoviesTracker +{ + public partial class AppShell : Shell + { + public AppShell() + { + InitializeComponent(); + + RegisterForRoute(); + RegisterForRoute(); + } + + protected void RegisterForRoute() + { + Routing.RegisterRoute(typeof(T).Name, typeof(T)); + } + } +} diff --git a/MoviesTracker/MainPage.xaml b/MoviesTracker/MainPage.xaml new file mode 100644 index 0000000..6b94aab --- /dev/null +++ b/MoviesTracker/MainPage.xaml @@ -0,0 +1,36 @@ + + + + + + + +