Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Xaml errors in Xamarin: all types not found

I designed an Android application on Adobe XD and through a plugin I exported all my assets to XAML.

I created a new project on Xamarin and immediately pasted the generated XAML in the MainPage.xaml file within the stacklayout. so like below:

<stacklayout>
      <Grid Uid="Google Pixel 6 Pro – 1"  Width="412" Height="778" Background="#0000" ClipToBounds="True" >
            <Border  Width="225" Height="43" BorderBrush="#0000" Margin="171,18,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" />
            <Canvas  Width="36" Height="30" Margin="24,24,0,0" HorizontalAlignment="Left" VerticalAlignment="Top">
                <Border  Width="24" Height="24" BorderBrush="#FFFF" Canvas.Left="5" Canvas.Top="6"  />


....

The problem is that anything I pasted in the layout is giving me the below error message:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

The type ‘border’ was not found. verify that you are not missing an
assembly reference and that all referenced assemblies have been built.
Xaml0414: namespace is missing

I’m getting this for every component. Border, canvas, textblock, and even sub parameters like uid.

This is what i have at the top

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="DemoXAML.MainPage">

I’m not quite sure what I am missing

>Solution :

The thing is that this code converter that you used did convert your code to XAML, But the XAML is WPF and not Xamarin.Forms(Yes not everything between them is the same).

<Border  Width="225" Height="43" BorderBrush="#0000" Margin="171,18,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" />

Is WPF XAML not Xamarin, The closest to it is you use Xamarin.Forms Frame but they are not the same.

A little googling between the two will help.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading