Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Upgrade AvalonDock from 1.3 to 2.0

Tags:

c#

wpf

avalondock

I'm trying to upgrade AvalonDock in a application from 1.3 to 2.0 but there exist little to no documentation on this.

I look at the simple, imported it by doing this

xmlns:avalonDock="http://avalondock.codeplex.com"

However this did not work.

Error   The tag 'DockingManager' does not exist in XML namespace 'http://avalondock.codeplex.com'. Line 41 Position 10.

I also tried it the old way.

xmlns:avalonDock="clr-namespace:AvalonDock;assembly=AvalonDock"

Neither did this work

Error   The tag 'ResizingPanel' does not exist in XML namespace 'clr-namespace:AvalonDock;assembly=AvalonDock'. Line 71 Position 22.

If they have renamed the controls it would be useful to have a list of the controls now existing in 2.0.

I tried to compile the simple code as it was but without success.

like image 669
Icy Creature Avatar asked Aug 09 '12 10:08

Icy Creature


4 Answers

I fixed this issue by replacing

xmlns:avalonDock="http://avalondock.codeplex.com"

by

xmlns:avalonDock="http://schemas.xceed.com/wpf/xaml/avalondock"

like image 170
Patedam Avatar answered Nov 10 '22 19:11

Patedam


The only documentation currently available is the AvalonDock samples that can be downloaded from codeplex. http://avalondock.codeplex.com/releases

Beyond this, the intellisense is a helpful guide.

============================================================

The error you are seeing for 'DockingManager' is misleading as it still exists in 2.0. The following may help you get rid of those. Additionally, intellisense will begin to work once this is resolved.

Bad things happen with files downloaded from the internet. They have an attribute on them that leads to limited access. You have to manually remove this attribute in order for the XAML to stop fussing.

In windows explorer, right-click the file, choose properties, then click the 'Unblock' button. Do this for every individual file you are using that was downloaded from the internet. Be sure to rebuild the project to replace the blocked copy in the bin folder as well.

As a side note, I am able to still run the project whenever this is the issue. Only the XAML editor thinks that there is a problem.

============================================================

In 2.0, everything is nested in layout controls. All of your panes are either anchorable or document style. Here is a quick example to get you going.

Define your namespace

xmlns:ad="http://avalondock.codeplex.com"

Build your DockingManager

<ad:DockingManager x:Name="dockManager">
    <ad:LayoutRoot>
        <ad:LayoutPanel Orientation="Horizontal">
            <ad:LayoutPanel Orientation="Vertical">
                <ad:LayoutPanel Orientation="Horizontal">
                    <ad:LayoutDocumentPaneGroup x:Name="leftDocumentGroup">
                        <ad:LayoutDocumentPane>
                            <ad:LayoutDocument Title="Left Doc"></ad:LayoutDocument>
                        </ad:LayoutDocumentPane>
                    </ad:LayoutDocumentPaneGroup>
                    <ad:LayoutDocumentPaneGroup x:Name="rightDocumentGroup">
                        <ad:LayoutDocumentPane>
                            <ad:LayoutDocument Title="Right Doc"></ad:LayoutDocument>
                        </ad:LayoutDocumentPane>
                    </ad:LayoutDocumentPaneGroup>
                </ad:LayoutPanel>
                <ad:LayoutAnchorablePaneGroup x:Name="bottomAnchorableGroup">
                    <ad:LayoutAnchorablePane>
                        <ad:LayoutAnchorable Title="Bottom Anch"></ad:LayoutAnchorable>
                    </ad:LayoutAnchorablePane>
                </ad:LayoutAnchorablePaneGroup>
            </ad:LayoutPanel>
            <ad:LayoutAnchorablePaneGroup x:Name="rightAnchorableGroup">
                <ad:LayoutAnchorablePane>
                    <ad:LayoutAnchorable Title="Right Anch"></ad:LayoutAnchorable>
                </ad:LayoutAnchorablePane>
            </ad:LayoutAnchorablePaneGroup>
        </ad:LayoutPanel>
    </ad:LayoutRoot>
</ad:DockingManager>
like image 8
Malgaur Avatar answered Nov 10 '22 19:11

Malgaur


You can add reference to latest AvalonDock version using following command. So you have to enter this command on Package Manager Console on Visual Studio

Install-Package AvalonDock

You can find this window on vs from the Tools menu, select Library Package Manager and then click Package Manager Console. (More details)

Then it will add all the reference to your project automatically !!!

Also replace this line

xmlns:avalonDock="http://avalondock.codeplex.com"

by

xmlns:avalonDock="http://schemas.xceed.com/wpf/xaml/avalondock"

As describes by Paul Gillen

like image 3
mili Avatar answered Nov 10 '22 19:11

mili


I had a similar error message when I first switched to AvalonDock 2.0. This is probably a long shot, but do you have the AvalonDock.dll on a network drive? I found that once I moved the DLL to my project directory I no longer had that problem.

.NET assembly runs in partial trust on a network drive, but all other in full trust

(I would have added this answer as a comment but I don't have rep to add comments.)

like image 1
burnttoast11 Avatar answered Nov 10 '22 17:11

burnttoast11