Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C#/XAML Compile Error - Various Errors (The name "LayoutAwarePage" does not exist")

EDIT:

Here are the pastebins for the code:

BasicPage1.xaml.cs

BasicPage1.xaml

LayoutAwarePage.cs

EDIT 2

I have added a MS Connect ticket here:

https://connect.microsoft.com/VisualStudio/feedback/details/771648/c-xaml-compile-error-various-errors-the-name-layoutawarepage-does-not-exist#tabs

Right a head scratcher which I'm hoping others have experienced and know how to resolved as I'm a little disheartened by the whole affair.

The Problem

I have been working on a Windows Store App using C#/XAML to learn the ropes. After hours spent learning I decided to start my own App, which is fine. The issue is, after adding a few Views etc, I started getting the following error within my XAML files (All of them):

Error 5 The name "LayoutAwarePage" does not exist in the namespace "using:Accountable.Common". G:\Coding Projects\Visual Studio 2012\SAVED\Accountable\Accountable\BasicPage1.xaml 1 1 Accountable

Which is strange because the Accountable.Common is declared within the XAML file:

<common:LayoutAwarePage
x:Name="pageRoot"
x:Class="Accountable.BasicPage1"
DataContext="{Binding DefaultViewModel, RelativeSource={RelativeSource Self}}"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Accountable"
xmlns:common="using:Accountable.Common"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">

So i read here that closing the XAML files down and closing Visual Studio 2012 and re-opening, plus Building, resolves this issue. It didnt. It now causes the following errors within the Common files created when you first create new templates:

Error 1 'Accountable.Common.BooleanNegationConverter' does not implement interface member 'Windows.UI.Xaml.Data.IValueConverter.ConvertBack(object, System.Type, object, string)' G:\Coding Projects\Visual Studio 2012\SAVED\Accountable\Accountable\Common\BooleanNegationConverter.cs 9 25 Accountable

Error 2 'Accountable.Common.BooleanNegationConverter' does not implement interface member 'Windows.UI.Xaml.Data.IValueConverter.Convert(object, System.Type, object, string)' G:\Coding Projects\Visual Studio 2012\SAVED\Accountable\Accountable\Common\BooleanNegationConverter.cs 9 25 Accountable

Error 3 'Accountable.Common.BooleanToVisibilityConverter' does not implement interface member 'Windows.UI.Xaml.Data.IValueConverter.ConvertBack(object, System.Type, object, string)' G:\Coding Projects\Visual Studio 2012\SAVED\Accountable\Accountable\Common\BooleanToVisibilityConverter.cs 20 25 Accountable

Error 4 'Accountable.Common.BooleanToVisibilityConverter' does not implement interface member 'Windows.UI.Xaml.Data.IValueConverter.Convert(object, System.Type, object, string)' G:\Coding Projects\Visual Studio 2012\SAVED\Accountable\Accountable\Common\BooleanToVisibilityConverter.cs 20 25 Accountable

I haven't changed BooleanNegationConverter.cs or BooleanToVisibility.cs. What have i done to try and resolved the issue:

  1. Investigated other SO Posts, to no avail
  2. Deleted the Solution SUO File with no luck
  3. Removed my XAML Files, Classes (Models and ViewModels) and deleted Common Classes and created a new Basic Page. This causes the Project to load the classes again. The same problem.
  4. Removed the reference to Syncfusion Controls for WinRT XAML which i used for custom DatePicker controls. Still the same issue.
  5. Repaired Visual Studio 2012 - Nothing happened still the same problems.

I'm completely at a loss. I have created a new Project and the problem doesn't exist. I dont really want to start my Project again!

FYI - LayoutPageAware.cs is included in the Project:

enter image description here

like image 537
garfbradaz Avatar asked Nov 19 '12 20:11

garfbradaz


People also ask

What C is used for?

C programming language is a machine-independent programming language that is mainly used to create many types of applications and operating systems such as Windows, and other complicated programs such as the Oracle database, Git, Python interpreter, and games and is considered a programming foundation in the process of ...

What is the full name of C?

In the real sense it has no meaning or full form. It was developed by Dennis Ritchie and Ken Thompson at AT&T bell Lab. First, they used to call it as B language then later they made some improvement into it and renamed it as C and its superscript as C++ which was invented by Dr.

Is C language easy?

Compared to other languages—like Java, PHP, or C#—C is a relatively simple language to learn for anyone just starting to learn computer programming because of its limited number of keywords.

Is C programming hard?

C is more difficult to learn than JavaScript, but it's a valuable skill to have because most programming languages are actually implemented in C. This is because C is a “machine-level” language. So learning it will teach you how a computer works and will actually make learning new languages in the future easier.


1 Answers

I believe that the LayoutAwarePage is defined in the Common folder, and is automatically generated the first time you create a Basic Page

  • Right Click on your prject
  • Click Add
  • Click "New Item"
  • click "Basic Page"
  • click add.

You might get a dialog saying

"This addition depends on files that are missing from your project. Without these files you must resolve dependencies on the Common namespace manually. Add the missing files automatically?"

click yes

and then try building again

like image 191
Sam I am says Reinstate Monica Avatar answered Sep 25 '22 01:09

Sam I am says Reinstate Monica