Make it possible to raise page events (NavigatingFrom, NavigatedFrom, NavigatingTo and NavigatedTo) from page descendants
Open
Nobody has claimed this yet.
area-architecture
area-core-lifecycle
area-navigation
proposal/open
- Dominant language
- C#
- Stars
- 23.3k
- Forks
- 2k
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 296
Description
Description
I develop custom controls and need to raise such events in my custom page implementations (like flyouts etc).
Public API Changes
It should be added some methods to Page class to raise Navigated events
public class Page: ... {
protected void RaiseNavigatedTo(NavigatedToEventArgs args)
{
NavigatedTo?.Invoke(this, args);
}
protected void RaiseNavigatingFrom(NavigatingFromEventArgs args)
{
NavigatingFrom?.Invoke(this, args);
}
protected void SendNavigatedFrom(NavigatedFromEventArgs args)
{
NavigatedFrom?.Invoke(this, args);
}
}
Intended Use-Case
I develop custom controls and need to raise such events.
public class MyCustomContainerPage : Page {
//.....
void OnMyContentChanged(Page oldContent, Page newContent) {
//. .....
//
oldContent?.RaiseNavigatedFrom(new NavigatedFromEventArgs(newContent));
newContent?.RaiseNavigatedTo(new NavigatedToEventArgs(oldContent));
}
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the Page class and its existing NavigatingFrom, NavigatedFrom, NavigatingTo, and NavigatedTo event declarations. Trace how navigation currently raises them, then determine how protected raiser methods should support custom Page descendants and verify that the intended custom-container scenario can raise the events.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100