Skip to content

Commit

Permalink
[Testing] Navigate directly to control tests (#25242)
Browse files Browse the repository at this point in the history
* Like with issues, set gallery items as mainpage directly

* More changes
  • Loading branch information
jsuarezruiz authored Oct 14, 2024
1 parent 67b00cb commit 4028fc1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ internal CoreGalleryBasePage()
new Button()
{
Text = "Dismiss Page",
Command = new Command(async () =>
Command = new Command(() =>
{
if (_picker.SelectedIndex == 0)
await Navigation.PopAsync();
Application.Current.Quit();
else
_picker.SelectedIndex--;
})
Expand Down
12 changes: 3 additions & 9 deletions src/Controls/tests/TestCases.HostApp/CoreViews/CorePageView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public CorePageView(Page rootPage)
ItemTemplate = template;
ItemsSource = _pages;

ItemSelected += async (sender, args) =>
ItemSelected += (sender, args) =>
{
if (SelectedItem == null)
{
Expand All @@ -134,14 +134,8 @@ public CorePageView(Page rootPage)
if (item is GalleryPageFactory page)
{
var realize = page.Realize();
if (realize is Shell)
{
Application.Current.MainPage = realize;
}
else
{
await PushPage(realize);
}
Application.Current.MainPage = realize;
}
SelectedItem = null;
Expand Down

0 comments on commit 4028fc1

Please sign in to comment.