diff --git a/App/App.csproj b/App/App.csproj index 855fd29..5c8fe88 100644 --- a/App/App.csproj +++ b/App/App.csproj @@ -52,17 +52,20 @@ + + + diff --git a/App/AppShell.xaml.cs b/App/AppShell.xaml.cs index dc45408..7dd4687 100644 --- a/App/AppShell.xaml.cs +++ b/App/AppShell.xaml.cs @@ -8,7 +8,6 @@ public partial class AppShell : Shell { InitializeComponent(); - Routing.RegisterRoute(nameof(ChampionAddEditPage), typeof(ChampionAddEditPage)); Routing.RegisterRoute(nameof(ChampionDetailPage), typeof(ChampionDetailPage)); } } diff --git a/App/MauiProgram.cs b/App/MauiProgram.cs index f3a6caf..c19fcc0 100644 --- a/App/MauiProgram.cs +++ b/App/MauiProgram.cs @@ -1,8 +1,10 @@ using Microsoft.Extensions.Logging; +using CommunityToolkit.Maui; using Model; using StubLib; using ViewModel; using App.Pages; +using App.ViewModel; namespace App; @@ -13,14 +15,16 @@ public static class MauiProgram var builder = MauiApp.CreateBuilder(); builder .UseMauiApp() - .ConfigureFonts(fonts => + .UseMauiCommunityToolkit() + .ConfigureFonts(fonts => { fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular"); fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold"); }) .Services.AddSingleton() - .AddSingleton() - .AddSingleton(); + .AddSingleton() + .AddSingleton() + .AddSingleton(); #if DEBUG builder.Logging.AddDebug(); diff --git a/App/Pages/ChampionDetailPage.xaml.cs b/App/Pages/ChampionDetailPage.xaml.cs index b84ded8..2516ca8 100644 --- a/App/Pages/ChampionDetailPage.xaml.cs +++ b/App/Pages/ChampionDetailPage.xaml.cs @@ -6,15 +6,15 @@ public partial class ChampionDetailPage : ContentPage { public ChampionVM ChampionVM { get; private set; } - public ChampionDetailPage(ChampionVM championVM) + public ChampionDetailPage() { - ChampionVM = championVM; + //ChampionVM = championVM; InitializeComponent(); BindingContext = ChampionVM; } async void ToolbarItem_Clicked(System.Object sender, System.EventArgs e) { - await Navigation.PushAsync(new ChampionAddEditPage()); + await Navigation.PushModalAsync(new ChampionAddEditPage()); } } diff --git a/App/Pages/ChampionsListPage.xaml b/App/Pages/ChampionsListPage.xaml index 9b6ca4f..b570af4 100644 --- a/App/Pages/ChampionsListPage.xaml +++ b/App/Pages/ChampionsListPage.xaml @@ -2,10 +2,11 @@ - + @@ -24,9 +25,14 @@ + + + + @@ -60,11 +66,11 @@ -