0
votes

I have a simple question, How I add in the carouselPage an external page from a diffent folder?

<?xml version="1.0" encoding="utf-8" ?>
<CarouselPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
          xmlns:local="clr-namespace:TutoSuite;assembly=TutoSuite"
         x:Class="TutoSuite.navigation.CrouselPage">
  <local:MainPage/>
</CarouselPage>

This code works perfectly but when I'm trying to access to an other page who are in a folder and not directly in the root like this. (Client here is a folder where I have all my client's pages)

<?xml version="1.0" encoding="utf-8" ?>
<CarouselPage xmlns="http://xamarin.com/schemas/2014/forms"
         xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
          xmlns:local="clr-namespace:TutoSuite;assembly=TutoSuite"
         x:Class="TutoSuite.navigation.CrouselPage">
  <local:Client.ClientFirstpage/>
</CarouselPage>

I have this error:

Error Position 7:7. Type Client not found in xmlns clr-namespace:TutoSuite;assembly=TutoSuite

can someone help me? thanks in advance

1

1 Answers

1
votes

To fix your error, you have to add a reference to the Client namespace, because inner namespaces isn't allowed (local:Client.ClientFirstpage ).

The first step is adding the client namespace reference:

xmlns:client="clr-namespace:TutoSuite.Client"

And then use this reference for the ClientFirstpage

<?xml version="1.0" encoding="utf-8" ?>
<CarouselPage xmlns="http://xamarin.com/schemas/2014/forms"
         xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
         xmlns:local="clr-namespace:TutoSuite;assembly=TutoSuite"
         xmlns:client="clr-namespace:TutoSuite.Client"
         x:Class="TutoSuite.navigation.CrouselPage">
  <client.ClientFirstpage/>
</CarouselPage>