Skip to content
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

Navigation Events #1812

Merged
merged 10 commits into from Jul 27, 2021
Merged

Navigation Events #1812

merged 10 commits into from Jul 27, 2021

Conversation

PureWeen
Copy link
Member

@PureWeen PureWeen commented Jul 26, 2021

Description of Change

Some timing fixes that need to happen
#1817

NavigationPage

  • Fires for pushed page and previouspage
  • Fires for popped page and landed on page
  • PopToRoot fires for root page and currently visible page

TabbedPage

  • fires for tab you are currently on and tab you navigated to

ModalPage

  • Fires for top level window page when the first modal page is pushed
  • Fires for top level window page when the last modal page is popped
  • Fires for previous modal page and next modal page when pushing a second modal page

Additions made

public class Page
{
	public event EventHandler<NavigatedToEventArgs> NavigatedTo;
	public event EventHandler<NavigatingFromEventArgs> NavigatingFrom;
	public event EventHandler<NavigatedFromEventArgs> NavigatedFrom;		
	protected virtual void OnNavigatedTo(NavigatedToEventArgs args) { }
	protected virtual void OnNavigatingFrom(NavigatingFromEventArgs args) { }
	protected virtual void OnNavigatedFrom(NavigatedFromEventArgs args) { }
}
public sealed class NavigatingFromEventArgs : EventArgs
{

}

public sealed class NavigatedToEventArgs : EventArgs
{
}

public sealed class NavigatedFromEventArgs : EventArgs
{
}

@PureWeen PureWeen added this to the 6.0.100-preview.7 milestone Jul 26, 2021
@AmrAlSayed0
Copy link
Contributor

public class Page
{
	public event EventHandler<NavigatingToEventArgs> NavigatingTo;	
	protected virtual void OnNavigatingTo(NavigatingToEventArgs args) { }
}

Maybe? An event that fires before the animation starts and NavigatedTo fires after it ends? It could be used to set-up the ViewModel and maybe fetch data from an API while the animation is happening.

@PureWeen PureWeen marked this pull request as ready for review July 26, 2021 21:11
@PureWeen
Copy link
Member Author

@AmrAlSayed0 for now that's what Appearing will be for

@mattleibow mattleibow merged commit 4e8c7e7 into main Jul 27, 2021
@mattleibow mattleibow deleted the page_lifecycle_nav branch July 27, 2021 01:00
@angelru
Copy link

angelru commented Aug 24, 2021

public class Page
{
	public event EventHandler<NavigatingToEventArgs> NavigatingTo;	
	protected virtual void OnNavigatingTo(NavigatingToEventArgs args) { }
}

Maybe? An event that fires before the animation starts and NavigatedTo fires after it ends? It could be used to set-up the ViewModel and maybe fetch data from an API while the animation is happening.

It would be fine, with shell I found the issue that I put here:
[Bug] Shell Navigation Animation

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.

None yet

5 participants