locked
Type 'LayoutAwarePage' is not usable as an object element because it is not public or does not define a public parameterless constructor or a type converter

    Question

  • I am getting this error when I attempt to compile a Metro project under Windows 8 RTM.  This feels like a bug in Visual Studio.  Has anyone else encountered this error and know what the likely cause is?

    Here is the top portion of the XAML file that generated this error:

    <common:LayoutAwarePage
        x:Name="pageRoot"
        x:Class="SmartRecorder.Session"
        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:SmartRecorder"
        xmlns:data="using:SmartRecorder.Data"
        xmlns:common="using:SmartRecorder.Common"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        mc:Ignorable="d">

                       - Ken


    - Ken

    Saturday, August 25, 2012 3:18 PM

Answers

  • I ran across this error when I copied the code behind page of another project to my new project and did not change the namespace on the code behind page.

    RBL3

    • Marked as answer by Jesse Jiang Tuesday, August 28, 2012 7:38 AM
    Saturday, August 25, 2012 10:36 PM

All replies

  • I ran across this error when I copied the code behind page of another project to my new project and did not change the namespace on the code behind page.

    RBL3

    • Marked as answer by Jesse Jiang Tuesday, August 28, 2012 7:38 AM
    Saturday, August 25, 2012 10:36 PM
  • Thanks for sharing the solution.

    Best regards,
    Jesse


    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us

    Tuesday, August 28, 2012 7:38 AM