Click here to Skip to main content
15,906,816 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
I'm loading user control in main window of Wpf

Getting following error

"'Set connectionId threw an exception.' Line number '24' and line position '18'."}

Innner Execption
{"Unable to cast object of type 'EDIManagementModule.EDIManagementModule.EDIManagementModule.LoadInbox' to type 'EDIManagementModule.EDIManagementModule.EDIManagementModule.EDIManagementModule.LoadInbox'."}


My main window

XML
<window x:class="MainWindow" xmlns:x="#unknown">
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:InboxTabData="clr-namespace:EDIManagementModule.EDIManagementModule.EDIManagementModule"
    Title="EDI Module"  Height="900" Width="1600" MinHeight="225"
        MinWidth="400"  WindowState="Maximized" BorderThickness="0"&gt;

    <grid>
        <tabcontrol name="tabMain" tabstripplacement="Left">
            <tabcontrol.bitmapeffect>
                <dropshadowbitmapeffect color="#bbbbbb" direction="240" />
            </tabcontrol.bitmapeffect>
            <tabitem name="tbMenu" header="MENU" isenabled="False" height="30" width="80" />
            <tabitem name="tbDashboard" height="60" width="80" removed="#dddddd">
                <tabitem.header>
                    <textblock text="Dashboard" width="70" fontsize="13" textwrapping="WrapWithOverflow" horizontalalignment="Center" textalignment="Center" verticalalignment="Center" />
                </tabitem.header>
                
            </tabitem>
            <tabitem name="tbInbox" height="60" width="80" removed="#dddddd">
                <tabitem.header>
                    <textblock text="Inbox" width="70" fontsize="13" textwrapping="WrapWithOverflow" horizontalalignment="Center" textalignment="Center" verticalalignment="Center" />
                </tabitem.header>
                <inboxtabdata:loadinbox x:name="UC_LoadInbox" xmlns:inboxtabdata="#unknown" />
            </tabitem>
        </tabcontrol>
    </grid>
</window>

Usercontrol
<usercontrol x:class="EDIManagementModule.EDIManagementModule.LoadInbox" xmlns:x="#unknown">
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             Height="400" Width="700" removed="White"&gt;
    <grid>
        <grid.columndefinitions>
            <columndefinition width="10" />
            <columndefinition width="680" />
            <columndefinition width="10" />
        </grid.columndefinitions>
        <grid.rowdefinitions>
            <rowdefinition height="20" />
            <rowdefinition height="360" />
            <rowdefinition height="20" />
        </grid.rowdefinitions>

        <stackpanel grid.row="1" grid.column="1" name="stpProgress" horizontalalignment="Center" verticalalignment="Center" orientation="Vertical">
            <stackpanel margin="10"></stackpanel>
            &lt;Button Name="btnLoad" Width="260" Height="28" Content="Load Products Data" FontSize="14"/&gt;
            <stackpanel margin="10"></stackpanel>
            <progressbar height="28" name="ProgressBar" width="700" />
            &lt;Label Content="" Foreground="Black" Visibility="Hidden" HorizontalContentAlignment="Center"  Height="26" Name="lblProgress"/&gt;
        </stackpanel>

    </grid>
</usercontrol>


What I have tried:

I'm new to wpf. Tried of changing the namespace and rebuild the project again.
Posted
Updated 25-Apr-16 8:27am
v2
Comments
CHill60 25-Apr-16 14:29pm    
Should the line that reads <usercontrol x:class="EDIManagementModule.EDIManagementModule.LoadInbox" xmlns:x="#unknown"> not be <usercontrol x:class="EDIManagementModule.LoadInbox" xmlns:x="#unknown">
Sergey Alexandrovich Kryukov 25-Apr-16 16:21pm    
This is not related to "loading" (what is that, for a control?) — you probably just messed up namespace names...
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900