Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

NavigationPage issue after XamarinForms and Prism updates

$
0
0

Hi,
I updated out app from Xamarin.Forms 2.4 to 2.5 and from Prism 6.3 to 7.0.

I have made some changes to App.cs and AppDelegate.cs / MainActivity.cs (as described on Prims page) but when I launch the app it crashes on the splash screen.

I added Xaml compilation option ([assembly: XamlCompilation(XamlCompilationOptions.Compile)]) and it gives me 1 error:

/Users/mj/Projects/DemoApp/DemoApp/Views/SideNavigationPage.xaml(3,3): 
Error: Position 7:3. Can not set the content of NavigationPage as it doesn't have a ContentPropertyAttribute (DemoApp)

SideNavigationPage Xaml code:

<?xml version="1.0" encoding="utf-8" ?>
<NavigationPage xmlns="link"
  xmlns:x="link"
  xmlns:prism="clr-namespace:Prism.Mvvm;assembly=Prism.Forms"
  prism:ViewModelLocator.AutowireViewModel="True"
  x:Class="DemoApp.Views.SideBarNavigationPage">
    <StackLayout>
        <Label Text="{Binding Title}" VerticalOptions="Center" HorizontalOptions="Center" />
        <Button Command="{Binding NavigateCommand}" Text="Navigate" />
    </StackLayout>
</NavigationPage>

and xaml.cs

    using Prism.Navigation;
    using Xamarin.Forms;

    namespace DemoApp.Views
    {
        public partial class SideBarNavigationPage : NavigationPage, INavigationPageOptions, IDestructible
        {
            public SideBarNavigationPage()
            {
                InitializeComponent();
            }
            public bool ClearNavigationStackOnNavigation
            {
                get { return true; }
            }
            public void Destroy()
            {
            }
        }
    }

Is there anything else I need to change?


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>