-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Custom NavigationPage is not working properly Prism 7 #1166
Comments
Good find. This is related to the new ReverseNavigation method added to the NavigationService to address two other bugs. The work around is to add the following ctor to your custom NavigationPage:
|
This has been fixed. You can try it out by using the latest CI build on MyGet https://www.myget.org/gallery/prism You should delete that workaround code now :) |
@brianlagunas - It seems that I still need to have the ctor above if I have a custom NavigationPage on a TabbedPage. Otherwise, I am getting the following exception System.MissingMethodException: Constructor on type 'WellRx.Forms.Views.MyNavigationPage' not found. Is this a regression of the previous bug? MainTabbed.xaml <?xml version="1.0" encoding="UTF-8"?>
<TabbedPage
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:views="clr-namespace:MyApp.Forms.Views;assembly=MyApp.Forms"
x:Class="MyApp.Forms.Views.MainTabbedPage">
<TabbedPage.Children>
<views:MyNavigationPage Title="Tab1">
<x:Arguments>
<views:Tab1Page />
</x:Arguments>
</views:MyNavigationPage>
<views:MyNavigationPage Title="Tab2">
<x:Arguments>
<views:Tab2Page />
</x:Arguments>
</views:MyNavigationPage>
</views:TabbedPage.Children>
</TabbedPage> MyNavigationPage.cs public class MyNavigationPage : NavigationPage
{
public MyNavigationPage()
{
BarTextColor = (Color)Application.Current.Resources["primary-color"];
BarBackgroundColor = Color.White;
}
} Package infoPlatform: Visual Studio for Mac |
Can confirm the issue still exists and needs the workaround. |
This original issue does not exist anymore. If you are talking about the requirement for having a ctor that accepts a page when using it in a TabbedPage, then that is correct. That is required by the XAML parser to define a NavigationPage in XAML. |
I am having the same issue but i am not using a custom navigation page i am using the default navigation page provided by Prism. |
@bakhti346 Prism doesn't provide a default NavigationPage |
I think he means the default navigation page provided by Forms:
I've also tried:
|
@JoeDurand3 I cannot duplicate. Custom navigation pages are working fine for me. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Custom NavigationPage is not working properly
I have navigation like this
await NavigationService.NavigateAsync("app:///TestNavigationPage/MainPage", navPar);
MainPageViewModel's constructor is getting called 2 times
If am changing to
await NavigationService.NavigateAsync("app:///NavigationPage/MainPage", navPar);
MainPageViewModel's constructor is getting called 1 time only which is should be
Package info
Repro steps
https://www.dropbox.com/s/xlt5o67by7m0vym/PrismUnityApp1.zip?dl=0
The text was updated successfully, but these errors were encountered: