Skip to content

Commit ebc39f2

Browse files
Fix tests
1 parent 3188f57 commit ebc39f2

20 files changed

+266
-184
lines changed

samples/CommunityToolkit.Maui.Sample/Pages/Views/MediaElement/MediaElementPage.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ async void DisplayPopup(object sender, EventArgs e)
266266
}
267267
};
268268

269-
await Navigation.ShowPopup(popup, new PopupOptions());
269+
await Navigation.ShowPopup(popup, new PopupOptions<Popup>());
270270
popupMediaElement.Stop();
271271
popupMediaElement.Handler?.DisconnectHandler();
272272
}

samples/CommunityToolkit.Maui.Sample/Pages/Views/Popup/MultiplePopupPage.xaml.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,48 +19,48 @@ public MultiplePopupPage(MultiplePopupViewModel multiplePopupViewModel, IPopupSe
1919

2020
async void HandleSimplePopupButtonClicked(object sender, EventArgs e)
2121
{
22-
await popupService.ShowPopupAsync<SimplePopup>(new PopupOptions(), CancellationToken.None);
22+
await popupService.ShowPopupAsync(new PopupOptions<SimplePopup>(), CancellationToken.None);
2323
}
2424

2525
async void HandleButtonPopupButtonClicked(object sender, EventArgs e)
2626
{
27-
await popupService.ShowPopupAsync< ButtonPopup>(new PopupOptions(), CancellationToken.None);
27+
await popupService.ShowPopupAsync(new PopupOptions<ButtonPopup>(), CancellationToken.None);
2828
}
2929

3030
async void HandleMultipleButtonPopupButtonClicked(object sender, EventArgs e)
3131
{
32-
await popupService.ShowPopupAsync<MultipleButtonPopup>(new PopupOptions(), CancellationToken.None);
32+
await popupService.ShowPopupAsync(new PopupOptions<MultipleButtonPopup>(), CancellationToken.None);
3333
}
3434

3535
async void HandleNoOutsideTapDismissPopupClicked(object sender, EventArgs e)
3636
{
37-
await popupService.ShowPopupAsync<NoOutsideTapDismissPopup>(new PopupOptions(){CanBeDismissedByTappingOutsideOfPopup = false}, CancellationToken.None);
37+
await popupService.ShowPopupAsync(new PopupOptions<NoOutsideTapDismissPopup>(){CanBeDismissedByTappingOutsideOfPopup = false}, CancellationToken.None);
3838
}
3939

4040
async void HandleToggleSizePopupButtonClicked(object sender, EventArgs e)
4141
{
42-
await popupService.ShowPopupAsync<ToggleSizePopup>(new PopupOptions(), CancellationToken.None);
42+
await popupService.ShowPopupAsync(new PopupOptions<ToggleSizePopup>(), CancellationToken.None);
4343
}
4444

4545
async void HandleTransparentPopupButtonClicked(object sender, EventArgs e)
4646
{
47-
await popupService.ShowPopupAsync<TransparentPopup>(new PopupOptions(), CancellationToken.None);
47+
await popupService.ShowPopupAsync(new PopupOptions<TransparentPopup>(), CancellationToken.None);
4848
}
4949

5050
async void HandleOpenedEventSimplePopupButtonClicked(object sender, EventArgs e)
5151
{
52-
await popupService.ShowPopupAsync<OpenedEventSimplePopup>(new PopupOptions(), CancellationToken.None);
52+
await popupService.ShowPopupAsync(new PopupOptions<OpenedEventSimplePopup>(), CancellationToken.None);
5353
}
5454

5555
async void HandleReturnResultPopupButtonClicked(object sender, EventArgs e)
5656
{
57-
var result = await popupService.ShowPopupAsync< ReturnResultPopup, bool>(new PopupOptions(), CancellationToken.None);
57+
var result = await popupService.ShowPopupAsync<ReturnResultPopup, bool>(new PopupOptions<ReturnResultPopup>(), CancellationToken.None);
5858

5959
await DisplayAlert("Pop Result Returned", $"Result: {result.Result}", "OK");
6060
}
6161

6262
async void HandleXamlBindingPopupPopupButtonClicked(object sender, EventArgs e)
6363
{
64-
await popupService.ShowPopupAsync<XamlBindingPopup>(new PopupOptions(), CancellationToken.None);
64+
await popupService.ShowPopupAsync(new PopupOptions<XamlBindingPopup>(), CancellationToken.None);
6565
}
6666
}

samples/CommunityToolkit.Maui.Sample/Pages/Views/Popup/PopupLayoutAlignmentPage.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ async void ShowPopupButtonClicked(object sender, EventArgs e)
2020
HeightRequest = double.Parse(heightEntry.Text)
2121
};
2222

23-
await Navigation.ShowPopup(redBlueBoxPopup, new PopupOptions());
23+
await Navigation.ShowPopup(redBlueBoxPopup, new PopupOptions<RedBlueBoxPopup>());
2424
}
2525
}

samples/CommunityToolkit.Maui.Sample/Pages/Views/Popup/ShowPopupInOnAppearingPage.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ protected override async void OnAppearing()
2323
{
2424
var cts = new CancellationTokenSource(TimeSpan.FromSeconds(5));
2525
// Proves that we now support showing a popup before the platform is even ready.
26-
await popupService.ShowPopupAsync<ReturnResultPopup>(new PopupOptions(), cts.Token);
26+
await popupService.ShowPopupAsync(new PopupOptions<ReturnResultPopup>(), cts.Token);
2727
}
2828
}

samples/CommunityToolkit.Maui.Sample/ViewModels/Views/Popup/CustomSizeAndPositionPopupViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public Task ExecuteShowButton(CancellationToken token)
9898
HeightRequest = Height
9999
};
100100

101-
return Shell.Current.Navigation.ShowPopup(popup, new PopupOptions());
101+
return Shell.Current.Navigation.ShowPopup(popup, new PopupOptions<FlowDirectionPopup>());
102102
}
103103

104104
static bool IsFlowDirectionSelectionValid(int flowDirectionSelection, int flowDirectionOptionsCount)

samples/CommunityToolkit.Maui.Sample/ViewModels/Views/Popup/PopupAnchorViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ static async Task ShowPopup(View anchor)
1616
{
1717

1818
};
19-
await MainPage.Navigation.ShowPopup(popup, new PopupOptions());
19+
await MainPage.Navigation.ShowPopup(popup, new PopupOptions<TransparentPopup>());
2020
}
2121
}

samples/CommunityToolkit.Maui.Sample/ViewModels/Views/Popup/PopupPositionViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ static async Task DisplayPopup(PopupPosition position)
1515
{
1616
var popup = new TransparentPopup();
1717

18-
await Page.Navigation.ShowPopup(popup, new PopupOptions());
18+
await Page.Navigation.ShowPopup(popup, new PopupOptions<TransparentPopup>());
1919
}
2020

2121
public enum PopupPosition

samples/CommunityToolkit.Maui.Sample/ViewModels/Views/Popup/PopupSizingIssuesViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ async Task OnShowPopup(Page page)
6363

6464
popup.Content = container;
6565

66-
await page.Navigation.ShowPopup(popup, new PopupOptions());
66+
await page.Navigation.ShowPopup(popup, new PopupOptions<Popup>());
6767
}
6868

6969
static Label GetContentLabel(in string text) => new()

samples/CommunityToolkit.Maui.Sample/ViewModels/Views/Popup/StylePopupViewModel.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,48 +13,48 @@ public partial class StylePopupViewModel : BaseViewModel
1313
static async Task DisplayImplicitStylePopup()
1414
{
1515
var popup = new ImplicitStylePopup();
16-
await MainPage.Navigation.ShowPopup(popup, new PopupOptions());
16+
await MainPage.Navigation.ShowPopup(popup, new PopupOptions<ImplicitStylePopup>());
1717
}
1818

1919
[RelayCommand]
2020
static async Task DisplayExplicitStylePopup()
2121
{
2222
var popup = new ExplicitStylePopup();
23-
await MainPage.Navigation.ShowPopup(popup, new PopupOptions());
23+
await MainPage.Navigation.ShowPopup(popup, new PopupOptions<ExplicitStylePopup>());
2424
}
2525

2626
[RelayCommand]
2727
static async Task DisplayDynamicStylePopup()
2828
{
2929
var popup = new DynamicStylePopup();
30-
await MainPage.Navigation.ShowPopup(popup, new PopupOptions());
30+
await MainPage.Navigation.ShowPopup(popup, new PopupOptions<DynamicStylePopup>());
3131
}
3232

3333
[RelayCommand]
3434
static async Task DisplayApplyToDerivedTypesPopup()
3535
{
3636
var popup = new ApplyToDerivedTypesPopup();
37-
await MainPage.Navigation.ShowPopup(popup, new PopupOptions());
37+
await MainPage.Navigation.ShowPopup(popup, new PopupOptions<ApplyToDerivedTypesPopup>());
3838
}
3939

4040
[RelayCommand]
4141
static async Task DisplayStyleInheritancePopup()
4242
{
4343
var popup = new StyleInheritancePopup();
44-
await MainPage.Navigation.ShowPopup(popup, new PopupOptions());
44+
await MainPage.Navigation.ShowPopup(popup, new PopupOptions<StyleInheritancePopup>());
4545
}
4646

4747
[RelayCommand]
4848
static async Task DisplayDynamicStyleInheritancePopup()
4949
{
5050
var popup = new DynamicStyleInheritancePopup();
51-
await MainPage.Navigation.ShowPopup(popup, new PopupOptions());
51+
await MainPage.Navigation.ShowPopup(popup, new PopupOptions<DynamicStyleInheritancePopup>());
5252
}
5353

5454
[RelayCommand]
5555
static async Task DisplayStyleClassPopup()
5656
{
5757
var popup = new StyleClassPopup();
58-
await MainPage.Navigation.ShowPopup(popup, new PopupOptions());
58+
await MainPage.Navigation.ShowPopup(popup, new PopupOptions<StyleClassPopup>());
5959
}
6060
}

samples/CommunityToolkit.Maui.Sample/Views/Popups/OpenedEventSimplePopup.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public partial class OpenedEventSimplePopup
99
public OpenedEventSimplePopup()
1010
{
1111
InitializeComponent();
12-
OnOpened = async () =>
12+
OnOpened += async (s,e) =>
1313
{
1414
await Task.Delay(TimeSpan.FromSeconds(1));
1515

0 commit comments

Comments
 (0)