NavigationPage Class
Definition
A navigation page that supports simple stack-based navigation.
public class NavigationPage
Constructors
| Name | Description |
|---|---|
| NavigationPage | Initializes a new instance of Avalonia.Controls.NavigationPage. |
NavigationPage Constructor
Initializes a new instance of Avalonia.Controls.NavigationPage.
public NavigationPage()
Methods
| Name | Description |
|---|---|
| AddHandler (2 overloads) | Adds a handler for the specified routed event. Inherited from Interactive. |
| ApplyStyling | Applies styling to the control if the control is initialized and styling is not already applied. Inherited from StyledElement. |
| ApplyTemplate | Creates the visual children of the control, if necessary Inherited from TemplatedControl. |
| Arrange | Arranges the control and its children. Inherited from Layoutable. |
| BeginInit | Inherited from StyledElement. |
| Bind (8 overloads) | Binds a Avalonia.AvaloniaProperty to an Avalonia.Data.BindingBase. Inherited from AvaloniaObject. |
| CheckAccess | Returns a value indicating whether the current thread is the UI thread. Inherited from AvaloniaObject. |
| ClearValue (4 overloads) | Clears a Avalonia.AvaloniaProperty's local value. Inherited from AvaloniaObject. |
| CoerceValue | Coerces the specified Avalonia.AvaloniaProperty. Inherited from AvaloniaObject. |
| EndInit | Inherited from StyledElement. |
| Equals | Compares two objects using reference equality. Inherited from AvaloniaObject. |
| Focus | Focuses the control. Inherited from InputElement. |
| GetBackButtonContent | Gets the custom back-button content for the specified page. |
| GetBarHeightOverride | Gets the per-page navigation bar height override for the specified page. |
| GetBarLayoutBehavior | Gets the bar layout behavior for the specified page. |
| GetBaseValue | Inherited from AvaloniaObject. |
| GetBottomCommandBar | Gets the bottom command bar assigned to the specified page. |
| GetFlowDirection | Gets the value of the attached Avalonia.Visual.FlowDirectionProperty on a control. Inherited from Visual. |
| GetHasBackButton | Gets whether the back button is visible for the specified page. |
| GetHashCode | Gets the hash code for the object. Inherited from AvaloniaObject. |
| GetHasNavigationBar | Gets whether the navigation bar is visible for the specified page. |
| GetHeader | Gets the header of the specified page. |
| GetIsBackButtonEnabled | Gets whether the back button is enabled for the specified page. |
| GetIsHoldingEnabled | Inherited from InputElement. |
| GetIsHoldWithMouseEnabled | Inherited from InputElement. |
| GetIsTemplateFocusTarget | Gets the value of the IsTemplateFocusTargetProperty attached property on a control. Inherited from TemplatedControl. |
| GetTopCommandBar | Gets the top command bar assigned to the specified page. |
| GetValue (3 overloads) | Gets a Avalonia.AvaloniaProperty value. Inherited from AvaloniaObject. |
| InsertPage | Inserts a page into the stack before the specified page. |
| InvalidateArrange | Invalidates the arrangement of the control and queues a new layout pass. Inherited from Layoutable. |
| InvalidateMeasure | Invalidates the measurement of the control and queues a new layout pass. Inherited from Layoutable. |
| InvalidateVisual | Invalidates the visual and queues a repaint. Inherited from Visual. |
| IsAnimating | Checks whether a Avalonia.AvaloniaProperty is animating. Inherited from AvaloniaObject. |
| IsSet | Checks whether a Avalonia.AvaloniaProperty is set on this object. Inherited from AvaloniaObject. |
| Measure | Carries out a measure of the control. Inherited from Layoutable. |
| PopAllModalsAsync (2 overloads) | Pops all modal pages using Avalonia.Controls.NavigationPage.ModalTransition. |
| PopAsync (2 overloads) | Pops the top page from the navigation stack asynchronously using Avalonia.Controls.NavigationPage.PageTransition. |
| PopModalAsync (2 overloads) | Pops the top modal page using Avalonia.Controls.NavigationPage.ModalTransition. |
| PopToPageAsync (2 overloads) | Pops to a specific page in the stack using Avalonia.Controls.NavigationPage.PageTransition. |
| PopToRootAsync (2 overloads) | Pops all pages to the root page using Avalonia.Controls.NavigationPage.PageTransition. |
| PushAsync (2 overloads) | Pushes page onto the navigation stack asynchronously using Avalonia.Controls.NavigationPage.PageTransition. |
| PushModalAsync (2 overloads) | Pushes a modal page using Avalonia.Controls.NavigationPage.ModalTransition. |
| RaiseEvent | Raises a routed event. Inherited from Interactive. |
| RemoveHandler (2 overloads) | Removes a handler for the specified routed event. Inherited from Interactive. |
| RemovePage | Removes a page from the navigation stack without animation. |
| Render | Renders the visual to a Avalonia.Media.DrawingContext. Inherited from Visual. |
| ReplaceAsync (2 overloads) | Replaces the top page with page using Avalonia.Controls.NavigationPage.PageTransition. |
| SetBackButtonContent | Sets custom content for the back button on the specified page. |
| SetBarHeightOverride | No summary available. |
| SetBarLayoutBehavior | No summary available. |
| SetBottomCommandBar | Sets a bottom command bar for the specified page. |
| SetCurrentValue (2 overloads) | Sets the value of a dependency property without changing its value source. Inherited from AvaloniaObject. |
| SetFlowDirection | Sets the value of the attached Avalonia.Visual.FlowDirectionProperty on a control. Inherited from Visual. |
| SetHasBackButton | Sets whether the back button is visible for the specified page. |
| SetHasNavigationBar | Sets whether the navigation bar is visible for the specified page. |
| SetHeader | Sets the header of the specified page. |
| SetIsBackButtonEnabled | Sets whether the back button is enabled for the specified page. |
| SetIsHoldingEnabled | Inherited from InputElement. |
| SetIsHoldWithMouseEnabled | Inherited from InputElement. |
| SetIsTemplateFocusTarget | Sets the value of the IsTemplateFocusTargetProperty attached property on a control. Inherited from TemplatedControl. |
| SetTopCommandBar | Sets a top command bar for the specified page. |
| SetValue (3 overloads) | Sets a Avalonia.AvaloniaProperty value. Inherited from AvaloniaObject. |
| TryGetResource | Inherited from StyledElement. |
| UpdateLayout | Executes a layout pass. Inherited from Layoutable. |
| VerifyAccess | Checks that the current thread is the UI thread and throws if not. Inherited from AvaloniaObject. |
GetBackButtonContent Method
Gets the custom back-button content for the specified page.
public object GetBackButtonContent(Avalonia.Controls.Page page)
Parameters
Returns
object
GetBarHeightOverride Method
Gets the per-page navigation bar height override for the specified page.
public Nullable<double> GetBarHeightOverride(Avalonia.Controls.Page page)
Parameters
Returns
Nullable<double>
GetBarLayoutBehavior Method
Gets the bar layout behavior for the specified page.
public Nullable<Avalonia.Controls.BarLayoutBehavior> GetBarLayoutBehavior(Avalonia.Controls.Page page)
Parameters
Returns
Nullable<Avalonia.Controls.BarLayoutBehavior>
GetBottomCommandBar Method
Gets the bottom command bar assigned to the specified page.
public Avalonia.Controls.Control GetBottomCommandBar(Avalonia.Controls.Page page)
Parameters
Returns
GetHasBackButton Method
Gets whether the back button is visible for the specified page.
public bool GetHasBackButton(Avalonia.Controls.Page page)
Parameters
Returns
bool
GetHasNavigationBar Method
Gets whether the navigation bar is visible for the specified page.
public bool GetHasNavigationBar(Avalonia.Controls.Page page)
Parameters
Returns
bool
GetHeader Method
Gets the header of the specified page.
public object GetHeader(Avalonia.Controls.Page page)
Parameters
Returns
object
GetIsBackButtonEnabled Method
Gets whether the back button is enabled for the specified page.
public bool GetIsBackButtonEnabled(Avalonia.Controls.Page page)
Parameters
Returns
bool
GetTopCommandBar Method
Gets the top command bar assigned to the specified page.
public Avalonia.Controls.Control GetTopCommandBar(Avalonia.Controls.Page page)
Parameters
Returns
InsertPage Method
Inserts a page into the stack before the specified page.
public void InsertPage(Avalonia.Controls.Page page, Avalonia.Controls.Page before)
Parameters
before Avalonia.Controls.Page
Remarks
If a navigation transition is already in progress (Avalonia.Controls.NavigationPage.IsNavigating is ), this call is a no-op: the page is not inserted and no events are raised.
PopAllModalsAsync overloads
PopAllModalsAsync Method
Pops all modal pages using Avalonia.Controls.NavigationPage.ModalTransition.
public System.Threading.Tasks.Task PopAllModalsAsync()
Returns
System.Threading.Tasks.Task
Remarks
All modals are dismissed in a single transition rather than one-by-one, so lifecycle events differ from calling Avalonia.Controls.NavigationPage.PopModalAsync in a loop:
- Avalonia.Controls.Page.Navigating is consulted only on the topmost modal. Intermediate modals do not receive a cancellation opportunity. If the top modal cancels, the entire dismiss is aborted and no modals are popped.
- Avalonia.Controls.Page.NavigatedFrom fires on every dismissed modal in LIFO order.
- Avalonia.Controls.Page.NavigatedTo fires only on Avalonia.Controls.Page.CurrentPage.
PopAllModalsAsync Method
Pops all modal pages using transition.
public System.Threading.Tasks.Task PopAllModalsAsync(Avalonia.Animation.IPageTransition transition)
Parameters
transition Avalonia.Animation.IPageTransition
Returns
System.Threading.Tasks.Task
Remarks
All modals are dismissed in a single transition rather than one-by-one, so lifecycle events differ from calling Avalonia.Controls.NavigationPage.PopModalAsync in a loop:
- Avalonia.Controls.Page.Navigating is consulted only on the topmost modal. Intermediate modals do not receive a cancellation opportunity. If the top modal cancels, the entire dismiss is aborted and no modals are popped.
- Avalonia.Controls.Page.NavigatedFrom fires on every dismissed modal in LIFO order.
- Avalonia.Controls.Page.NavigatedTo fires only on Avalonia.Controls.Page.CurrentPage.
PopAsync overloads
PopAsync Method
Pops the top page from the navigation stack asynchronously using Avalonia.Controls.NavigationPage.PageTransition.
public System.Threading.Tasks.Task<Avalonia.Controls.Page> PopAsync()
Returns
System.Threading.Tasks.Task<Avalonia.Controls.Page>
Remarks
Returns if the stack has only the root page or if a navigation transition is already in progress (Avalonia.Controls.NavigationPage.IsNavigating is ).
PopAsync Method
Pops the top page from the navigation stack asynchronously using transition.
public System.Threading.Tasks.Task<Avalonia.Controls.Page> PopAsync(Avalonia.Animation.IPageTransition transition)
Parameters
transition Avalonia.Animation.IPageTransition
Returns
System.Threading.Tasks.Task<Avalonia.Controls.Page>
PopModalAsync overloads
PopModalAsync Method
Pops the top modal page using Avalonia.Controls.NavigationPage.ModalTransition.
public System.Threading.Tasks.Task<Avalonia.Controls.Page> PopModalAsync()
Returns
System.Threading.Tasks.Task<Avalonia.Controls.Page>
Remarks
Returns if there are no modal pages or if a navigation transition is already in progress (Avalonia.Controls.NavigationPage.IsNavigating is ).
PopModalAsync Method
Pops the top modal page using transition.
public System.Threading.Tasks.Task<Avalonia.Controls.Page> PopModalAsync(Avalonia.Animation.IPageTransition transition)
Parameters
transition Avalonia.Animation.IPageTransition
Returns
System.Threading.Tasks.Task<Avalonia.Controls.Page>