9
votes

I'm building an app using Xamarin.Forms and while making a XAML page I get the following error:

The property "Class" does not exist in the "http://schemas.microsoft.com/winfx/2009/xaml" namespace.

This is not the first page I've made and all other pages seem to work fine except for this one. I've checked the references and the properties of said file and they all seem fine.

Here's my code:

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

The code behind is as follows:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using XXXX;
using Xamarin.Forms;

namespace XXXX
{
    public partial class ActOverviewView : ViewPage, IActOverviewView
    {
        public ActOverviewView()
        {
            InitializeComponent();
        }
    }
}

I'm using Visual Studio 2015

1
Have you inherited your behind class from ViewPage? Put your behind code for this page, too.Yehor Hromadskyi
Okay I added it. I've looked at it with 3 different professional programmers (excluding myself) and one of them suggested that it may be that Xamarin doesn't deal very well with UWP, could that be what's causing this?Stinna
I don't think so, also you told, that all other pages work fine. Maybe, xmlns:controls namespace is wrongYehor Hromadskyi
The other pages are not UWP, but droid and IOS so that's why we thought that maybe that's the problem. I've checked all namespaces etc. multiple times, so I don't think that's it. I've just skipped the UWP for now and will maybe pick it up later if I have enough time unless someone here comes with a solution :).Stinna
Make sure the xaml file is an embeddedresource and that the generator is set to "MSBuild:UpdateDesignTimeXaml"Stephane Delcroix

1 Answers

0
votes

Should be:

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