1

Using the following code:

<ad:DockingManager x:Class="Main.AvalonDock.Views.AvalonDockView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:ad="clr-namespace:AvalonDock;assembly=AvalonDock" 
             xmlns:cal="http://www.codeplex.com/prism"
             mc:Ignorable="d" 
             d:DesignHeight="293" d:DesignWidth="504">
    <ad:ResizingPanel Margin="0,10,0,10" Orientation="Horizontal" >
        <ad:DockablePane cal:RegionManager.RegionName="MainLeftRegion" Name="leftDockablePane" />
        <ad:DocumentPane cal:RegionManager.RegionName="MainCenterRegion" Name="mainDocumentPane" />
        <ad:DockablePane cal:RegionManager.RegionName="MainRightRegion" Name="rightDockablePane" />
    </ad:ResizingPanel>
</ad:DockingManager>

My projects name is Main.AvalonDock which uses the AvalonDock control. It will not compile because of a discrepancy between the ad namespace and the project namespace. Is there a workaround?

heres the error:

The type or namespace name 'DockablePane' does not exist in the namespace 'Main.AvalonDock' (are you missing an assembly reference?)

3
  • 2
    Have you tried putting a semi-colon in the project name to see if that's the problem? Change your project name to "Main.Avalon_Dock" temporarily and see if that's the issue. I don't think there's anyway to change or modify the way XAML namespaces are resolved. Commented Mar 23, 2011 at 17:17
  • @Josh G - Yep, that corrects the issue. Its definitely related to the names being too similar. Commented Mar 23, 2011 at 17:20
  • The problem is though that I'm stubborn and I don't want to have to rename my project to accommodate a third party control Commented Mar 23, 2011 at 18:15

1 Answer 1

2

If you look at the AvalonDockView.g.cs (or AvalongDockView.g.vb) in your projects obj folder, you will see the underlying issue.

Basically, you'd end up with something like:

using Main.AvalonDock.Views {
    internal AvalonDock.DockablePane leftDockablePane;
    // ...
}

Using the C# type resolution specs, the AvalonDock resolves to your namespace, not the one in the AvalonDock assembly.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.