Frame
Namespace: FluentAvalonia.UI.Controls
Displays Avalonia.Controls.UserControl
instances (Pages in WinUI), supports navigation to new pages, and maintains a navigation history to support forward and backward navigation.
C#
public class Frame : ContentControl
Xaml
<ui:Frame />
Required Template Parts
Name | Control Type |
---|---|
ContentPresenter | ContentPresenter |
Pseudoclasses
:disabled, :focus, :focus-visible, :focus-within, :pointerover
Examples and Usage Notes
None yet.
API
Note: Inherited members are not shown
Properties
BackStack | Gets a collection of `FluentAvalonia.UI.Navigation.PageStackEntry` instances representing the backward navigation history of the Frame. |
BackStackDepth | Gets the number of entries in the navigation back stack. |
BackStackDepthProperty | Defines the `FluentAvalonia.UI.Controls.Frame.BackStackDepth` property |
BackStackProperty | Defines the `FluentAvalonia.UI.Controls.Frame.BackStack` property |
CacheSize | Gets or sets the number of pages in the navigation history that can be cached for the frame. |
CacheSizeProperty | Defines the `FluentAvalonia.UI.Controls.Frame.CacheSize` property |
CanGoBack | Gets a value that indicates whether there is at least one entry in back navigation history. |
CanGoBackProperty | Defines the `FluentAvalonia.UI.Controls.Frame.CanGoBack` property |
CanGoForward | Gets a value that indicates whether there is at least one entry in forward navigation history. |
CanGoForwardProperty | Defines the `FluentAvalonia.UI.Controls.Frame.CanGoForward` property |
CurrentSourcePageType | Gets a type reference for the content that is currently displayed. |
CurrentSourcePageTypeProperty | Defines the `FluentAvalonia.UI.Controls.Frame.CurrentSourcePageType` property |
ForwardStack | Gets a collection of `FluentAvalonia.UI.Navigation.PageStackEntry` instances representing the forward navigation history of the Frame. |
ForwardStackProperty | Defines the `FluentAvalonia.UI.Controls.Frame.ForwardStack` property |
IsNavigationStackEnabled | Gets or sets a value that indicates whether navigation is recorded in the Frame's `FluentAvalonia.UI.Controls.Frame.ForwardStack` or `FluentAvalonia.UI.Controls.Frame.BackStack`. |
IsNavigationStackEnabledProperty | Defines the `FluentAvalonia.UI.Controls.Frame.IsNavigationStackEnabled` property |
NavigationPageFactory | Gets or sets the user specified factory that should be use for resolving pages when types are not controls or from object instances directly |
NavigationPageFactoryProperty | Defines the `FluentAvalonia.UI.Controls.Frame.NavigationPageFactory` property |
SourcePageType | Gets or sets a type reference of the current content, or the content that should be navigated to. |
SourcePageTypeProperty | Defines the `FluentAvalonia.UI.Controls.Frame.SourcePageType` property |
Events
Navigated | Occurs when the content that is being navigated to has been found and is available from the Content property, although it may not have completed loading. |
NavigatedFromEvent | Indiates to a page that it has been navigated away from. Takes the place of Microsoft.UI.Xaml.Controls.Page.OnNavigatedFrom() method |
NavigatedToEvent | Indiates to a page that it is being navigated to. Takes the place of Microsoft.UI.Xaml.Controls.Page.OnNavigatedTo() method |
Navigating | Occurs when a new navigation is requested. |
NavigatingFromEvent | Indicates to a page that it is being navigated away from. Takes the place of Microsoft.UI.Xaml.Controls.Page.OnNavigatingFrom() method |
NavigationFailed | Occurs when an error is raised while navigating to the requested content. |
NavigationStopped | Occurs when a new navigation is requested while a current navigation is in progress. |
Methods
GoBack() | Navigates to the most recent item in back navigation history, if a Frame manages its own navigation history. |
GoBack(NavigationTransitionInfo) | Navigates to the most recent item in back navigation history, if a Frame manages its own navigation history, and specifies the animated transition to use. |
GoForward() | Navigates to the most recent item in forward navigation history, if a Frame manages its own navigation history. |
Navigate(Type) | Causes the Frame to load content represented by the specified Page. |
Navigate(Type, Object) | Causes the Frame to load content represented by the specified Page, also passing a parameter to be interpreted by the target of the navigation. |
Navigate(Type, Object, NavigationTransitionInfo) | Causes the Frame to load content represented by the specified Page -derived data type, also passing a parameter to be interpreted by the target of the navigation, and a value indicating the animated transition to use. |
NavigateToType(Type, Object, FrameNavigationOptions) | Causes the Frame to load content represented by the specified Page, also passing a parameter to be interpreted by the target of the navigation. |
NavigateFromObject(Object, FrameNavigationOptions) | Causes the frame to load content represented by the specified target property with the specified navigation options |
GetNavigationState() | Serializes the Frame navigation history into a string |
SetNavigationState(String) | Reads and restores the navigation history of a Frame from a provided serialization string. |
SetNavigationState(String, Boolean) | Reads and restores the navigation history of a Frame from a provided serialization string, and optionally supresses navigation to the last page type |
Related Enums/Classes
PageStackEntry
SourcePageType | Gets the type of page associated with this navigation entry. |
NavigationTransitionInfo | Gets a value that indicates the animated transition associated with the navigation entry. |
Parameter | Gets the navigation parameter associated with this navigation entry. |
INavigationPageFactory
GetPage(Type) | Returns a user specified page based on the given type passed to |
GetPageFromObject(Object) | Returns a user specified page based on an instance of an existing object |
NavigationEventArgs
Content | Gets the root node of the target page's content. |
NavigationMode | Gets a value that indicates the direction of movement during navigation |
Parameter | Gets any "Parameter" object passed to the target page for the navigation. |
SourcePageType | Gets the data type of the source page. |
NavigationTransitionInfo | Gets a value that indicates the animated transition associated with the navigation. |
NavigatingCancelEventArgs
Cancel | Specifies whether a pending navigation should be canceled. |
NavigationMode | Gets the value of the mode parameter from the originating Navigate call. |
SourcePageType | Gets the value of the SourcePageType parameter from the originating Navigate call. |
NavigationTransitionInfo | Gets a value that indicates the animated transition associated with the navigation. |
Parameter | Gets the navigation parameter associated with this navigation. |
NavigationFailedEventArgs
Handled | Gets or sets a value that indicates whether the failure event has been handled. |
Exception | Gets the result code for the exception that is associated with the failed navigation. |
SourcePageType | Gets the data type of the target page. |