How to properly combine two files in XAML in Microsoft Blend?

Posted by MartyIX on Stack Overflow See other posts from Stack Overflow or by MartyIX
Published on 2010-06-17T10:16:43Z Indexed on 2010/06/17 12:53 UTC
Read the original article Hit count: 416

Filed under:
|
|

Hello,

I have a test project with the file MainWindow.xaml with the content:

 <Window x:Class="MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:ad="clr-namespace:AvalonDock;assembly=AvalonDock"     
    xmlns:diag="clr-namespace:System.Diagnostics;assembly=WindowsBase" 
    xmlns:view="clr-namespace:Sokoban.View;assembly=Solvers"
    Title="Window1" Height="300" Width="300" Loaded="Window_Loaded">

    <ad:DockingManager x:Name="dockingManager">
        <ad:ResizingPanel Orientation="Vertical">
            <view:Solvers x:Name="solvers" diag:PresentationTraceSources.TraceLevel="High" />
            <!-- LINE BELOW DEMONSTRATES WORKING CODE INSTEAD OF LINE ABOVE --> 
            <!--<ad:DocumentPane Name="GamesDocumentPane" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                  <ad:DockableContent x:Name="classesContent" Title="Classes">
                    <TextBlock>test</TextBlock>
                  </ad:DockableContent>
             </ad:DocumentPane>-->
        </ad:ResizingPanel>     
    </ad:DockingManager>
</Window>

and in another project I have the file Solvers.xaml:

<ad:DocumentPane x:Class="Sokoban.View.Solvers"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:ad="clr-namespace:AvalonDock;assembly=AvalonDock"
    xmlns:diag="clr-namespace:System.Diagnostics;assembly=WindowsBase"
    Name="GamesDocumentPane" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">

</ad:DocumentPane>

When I open my Visual Studio solution in Microsoft Blend 4 then I see the error:

InvalidOperationException: DocumentPane must be put under a DockingManager!

when I open either MainWindow.xaml or Solvers.xaml. It is all right in Solvers.xaml because there really is no DockingManager but MainWindow.xaml should work, shouldn't it?

How to solve the problem?

Note: It seems to me that the files are processed separately and because the file Solvers.xaml contains the error the MainWindow.xaml file also contains the very same error.

Note 2: XAML files use AvalonDock library

Is there a way how to say that Solvers.xaml is only an extension of another file?

Thank you for any help!

© Stack Overflow or respective owner

Related posts about xaml

Related posts about expression-blend