Skip to content

Popup V2 #1581

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 145 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 136 commits
Commits
Show all changes
145 commits
Select commit Hold shift + click to select a range
e905495
Initial musings on showing popups without having to create your own p…
bijington Nov 29, 2023
1df75cd
Remove commented code
bijington Nov 29, 2023
f7847ec
Pass on the BindingContext of a view up to the popup
bijington Dec 4, 2023
e0ac620
Expand IPopupService API to enable the ability to supply the configur…
bijington Feb 11, 2024
b153f60
Name the cancellation token usage
bijington Feb 20, 2024
4fcbf83
Include DynamicallyAccessedMembers
bijington Sep 10, 2024
45a35b3
Popup V2
VladislavAntonyuk Jan 14, 2025
2716adc
Update samples
VladislavAntonyuk Jan 14, 2025
3fce702
Fix tests
VladislavAntonyuk Jan 15, 2025
fbba90d
register all popups
VladislavAntonyuk Jan 15, 2025
ccf952d
fix tizen build
VladislavAntonyuk Jan 15, 2025
6afff1f
await tasks
VladislavAntonyuk Jan 15, 2025
b097df1
fix xaml
VladislavAntonyuk Jan 15, 2025
45ab59d
Fix tests
VladislavAntonyuk Jan 15, 2025
8b535bf
Fix popup Result
VladislavAntonyuk Jan 15, 2025
10cb099
Fix tests, fix samples, rework popup service
VladislavAntonyuk Jan 15, 2025
133b398
fix sample
VladislavAntonyuk Jan 15, 2025
2de506b
Fix back button
VladislavAntonyuk Jan 15, 2025
8ed786c
Fix tests
VladislavAntonyuk Jan 15, 2025
df0b6a3
Add Navigation parameter
VladislavAntonyuk Jan 21, 2025
d5cb5a1
Fix after rebase
VladislavAntonyuk Feb 6, 2025
e9cf804
Remove old page
VladislavAntonyuk Feb 6, 2025
f1d99c0
Merge branch 'main' into feature/sl/remove-popup-constraint-from-popu…
VladislavAntonyuk Feb 10, 2025
6818cb8
Add docs
VladislavAntonyuk Feb 11, 2025
df907ea
Merge branch 'main' into feature/sl/remove-popup-constraint-from-popu…
VladislavAntonyuk Feb 11, 2025
0616afb
Merge branch 'main' into feature/sl/remove-popup-constraint-from-popu…
VladislavAntonyuk Feb 12, 2025
c38a148
Merge branch 'main' into feature/sl/remove-popup-constraint-from-popu…
TheCodeTraveler Feb 13, 2025
1f23950
Use Partial Property
TheCodeTraveler Feb 13, 2025
0c47444
Disable `PushModalAsync` and `PopModalAsync` Animations
TheCodeTraveler Feb 13, 2025
fb3ba37
Remove Circular Reference to PopupContainer
TheCodeTraveler Feb 13, 2025
bd35857
Remove Null Forgiving Operator
TheCodeTraveler Feb 13, 2025
9839e2e
Update Event Name
TheCodeTraveler Feb 13, 2025
d5174bb
Add CancellationToken Parameter
TheCodeTraveler Feb 14, 2025
86247a0
Remove duplicate `()`
TheCodeTraveler Feb 14, 2025
f191127
Add PopupExtension method for `Page`
TheCodeTraveler Feb 14, 2025
eda00b7
Remove `return await`
TheCodeTraveler Feb 14, 2025
7930fc4
Update formatting
TheCodeTraveler Feb 14, 2025
5dc9eb3
Use `WeakEventManager`
TheCodeTraveler Feb 14, 2025
d8f90a4
Merge branch 'main' into feature/sl/remove-popup-constraint-from-popu…
VladislavAntonyuk Feb 15, 2025
2540f22
Remvoe Duplicate `SemanticOrderViewPageViewModel` Mapping
TheCodeTraveler Feb 16, 2025
8fccc9c
Use Bindings to ensure `Popup.BindingContext` and `PopupContainer.Bin…
TheCodeTraveler Feb 16, 2025
b3be825
Merge branch 'main' into feature/sl/remove-popup-constraint-from-popu…
TheCodeTraveler Feb 16, 2025
90e0f04
Merge branch 'feature/sl/remove-popup-constraint-from-popup-service' …
TheCodeTraveler Feb 16, 2025
f50a781
Remove `PopupLifecycleController`, Organize Folder Structure
TheCodeTraveler Feb 16, 2025
65a96fe
Remove `BuildPopupContent()`, `BuildPopupContent` and `ConfigurePopup…
TheCodeTraveler Feb 23, 2025
408cb56
Use correct `ShowPopup` method
TheCodeTraveler Feb 23, 2025
a4e8f76
Make PopupOptions Bindable, Fix Popup Samples, Add `PopupService.Show…
TheCodeTraveler Feb 23, 2025
2c9a155
Propogate BindableProperties
TheCodeTraveler Feb 24, 2025
86a26ee
`dotnet format`
TheCodeTraveler Feb 24, 2025
91ebcd1
Fix binding
TheCodeTraveler Feb 24, 2025
ffd8a37
Merge branch 'main' into feature/sl/remove-popup-constraint-from-popu…
pictos Feb 24, 2025
d2115a2
Apply suggestions from code review
TheCodeTraveler Feb 25, 2025
6e8385c
Create `IPopupOptions`, Add `PopupOptions.Empty`, Fix File Naming, Na…
TheCodeTraveler Feb 25, 2025
ffdd87c
Add `PopupOptionsDefaults`
TheCodeTraveler Feb 25, 2025
2185556
Fix file names
TheCodeTraveler Feb 25, 2025
aaa6210
`dotnet format`
TheCodeTraveler Feb 25, 2025
a224078
Move to `CommunityToolkit.Maui`
TheCodeTraveler Mar 2, 2025
82b5e65
Remove `ConvertToLayoutOptions`
TheCodeTraveler Mar 2, 2025
a64a79b
Add PopupContainer Tests
TheCodeTraveler Mar 2, 2025
ac4735f
Add PopupServiceTests
TheCodeTraveler Mar 2, 2025
c534f28
Add PopupTests
TheCodeTraveler Mar 2, 2025
a791a61
Remove `PopupAnchor`
TheCodeTraveler Mar 2, 2025
d72582e
Make `PopupOptions` properties readonly on `Popup`
TheCodeTraveler Mar 11, 2025
826ec87
Mark `PopupOptions` `BindableProperty`s as `[Obsolete]`
TheCodeTraveler Mar 11, 2025
f11f7a9
Update XML Comments, Add `Background`
TheCodeTraveler Mar 11, 2025
59513f5
Update XML Comments
TheCodeTraveler Mar 12, 2025
d6242f2
Merge branch 'main' into feature/sl/remove-popup-constraint-from-popu…
TheCodeTraveler Mar 12, 2025
f08cd0a
Merge branch 'feature/sl/remove-popup-constraint-from-popup-service' …
TheCodeTraveler Mar 12, 2025
42b188b
Add XC0618 to `WarningsAsErrors`
TheCodeTraveler Mar 12, 2025
78beaed
Add Unit Tests
TheCodeTraveler Mar 12, 2025
e4a7be4
Remove duplicate GetPopupContainer()
TheCodeTraveler Mar 12, 2025
560ef9d
Merge branch 'main' into feature/sl/remove-popup-constraint-from-popu…
TheCodeTraveler Mar 13, 2025
187e00a
Update PopupServiceTests.cs
TheCodeTraveler Mar 17, 2025
66fb13b
Update Popup Tests
TheCodeTraveler Mar 23, 2025
1f5fc28
Merge branch 'main' into feature/sl/remove-popup-constraint-from-popu…
TheCodeTraveler Mar 23, 2025
e80ec98
Add Popup Tests
TheCodeTraveler Mar 23, 2025
6e37850
Fix Popup_Close_ShouldNotThrowExceptionWhenCloseIsOverridden
TheCodeTraveler Mar 23, 2025
99a0916
Update Popup Tests
TheCodeTraveler Mar 23, 2025
c185c1f
Update Popup.shared.cs
TheCodeTraveler Mar 23, 2025
79be3d9
Update Popup.shared.cs
TheCodeTraveler Mar 23, 2025
1f06e2c
Add CancellationToken to PopupT.Close()
TheCodeTraveler Mar 23, 2025
ed38092
Add PopupExtensionsTests
TheCodeTraveler Mar 23, 2025
8cc84a8
Fix namespace
TheCodeTraveler Mar 23, 2025
31554bb
Add `PopupOptionsTests`
TheCodeTraveler Mar 24, 2025
04b6a72
Add `IPopupOptionsTests`
TheCodeTraveler Mar 24, 2025
03016f7
Format + Remove unused code
TheCodeTraveler Mar 24, 2025
2386989
Add `PopupContainer Tests`
TheCodeTraveler Mar 24, 2025
2abba89
Update Unit Tests
TheCodeTraveler Mar 24, 2025
4446f0d
Rename to `bindablePopupOptions`
TheCodeTraveler Mar 25, 2025
524532b
Add PopupOptions.BorderStroke
TheCodeTraveler Mar 25, 2025
5275fcd
Rename `PopupOptions.BackgroundColor` -> `PopupOptions.PageOverlayColor`
TheCodeTraveler Mar 25, 2025
7600a70
Refactor Popup BackgroundColor
TheCodeTraveler Mar 25, 2025
191a2b7
Fix Default Padding and Background Bindings
TheCodeTraveler Mar 25, 2025
1498b6d
Remove duplicate BindingContext Binding
TheCodeTraveler Mar 25, 2025
49d2d55
Add ShowPopupAsync_ShouldReturnResult_WhenPopupIsClosedByTappingOutsi…
TheCodeTraveler Mar 26, 2025
70ee957
Remove duplicate code
TheCodeTraveler Mar 26, 2025
f549629
Update PopupResult.shared.cs
TheCodeTraveler Mar 26, 2025
29a4daf
Update PopupResult.shared.cs
TheCodeTraveler Mar 26, 2025
4b0f635
Ensure PopupResult<T> generic type is always nullable
TheCodeTraveler Mar 26, 2025
d356068
Refactor `IsNullable()`
TheCodeTraveler Mar 26, 2025
58ce986
Implement `IPopupResult`
TheCodeTraveler Mar 27, 2025
11e23c8
Update Popup Unit Tests
TheCodeTraveler Mar 27, 2025
ec9625c
Remove XAML from CSharpBindingPopup
TheCodeTraveler Mar 27, 2025
2e26b56
Add PopupOptionsDefaults.PopupBackgroundColor
TheCodeTraveler Mar 27, 2025
9aae100
Set default Shape + BorderColor
TheCodeTraveler Mar 27, 2025
b80fdef
Add IPopupOptions.Shadow
TheCodeTraveler Mar 27, 2025
20166c5
Add Shadow, Update Unit Tests
TheCodeTraveler Mar 27, 2025
bf09cd3
Add `ArgumentNullException.ThrowIfNull(view);`
TheCodeTraveler Mar 27, 2025
68ba41a
Merge branch 'main' into feature/sl/remove-popup-constraint-from-popu…
TheCodeTraveler Apr 10, 2025
18d22cc
Merge branch 'main' into feature/sl/remove-popup-constraint-from-popu…
TheCodeTraveler Apr 10, 2025
99cd4e3
Update Sample Popups
TheCodeTraveler Apr 10, 2025
32fad97
Ensure PopupContainer.Close closes the correct popup
TheCodeTraveler Apr 11, 2025
a6880bf
Add `popupContainersInModalStackList.Count` check
TheCodeTraveler Apr 12, 2025
5bbecd2
Refactor Close
TheCodeTraveler Apr 12, 2025
c2d6a3b
Add IAsyncDisposable
TheCodeTraveler Apr 12, 2025
0fc08fa
Fix failing PopupTests
TheCodeTraveler Apr 12, 2025
b0c5537
Fix PopupSizingIssuesPage
TheCodeTraveler Apr 12, 2025
1606ee9
Update Popup Styling
TheCodeTraveler Apr 12, 2025
43021b4
Use `PopupOptions.Shape` for BorderStroke and StrokeThickness
TheCodeTraveler Apr 12, 2025
6ba7fd9
`dotnet format`
TheCodeTraveler Apr 12, 2025
56c204a
Merge branch 'main' into feature/sl/remove-popup-constraint-from-popu…
TheCodeTraveler Apr 12, 2025
51cf4af
Rename `PopupContainer` -> `PopupPage`
TheCodeTraveler Apr 12, 2025
d6be9aa
Update ServiceCollectionExtensions.shared.cs
TheCodeTraveler Apr 12, 2025
600d235
Merge branch 'main' into feature/sl/remove-popup-constraint-from-popu…
ne0rrmatrix Apr 13, 2025
4b0561f
Remove `CommunityToolkit.Maui.Extensions.NullableExtensions`
TheCodeTraveler Apr 13, 2025
8f3532a
Merge branch 'main' into feature/sl/remove-popup-constraint-from-popu…
TheCodeTraveler Apr 19, 2025
f47c87c
Rename to `PopupPage`
TheCodeTraveler Apr 19, 2025
6f48e96
Update Sample Popups
TheCodeTraveler Apr 19, 2025
8d728ba
Fix Default `StrokeThickness`
TheCodeTraveler Apr 19, 2025
fb7ab0a
Refactor `DisplayPopup`
TheCodeTraveler Apr 19, 2025
318a22e
Add `string? shellRoute`
TheCodeTraveler Apr 19, 2025
71b724a
Add `string? shellRoute` parameter
TheCodeTraveler Apr 19, 2025
0ef097b
Add `PopupOnDisappearingPage`
TheCodeTraveler Apr 19, 2025
2691c05
Refactor OnDisappearingPopupPage
TheCodeTraveler Apr 19, 2025
9eddc69
Update PopupOnDisappearingPage.cs
TheCodeTraveler Apr 19, 2025
ab088a3
Remove default parameters from `internal` methods
TheCodeTraveler Apr 19, 2025
d9aceb5
Flow Popup Properties through to PopupPageLayout.Content
TheCodeTraveler Apr 21, 2025
72f17cd
Update src/CommunityToolkit.Maui/Extensions/PopupExtensions.shared.cs
TheCodeTraveler Apr 21, 2025
1fa56e3
Unsubscribe event handler
TheCodeTraveler Apr 22, 2025
d439c60
Fix XML Comments
TheCodeTraveler Apr 23, 2025
58bda07
Add `ThrowIfCancellationRequested()`
TheCodeTraveler Apr 23, 2025
fd1d69d
Update XML Docs, Create InvalidPopupOperationException, Update Unit T…
TheCodeTraveler Apr 24, 2025
1f467da
Add `AddTransientPopup()`, `AddSingletonPopup()` and `AddScopedPopup()`
TheCodeTraveler Apr 24, 2025
58e134f
Add Unit Tests
TheCodeTraveler Apr 24, 2025
edb12ef
Add Unit Tests
TheCodeTraveler Apr 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@
xUnit3002: Classes which are JSON serializable should not be tested for their concrete type
XC0045: Binding: Property not found
XC0103: Consider attributing the markup extension with [RequireService] or [AcceptEmptyServiceProvider] if it doesn't require any
XC0618: Property, Property setter or BindableProperty "BackgroundColor" is deprecated
IL2***: Trim Warnings
IL3***: AOT Warnings
RS2007: Analyzer release file 'AnalyzerReleases.Shipped.md' has a missing or invalid release header-->
Expand All @@ -182,7 +183,7 @@
xUnit1000,xUnit1001,xUnit1002,xUnit1003,xUnit1004,xUnit1005,xUnit1006,xUnit1007,xUnit1008,xUnit1009,xUnit1010,xUnit1011,xUnit1012,xUnit1013,xUnit1014,xUnit1015,xUnit1016,xUnit1017,xUnit1018,xUnit1019,xUnit1020,xUnit1021,xUnit1022,xUnit1023,xUnit1024,xUnit1025,xUnit1026,xUnit1027,xUnit1028,xUnit1029,xUnit1030,xUnit1031,xUnit1032,xUnit1033,xUnit1034,xUnit1035,xUnit1036,xUnit1037,xUnit1038,xUnit1039,xUnit1040,xUnit1041,xUnit1042,xUnit1043,xUnit1048,xUnit1049,xUnit1050,xUnit1051,
xUnit2000,xUnit2001,xUnit2002,xUnit2003,xUnit2004,xUnit2005,xUnit2006,xUnit2007,xUnit2008,xUnit2009,xUnit2010,xUnit2011,xUnit2012,xUnit2013,xUnit2014,xUnit2015,xUnit2016,xUnit2017,xUnit2018,xUnit2019,xUnit2020,xUnit2021,xUnit2022,xUnit2023,xUnit2024,xUnit2025,xUnit2026,xUnit2027,xUnit2028,xUnit2029,xUnit2030,xUnit2031,xUnit2032,
xUnit3000,xUnit3001,xUnit3002,
XC0045,XC0103,
XC0045,XC0103,XC0618,
IL2001,IL2002,IL2003,IL2004,IL2005,IL2006,IL2007,IL2008,IL2009,
IL2010,IL2011,IL2012,IL2013,IL2014,IL2015,IL2016,IL2017,IL2018,IL2019,
IL2020,IL2021,IL2022,IL2023,IL2024,IL2025,IL2026,IL2027,IL2028,IL2029,
Expand Down
34 changes: 13 additions & 21 deletions samples/CommunityToolkit.Maui.Sample/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,42 +10,34 @@
</ResourceDictionary.MergedDictionaries>

<Style TargetType="{x:Type popups:ImplicitStylePopup}">
<Setter Property="Size" Value="100,100" />
<Setter Property="Color" Value="Red" />
<Setter Property="HorizontalOptions" Value="Start" />
<Setter Property="VerticalOptions" Value="Start" />
<Setter Property="CanBeDismissedByTappingOutsideOfPopup" Value="True" />
<Setter Property="WidthRequest" Value="100" />
<Setter Property="HeightRequest" Value="100" />
<Setter Property="BackgroundColor" Value="Red" />
</Style>

<Style x:Key="ExplicitPopupStyle" TargetType="{x:Type popups:ExplicitStylePopup}">
<Setter Property="Size" Value="200,100" />
<Setter Property="Color" Value="Yellow" />
<Setter Property="HorizontalOptions" Value="End" />
<Setter Property="VerticalOptions" Value="Start" />
<Setter Property="CanBeDismissedByTappingOutsideOfPopup" Value="True" />
<Setter Property="WidthRequest" Value="200" />
<Setter Property="HeightRequest" Value="100" />
<Setter Property="BackgroundColor" Value="Yellow" />
</Style>

<Style x:Key="BasePopupStyle" TargetType="{x:Type popups:StyleInheritancePopup}">
<Setter Property="Size" Value="200,200" />
<Setter Property="WidthRequest" Value="200" />
<Setter Property="HeightRequest" Value="200" />
</Style>
<Style x:Key="InheritancePopupStyle" TargetType="{x:Type popups:StyleInheritancePopup}" BasedOn="{StaticResource BasePopupStyle}">
<Setter Property="Color" Value="SkyBlue" />
<Setter Property="HorizontalOptions" Value="End" />
<Setter Property="VerticalOptions" Value="End" />
<Setter Property="CanBeDismissedByTappingOutsideOfPopup" Value="True" />
<Setter Property="BackgroundColor" Value="SkyBlue" />
</Style>

<Style x:Key="DynamicBasePopupStyle" TargetType="{x:Type popups:DynamicStyleInheritancePopup}">
<Setter Property="Size" Value="150,150" />
<Setter Property="WidthRequest" Value="150" />
<Setter Property="HeightRequest" Value="150" />
</Style>
<Style x:Key="DynamicInheritancePopupStyle1" TargetType="{x:Type popups:DynamicStyleInheritancePopup}" BasedOn="{StaticResource DynamicBasePopupStyle}">
<Setter Property="Color" Value="Purple" />
<Setter Property="VerticalOptions" Value="End" />
<Setter Property="BackgroundColor" Value="Purple" />
</Style>
<Style x:Key="DynamicInheritancePopupStyle2" TargetType="{x:Type popups:DynamicStyleInheritancePopup}" BaseResourceKey="DynamicInheritancePopupStyle1">
<Setter Property="Color" Value="Orange" />
<Setter Property="HorizontalOptions" Value="End" />
<Setter Property="CanBeDismissedByTappingOutsideOfPopup" Value="True" />
<Setter Property="BackgroundColor" Value="Orange" />
</Style>

</ResourceDictionary>
Expand Down
10 changes: 4 additions & 6 deletions samples/CommunityToolkit.Maui.Sample/AppShell.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ public partial class AppShell : Shell
CreateViewModelMapping<AvatarViewSizesPage, AvatarViewSizesViewModel, ViewsGalleryPage, ViewsGalleryViewModel>(),
CreateViewModelMapping<BasicMapsPage, BasicMapsViewModel, ViewsGalleryPage, ViewsGalleryViewModel>(),
CreateViewModelMapping<CameraViewPage, CameraViewViewModel, ViewsGalleryPage, ViewsGalleryViewModel>(),
CreateViewModelMapping<CustomSizeAndPositionPopupPage, CustomSizeAndPositionPopupViewModel, ViewsGalleryPage, ViewsGalleryViewModel>(),
CreateViewModelMapping<DrawingViewPage, DrawingViewViewModel, ViewsGalleryPage, ViewsGalleryViewModel>(),
CreateViewModelMapping<ExpanderPage, ExpanderViewModel, ViewsGalleryPage, ViewsGalleryViewModel>(),
CreateViewModelMapping<LazyViewPage, LazyViewViewModel, ViewsGalleryPage, ViewsGalleryViewModel>(),
Expand All @@ -129,17 +128,16 @@ public partial class AppShell : Shell
CreateViewModelMapping<MediaElementCarouselViewPage, MediaElementCarouselViewViewModel, ViewsGalleryPage, ViewsGalleryViewModel>(),
CreateViewModelMapping<MediaElementCollectionViewPage, MediaElementCollectionViewViewModel, ViewsGalleryPage, ViewsGalleryViewModel>(),
CreateViewModelMapping<MediaElementMultipleWindowsPage, MediaElementMultipleWindowsViewModel, ViewsGalleryPage, ViewsGalleryViewModel>(),
CreateViewModelMapping<MultiplePopupPage, MultiplePopupViewModel, ViewsGalleryPage, ViewsGalleryViewModel>(),
CreateViewModelMapping<PopupAnchorPage, PopupAnchorViewModel, ViewsGalleryPage, ViewsGalleryViewModel>(),
CreateViewModelMapping<SemanticOrderViewPage, SemanticOrderViewPageViewModel, ViewsGalleryPage, ViewsGalleryViewModel>(),
CreateViewModelMapping<PopupsPage, PopupsViewModel, ViewsGalleryPage, ViewsGalleryViewModel>(),
CreateViewModelMapping<PopupLayoutAlignmentPage, PopupLayoutAlignmentViewModel, ViewsGalleryPage, ViewsGalleryViewModel>(),
CreateViewModelMapping<PopupPositionPage, PopupPositionViewModel, ViewsGalleryPage, ViewsGalleryViewModel>(),
CreateViewModelMapping<PopupSizingIssuesPage, PopupSizingIssuesViewModel, ViewsGalleryPage, ViewsGalleryViewModel>(),
CreateViewModelMapping<ShowPopupInOnAppearingPage, ShowPopupInOnAppearingPageViewModel, ViewsGalleryPage, ViewsGalleryViewModel>(),
CreateViewModelMapping<StylePopupPage, StylePopupViewModel, ViewsGalleryPage, ViewsGalleryViewModel>(),
CreateViewModelMapping<RatingViewCsharpPage, RatingViewCsharpViewModel, ViewsGalleryPage, ViewsGalleryViewModel>(),
CreateViewModelMapping<RatingViewShowcasePage, RatingViewShowcaseViewModel, ViewsGalleryPage, ViewsGalleryViewModel>(),
CreateViewModelMapping<RatingViewXamlPage, RatingViewXamlViewModel, ViewsGalleryPage, ViewsGalleryViewModel>(),
CreateViewModelMapping<SemanticOrderViewPage, SemanticOrderViewPageViewModel, ViewsGalleryPage, ViewsGalleryViewModel>(),
CreateViewModelMapping<ShowPopupInOnAppearingPage, ShowPopupInOnAppearingPageViewModel, ViewsGalleryPage, ViewsGalleryViewModel>(),
CreateViewModelMapping<StylePopupPage, StylePopupViewModel, ViewsGalleryPage, ViewsGalleryViewModel>(),

// Add PlatformSpecific View Models
CreateViewModelMapping<NavigationBarPage, NavigationBarAndroidViewModel, PlatformSpecificGalleryPage, PlatformSpecificGalleryViewModel>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@
<NoWarn>CsWinRT1028</NoWarn>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)' == 'Release'
AND $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) != 'tizen'
AND $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) != 'android'
AND $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) != 'windows'">
<PropertyGroup Condition="'$(Configuration)' == 'Release'
AND $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) != 'tizen'
AND $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) != 'android'
AND $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) != 'windows'">
<!-- Ahead-of-time compilation is not yet supported net8.0-tizen -->
<!-- Cross-OS native compilation is not supported net8.0-android -->
<!-- Only iOS + MacCatalyst support AOT in .NET 9 -->
Expand Down
30 changes: 22 additions & 8 deletions samples/CommunityToolkit.Maui.Sample/MauiProgram.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using CommunityToolkit.Maui.ApplicationModel;
using CommunityToolkit.Maui.Markup;
using CommunityToolkit.Maui.Media;
using CommunityToolkit.Maui.Sample.Models;
using CommunityToolkit.Maui.Sample.Pages;
using CommunityToolkit.Maui.Sample.Pages.Alerts;
using CommunityToolkit.Maui.Sample.Pages.Behaviors;
Expand Down Expand Up @@ -120,7 +119,6 @@ public static MauiApp CreateMauiApp()
.AddStandardResilienceHandler(static options => options.Retry = new MobileHttpRetryStrategyOptions());

builder.Services.AddSingleton<AppShell>();
builder.Services.AddSingleton<PopupSizeConstants>();

RegisterViewsAndViewModels(builder.Services);
RegisterEssentials(builder.Services);
Expand Down Expand Up @@ -245,7 +243,6 @@ static void RegisterViewsAndViewModels(in IServiceCollection services)
// Add Views Pages + ViewModels
services.AddTransientWithShellRoute<BasicMapsPage, BasicMapsViewModel>();
services.AddTransientWithShellRoute<CameraViewPage, CameraViewViewModel>();
services.AddTransientWithShellRoute<CustomSizeAndPositionPopupPage, CustomSizeAndPositionPopupViewModel>();
services.AddTransientWithShellRoute<DrawingViewPage, DrawingViewViewModel>();
services.AddTransientWithShellRoute<ExpanderPage, ExpanderViewModel>();
services.AddTransientWithShellRoute<LazyViewPage, LazyViewViewModel>();
Expand All @@ -254,8 +251,7 @@ static void RegisterViewsAndViewModels(in IServiceCollection services)
services.AddTransientWithShellRoute<MediaElementCarouselViewPage, MediaElementCarouselViewViewModel>();
services.AddTransientWithShellRoute<MediaElementCollectionViewPage, MediaElementCollectionViewViewModel>();
services.AddTransientWithShellRoute<MediaElementMultipleWindowsPage, MediaElementMultipleWindowsViewModel>();
services.AddTransientWithShellRoute<MultiplePopupPage, MultiplePopupViewModel>();
services.AddTransientWithShellRoute<PopupAnchorPage, PopupAnchorViewModel>();
services.AddTransientWithShellRoute<PopupsPage, PopupsViewModel>();
services.AddTransientWithShellRoute<PopupLayoutAlignmentPage, PopupLayoutAlignmentViewModel>();
services.AddTransientWithShellRoute<PopupPositionPage, PopupPositionViewModel>();
services.AddTransientWithShellRoute<RatingViewCsharpPage, RatingViewCsharpViewModel>();
Expand All @@ -267,9 +263,27 @@ static void RegisterViewsAndViewModels(in IServiceCollection services)
services.AddTransientWithShellRoute<PopupSizingIssuesPage, PopupSizingIssuesViewModel>();

// Add Popups
services.AddTransientPopup<CsharpBindingPopup, CsharpBindingPopupViewModel>();
services.AddTransientPopup<UpdatingPopup, UpdatingPopupViewModel>();
services.AddTransientPopup<XamlBindingPopup, XamlBindingPopupViewModel>();
services.AddPopup<ApplyToDerivedTypesPopup>();
services.AddPopup<ButtonPopup>();
services.AddPopup<CsharpBindingPopup, CsharpBindingPopupViewModel>();
services.AddPopup<DynamicStyleInheritancePopup>();
services.AddPopup<DynamicStylePopup>();
services.AddPopup<ExplicitStylePopup>();
services.AddPopup<ImplicitStylePopup>();
services.AddPopup<MultipleButtonPopup>();
services.AddPopup<NoOutsideTapDismissPopup>();
services.AddPopup<OpenedEventSimplePopup>();
services.AddPopup<RedBlueBoxPopup>();
services.AddPopup<ReturnResultPopup>();
services.AddPopup<SimplePopup>();
services.AddPopup<StyleClassPopup>();
services.AddPopup<StyleInheritancePopup>();
services.AddPopup<ToggleSizePopup>();
services.AddPopup<TransparentPopup>();
services.AddPopup<UpdatingPopup, UpdatingPopupViewModel>();
services.AddPopup<XamlBindingPopup, XamlBindingPopupViewModel>();

services.AddPopup<PopupContentView, PopupContentViewModel>();
}

static void RegisterEssentials(in IServiceCollection services)
Expand Down
22 changes: 0 additions & 22 deletions samples/CommunityToolkit.Maui.Sample/Models/PopupSize.cs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using System.ComponentModel;
using CommunityToolkit.Maui.Core.Primitives;
using CommunityToolkit.Maui.Extensions;
using CommunityToolkit.Maui.Sample.ViewModels.Views;
using CommunityToolkit.Maui.Views;
using Microsoft.Extensions.Logging;
using LayoutAlignment = Microsoft.Maui.Primitives.LayoutAlignment;

namespace CommunityToolkit.Maui.Sample.Pages.Views;

Expand Down Expand Up @@ -243,35 +243,18 @@ async void ChangeAspectClicked(object? sender, EventArgs e)
MediaElement.Aspect = (Aspect)aspectEnum;
}

void DisplayPopup(object sender, EventArgs e)
async void DisplayPopup(object sender, EventArgs e)
{
MediaElement.Pause();
var popupMediaElement = new MediaElement
{
Source = MediaSource.FromResource("AppleVideo.mp4"),
HeightRequest = 600,
WidthRequest = 600,
ShouldAutoPlay = true,
ShouldShowPlaybackControls = true,
};
var popup = new Popup
{
VerticalOptions = LayoutAlignment.Center,
HorizontalOptions = LayoutAlignment.Center,
Content = new StackLayout
{
Children =
{
popupMediaElement,
}
}
};

this.ShowPopup(popup);
popup.Closed += (s, e) =>
{
popupMediaElement.Stop();
popupMediaElement.Handler?.DisconnectHandler();
};
await this.ShowPopupAsync(popupMediaElement);
popupMediaElement.Stop();
popupMediaElement.Handler?.DisconnectHandler();
}
}
Loading
Loading