locked
Cannot create an instance of 'X'(page) error RRS feed

  • Question

  • Hello,

    I'm working on the sample that I've seen displaying popup and when I compile it Visual Studio 2008, it compiles and the program runs ok. When I compile it in Blend 2.5 June, I get the error 'Cannot create an instance of 'X (page) on the main page.

    I've posted this on the silverlight forum and now posting it on the Blend forum and hope someone can help me figure out what's throwing this error in Blend and/or what I'm doing wrong.

    Below are the pages that I'm working on.

     Sincerely,

    reyn

     

    <UserControl x:Class="PopupControl.Page"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:SLPopupDemo="clr-namespace:PopupControl"
        Width="400" Height="300" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d">
        <Grid x:Name="LayoutRoot" Background="White">
            <Button x:Name="ButtonMain" Content="Home" Width="100" Height="50" Grid.Column="0" HorizontalAlignment="Right" Margin="0,0,23,17" Click="ButtonMain_Click" VerticalAlignment="Bottom" d:LayoutOverrides="Width, Height, GridBox"/>
           
            <StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch" Height="69" Margin="26,8,23,0" VerticalAlignment="Top" >
                <Button x:Name="Button1" Content="Page1" Width="100" Height="50" Click="Button1_Click"/>
                <Button x:Name="Button2" Content="Page2" Width="100" Height="50" Click="Button2_Click"/>
                <Button x:Name="Button3" Content="Page3" Width="100" Height="50"/>
            </StackPanel>
           
            <SLPopupDemo:Page2 x:Name="Page2" Visibility="Collapsed" />
            <SLPopupDemo:Home x:Name="Home" Visibility="Collapsed" />
        </Grid>
    </UserControl>

     <UserControl x:Class="PopupControl.Page2"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:SLPopupDemo="clr-namespace:PopupControl"
        Width="300" Height="200">
        <Grid x:Name="LayoutRoot" Background="GreenYellow">
            <Button Content="Display Page3 Popup" Width="150" Height="50" Click="Button_Click"></Button>
            
            <SLPopupDemo:Page3_Popup x:Name="myPopup" Visibility="Collapsed" />
            
        </Grid>
    </UserControl>

    <UserControl x:Class="PopupControl.Page3_Popup"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Width="400" Height="300">
        <Grid x:Name="LayoutRoot">
            <Popup x:Name="popMessage">
                <Grid x:Name="theBack" Background="#80000000">
                    <Grid.RowDefinitions>
                        <RowDefinition />
                        <RowDefinition Height="Auto" />
                        <RowDefinition />
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition />
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition />
                    </Grid.ColumnDefinitions>
                    <Border BorderBrush="#7F4895DE" BorderThickness="1,1,1,1" Width="400" Height="200" Padding="10,10,10,10" CornerRadius="25,25,25,25"                     Grid.Column="1" Grid.Row="1">
                        <Border.Background>
                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                <GradientStop Color="#FF000000"/>
                                <GradientStop Color="#CC4895DE" Offset="0.844"/>
                                <GradientStop Color="#FF346592" Offset="0.393"/>
                                <GradientStop Color="#FFFFFFFF" Offset="1"/>
                            </LinearGradientBrush>
                        </Border.Background>
                        <StackPanel Height="Auto" Width="Auto" Orientation="Vertical" >
                            <TextBlock  x:Name="tbPopupMessage" Height="143" Width="Auto" Text="Message Goes Here" FontFamily="Trebuchet MS" FontSize="24"                             HorizontalAlignment="Center" VerticalAlignment="Center"                             Foreground="#7FFFFFFF" TextWrapping="Wrap" TextAlignment="Center"/>
                            <Button x:Name="btnClosePopup" Height="30" Width="80" Click="btnClosePopup_Click" Content="Close"/>
                        </StackPanel>
                    </Border>
                </Grid>
            </Popup>
        </Grid>
    </UserControl>
    Tuesday, August 19, 2008 4:49 PM