From 1e153071e12b3ca46855021a9a1b99423acd5142 Mon Sep 17 00:00:00 2001 From: Shaun Lawrence <17139988+bijington@users.noreply.github.com> Date: Wed, 29 Nov 2023 21:45:37 +0000 Subject: [PATCH 1/6] Initial musings on showing popups without having to create your own popup --- .../MauiProgram.cs | 2 + .../Pages/Views/Popup/MultiplePopupPage.xaml | 2 + .../Views/Popup/MultiplePopupViewModel.cs | 8 ++++ .../Views/Popup/PopupContentViewModel.cs | 11 +++++ .../Views/Popups/PopupContentView.xaml | 15 ++++++ .../Views/Popups/PopupContentView.xaml.cs | 13 +++++ .../ServiceCollectionExtensions.shared.cs | 19 ++++++++ .../Popup/Popup.macios.cs | 2 +- src/CommunityToolkit.Maui/PopupService.cs | 47 +++++++++++++++++-- 9 files changed, 113 insertions(+), 6 deletions(-) create mode 100644 samples/CommunityToolkit.Maui.Sample/ViewModels/Views/Popup/PopupContentViewModel.cs create mode 100644 samples/CommunityToolkit.Maui.Sample/Views/Popups/PopupContentView.xaml create mode 100644 samples/CommunityToolkit.Maui.Sample/Views/Popups/PopupContentView.xaml.cs diff --git a/samples/CommunityToolkit.Maui.Sample/MauiProgram.cs b/samples/CommunityToolkit.Maui.Sample/MauiProgram.cs index 175a32efc..02b29d395 100644 --- a/samples/CommunityToolkit.Maui.Sample/MauiProgram.cs +++ b/samples/CommunityToolkit.Maui.Sample/MauiProgram.cs @@ -198,6 +198,8 @@ static void RegisterViewsAndViewModels(in IServiceCollection services) services.AddTransientPopup(); services.AddTransientPopup(); services.AddTransientPopup(); + + services.AddTransientPopupContent(); } static void RegisterEssentials(in IServiceCollection services) diff --git a/samples/CommunityToolkit.Maui.Sample/Pages/Views/Popup/MultiplePopupPage.xaml b/samples/CommunityToolkit.Maui.Sample/Pages/Views/Popup/MultiplePopupPage.xaml index d05ab27ce..1267aaebe 100644 --- a/samples/CommunityToolkit.Maui.Sample/Pages/Views/Popup/MultiplePopupPage.xaml +++ b/samples/CommunityToolkit.Maui.Sample/Pages/Views/Popup/MultiplePopupPage.xaml @@ -31,6 +31,8 @@