-
Notifications
You must be signed in to change notification settings - Fork 138
Open
Description
I tested my app with AOT today and found that it might be helpful to annotate the sourcePageType parameter with [DynamicallyAccessedMembers]:
FluentAvalonia/src/FluentAvalonia/UI/Controls/Frame/Frame.cs
Lines 177 to 197 in c8f96b4
| public bool Navigate(Type sourcePageType, object parameter, NavigationTransitionInfo infoOverride) | |
| { | |
| return NavigateCore(new PageStackEntry(sourcePageType, parameter, | |
| infoOverride), NavigationMode.New); | |
| } | |
| /// <summary> | |
| /// Causes the Frame to load content represented by the specified Page, also passing a parameter to be | |
| /// interpreted by the target of the navigation. | |
| /// </summary> | |
| /// <param name="sourcePageType">The page (IControl) to navigate to, specified as a type reference to its class type, or | |
| /// if a <see cref="NavigationPageFactory"/> this can be any type (e.g., a ViewModel)</param> | |
| /// <param name="parameter">The navigation parameter to pass to the target page; must have a basic type | |
| /// (string, char, numeric, or GUID) to support parameter serialization using GetNavigationState.</param> | |
| /// <param name="navOptions">Options for the navigation, including whether it is recorded in the navigation stack | |
| /// and what transition animation is used.</param> | |
| /// <returns><c>false</c> if a <see cref="NavigationFailed"/> event handler has set Handled to true; | |
| /// otherwise, <c>true</c>.</returns> | |
| public bool NavigateToType(Type sourcePageType, object parameter, FrameNavigationOptions navOptions) => | |
| NavigateCore(new PageStackEntry(sourcePageType, parameter, navOptions?.TransitionInfoOverride), | |
| NavigationMode.New, navOptions); |
The minimal configuration could be [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)], and this is enough for my project to work. Not sure if [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] is neccessary.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels