Need Bug fixes for AvalonDock ver 1.2

Apr 20, 2009 at 9:35 AM
Edited Apr 20, 2009 at 11:15 AM
Ado,

This is a wonderful piece of work, thanks for sharing. 
We are evaluating it for our usage, here are a couple of issues, that we have observed.
a) There are painting problems, especially the area under the cursor fails to paint. Ex. after a resize operation of a Docked Pane, the position that shows the sizing grip fails to paint properly. I'm not sure if this is observed in others PC with better GPUs.
b) I need a way to size the Dockable window to occupy the entire area until it encounters another DocumentPane (I have a fixed height defined).
The Dockable content containing the TextBox2 below always seems to have a predefined height and always get occupies the lower portion of the screen.
I want this to spread itself vertically till it reaches the top DocumentPane.
<Window x:Class="AvalonDock.Tutorials.Window1"
    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"
    Title="Window1" Height="600" Width="600">
    <Grid>
        <ad:DockingManager x:Name="dockManager">
            <ad:ResizingPanel Orientation="Vertical">
               <ad:ResizingPanel Orientation="Horizontal">
                    <ad:DocumentPane x:Name="documentsHost" Height="50" VerticalAlignment="Top">
                        <ad:DockableContent Title="File1.doc">
                            <RichTextBox/>
                        </ad:DockableContent>
                        <ad:DockableContent Title="File2.doc">
                            <RichTextBox/>
                        </ad:DockableContent>
                    </ad:DocumentPane>
                </ad:ResizingPanel>
                <ad:DockablePane VerticalAlignment="Top">
                    <ad:DockableContent Title="TextBox2">
                        <TextBox />
                    </ad:DockableContent>
                </ad:DockablePane>
            </ad:ResizingPanel>
        </ad:DockingManager>
    </Grid>
</Window>
c) I need a way to hide and show tabs of a DocumentPane at runtime, like I would have a Hide button dialog contained in the DocumentPane, clicking on the Hide button I should be able to hide its own tab. Not sure if there is a way to do this in the current version.

Please let us know if you have solutions for the above problems. I would also like to know when you plan to release the bug fixes for ver 1.2.

Thanks for your support.

Regards
Franklin.
Apr 21, 2009 at 9:48 AM
Edited Apr 21, 2009 at 9:49 AM
hi,
1. cant reproduce drawing problem, maybe is due to a old graphics card or the presence of a winforms control, can you post a working example that show the issue?
2. Your xaml use wrong properties, this is the corrected one:
<Window x:Class="AvalonDockTest.Window2"
    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"
    Title="Window1" Height="600" Width="600">
 <Grid>
  <ad:DockingManager x:Name="dockManager">
   <ad:ResizingPanel Orientation="Vertical">
    <ad:ResizingPanel Orientation="Horizontal">
     <ad:DocumentPane x:Name="documentsHost">
      <ad:DocumentContent Title="File1.doc">
       <RichTextBox/>
      </ad:DocumentContent>
      <ad:DocumentContent Title="File2.doc">
       <RichTextBox/>
      </ad:DocumentContent>
     </ad:DocumentPane>
    </ad:ResizingPanel>
    <ad:DockablePane ad:ResizingPanel.ResizeHeight="200">
     <ad:DockableContent Title="TextBox2">
      <TextBox />
     </ad:DockableContent>
    </ad:DockablePane>
   </ad:ResizingPanel>
  </ad:DockingManager>
 </Grid>
</Window>
from what you say, maybe you have misunderstood the difference from document/dockablecontent and document/dockablepane. I suggest you to follow my tutorial on www.youdev.net (it use v1.1) just for start.
3. You need to restyle the documentpane/content, looking into the source code under 'Resources' you'll find many styles for each part of the library. i'm preparing a tutorial on restyling stuff.


Thanks for using AvalonDock in your project,
ado

Apr 21, 2009 at 7:16 PM
Edited Apr 21, 2009 at 7:42 PM
Ado,

Thank you, I got my painting issue resolved too with your solution. So the points I take as learning would be to use DocumentContent in DocumentPane and DockableContent in DockablePane only. I get painting problems in case of interchanging DocumentPane with DockableContent.

a) Ado: You need to restyle the documentpane/content, looking into the source code under 'Resources' you'll find many styles for each part of the library. i'm preparing a tutorial on restyling stuff.
Franklin: Ado, I'm sorry to be demanding more of your time, I'm not sure how to proceed on this styling stuff, I'm newbie to WPF,
I have pasted a simple version of my code below, I have two problems with this code.
1) I need the Tab Item hidden on clicking the "Hide Second Tab" button.
2) I need the Tab Item shown on clicking the "Show Second Tab" button in the DocumentPane.
Kindly show me a sample of how to go about styling on this requirement. Thank you.

<Window x:Class="AvalonDock.Tutorials.Window1"
    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"
    Title="Window1" Height="600" Width="600" WindowState="Maximized">
    <Grid>
        <ad:DockingManager x:Name="dockManager">
               <ad:ResizingPanel Orientation="Vertical">
                <ad:ResizingPanel Orientation="Horizontal">                  
                    <ad:DocumentPane x:Name="documentsHost" ad:ResizingPanel.ResizeHeight="500">
                        <ad:DocumentContent Title="First Tab" Visibility="Visible">
                        <Grid>
                                <Button Content="Hide First Tab" Width="100" Height="30" />
                        </Grid>
                    </ad:DocumentContent>
                        <ad:DocumentContent Title="Second Tab" >
                            <Button Content="Hide Second Tab" Width="100" Height="30" />
                        </ad:DocumentContent>
                    </ad:DocumentPane>
                </ad:ResizingPanel>
                    <ad:DockablePane ad:ResizingPanel.ResizeHeight="100">
                        <ad:DockableContent Title="dockContent">
                            <StackPanel Orientation="Horizontal" >
                                <Button Content="Show First Tab" Width="100" Height="30" Margin="10,0,0,0"/>
                                <Button Content="Show Second Tab" Width="100" Height="30" Margin="10,0,0,0"/>
                            </StackPanel>
                        </ad:DockableContent>
                    </ad:DockablePane>
            </ad:ResizingPanel>
        </ad:DockingManager>
    </Grid>
</Window>