Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[GH-10729] Added Current Page in Shell #10979

Merged
merged 9 commits into from
Aug 28, 2020
Merged

Conversation

pictos
Copy link
Contributor

@pictos pictos commented Jun 7, 2020

Description of Change

This PR provides an easy way to access the PresentedPage in Shell applications.

Issues Resolved

API Changes

Added:

  • Page Shell.CurrentPage { get; }
  • Shell : IPageContainer<Page>

Platforms Affected

  • Core/XAML (all platforms)

Behavioral/Visual Changes

None

Before/After Screenshots

Not applicable

Testing Procedure

Create an AppShell, and access the Shell.Current.CurrentPage, its value should be the presented page. Also, I added some unit tests.

PR Checklist

  • Targets the correct branch
  • Tests are passing (or failures are unrelated)

@StephaneDelcroix
Copy link
Member

@PureWeen opinion on this ?

@samhouts samhouts changed the base branch from master to main June 26, 2020 00:02
@gresolio
Copy link

gresolio commented Jul 3, 2020

Definitely a very useful enhancement, it would be nice to have access to the PresentedPage and stop using workarounds like this: (Shell.Current?.CurrentItem?.CurrentItem as IShellSectionController)?.PresentedPage

@pictos
Copy link
Contributor Author

pictos commented Jul 18, 2020

@PureWeen, something else fixed that issue, the code works without the Device.BeginInvokeOnMainThread, also all the core Shell tests are green.

@PureWeen PureWeen changed the base branch from main to 5.0.0 August 27, 2020 17:25
@PureWeen
Copy link
Contributor

@PureWeen PureWeen merged commit e566a4d into xamarin:5.0.0 Aug 28, 2020
@pictos pictos deleted the fix-10729 branch August 28, 2020 12:49
@samhouts samhouts added this to the 5.0.0 milestone Sep 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Enhancement] Provide an easy way to get the Current Page at Shell
5 participants