[Version 1.3.3571.0] Screen goes black on seven 64

Oct 4, 2010 at 12:34 PM

Hi all

I have started a project with avalondock on seven 64b framework 4 and I notice a display problem.

My xaml page has an explorer-like layout with a treeview in the left panel. When I expand a treeview node with a wide label (wider than the panel), most of the window goes black. If I resize the window, all is back to normal. Expanding again the same node work with no problems...

I noticed it on a windows 7 64b, but not in xp 64 or xp 32.

Can somenone try it and tell me if it can reproduce the problem ?

Here is the xaml code. There is nothing more in the xaml.cs.

To test it, create a new project, copy-paste the xaml and replace the RibbonWindow Class name.
Compile (you need RibbonControlsLibrary.dll 3.5.40729.1), run and directly open the treeview node. Some part of the window goes black and stay black until you move or resize the window.

<r:RibbonWindow  x:Class="wpfTabDesign.MainWindow"
    xmlns:r="clr-namespace:Microsoft.Windows.Controls.Ribbon;assembly=RibbonControlsLibrary"
    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">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="139"/>
            <RowDefinition Height="398*"/>
            <RowDefinition Height="24"/>
        </Grid.RowDefinitions>
        <r:Ribbon DockPanel.Dock="Top">
            <r:Ribbon.ApplicationMenu>
                <r:RibbonApplicationMenu>
                    <r:RibbonApplicationMenuItem Name="NewCommand" Command="New" Header="New"></r:RibbonApplicationMenuItem>
                    <r:RibbonApplicationMenuItem Name="OpenCommand" Command="Open"></r:RibbonApplicationMenuItem>
                    <r:RibbonApplicationMenuItem Name="CloseCommand" Command="Close"></r:RibbonApplicationMenuItem>
                </r:RibbonApplicationMenu>
            </r:Ribbon.ApplicationMenu>
            <r:RibbonTab Name="HomeTab" Header="Home">
                <r:RibbonGroup>
                </r:RibbonGroup>
                <r:RibbonGroup>
                    <r:RibbonGroup.GroupSizeDefinitions>
                        <r:RibbonGroupSizeDefinition>
                            <r:RibbonControlSizeDefinition ImageSize="Small" IsLabelVisible="False"/>
                            <r:RibbonControlSizeDefinition ImageSize="Small" IsLabelVisible="False"/>
                            <r:RibbonControlSizeDefinition ImageSize="Small" IsLabelVisible="False"/>
                            <r:RibbonControlSizeDefinition ImageSize="Small" IsLabelVisible="False"/>
                            <r:RibbonControlSizeDefinition ImageSize="Small" IsLabelVisible="False"/>
                            <r:RibbonControlSizeDefinition ImageSize="Small" IsLabelVisible="False"/>
                            <r:RibbonControlSizeDefinition ImageSize="Small" IsLabelVisible="False"/>
                        </r:RibbonGroupSizeDefinition>
                    </r:RibbonGroup.GroupSizeDefinitions>
                    <r:RibbonControlGroup>
                    </r:RibbonControlGroup>
                    <r:RibbonControlGroup>
                    </r:RibbonControlGroup>
                </r:RibbonGroup>
                <r:RibbonGroup>
                    <r:RibbonGroup.GroupSizeDefinitions>
                        <r:RibbonGroupSizeDefinition>
                            <r:RibbonControlSizeDefinition ImageSize="Small" IsLabelVisible="True"/>
                            <r:RibbonControlSizeDefinition ImageSize="Small" IsLabelVisible="True"/>
                            <r:RibbonControlSizeDefinition ImageSize="Small" IsLabelVisible="True"/>
                            <r:RibbonControlSizeDefinition ImageSize="Small" IsLabelVisible="True"/>
                            <r:RibbonControlSizeDefinition ImageSize="Small" IsLabelVisible="True"/>
                        </r:RibbonGroupSizeDefinition>
                    </r:RibbonGroup.GroupSizeDefinitions>
                </r:RibbonGroup>
            </r:RibbonTab>
            <r:RibbonTab Header="Tools">
                <r:RibbonGroup>
                </r:RibbonGroup>
            </r:RibbonTab>
            <r:RibbonTab Header="Selection">
            </r:RibbonTab>
        </r:Ribbon>
        <ad:DockingManager Name="dockingManager" Grid.Row="1">
            <ad:ResizingPanel Name="basePanel"  Orientation="Vertical">
                <ad:ResizingPanel Name ="mainPanel" Orientation="Horizontal">
                    <ad:DockablePane ad:ResizingPanel.ResizeWidth="250" x:Name="_documentsHost0">
                        <ad:DockableContent IsCloseable="False">
                            <TreeView Name="TreeView">
                                <TreeViewItem Header="111111111111111111  1 1 1 1    1  11  1111111111111111111">
                                    <TreeViewItem Header="11111111111111111111111111111111  1111111111 1111111111111" />
                                    <TreeViewItem Header="2222222222222222222222222 2222222222 222222222 2222222222222" />
                                </TreeViewItem>
                            </TreeView>
                        </ad:DockableContent>
                    </ad:DockablePane>
                    <ad:ResizingPanel Name="Panel" Orientation="Vertical">
                        <ad:DocumentPane x:Name="documentPane1">
                            <ad:DocumentContent x:Name="MasterPanel" IsCloseable="False">
                                <TabControl HorizontalAlignment="Stretch" Name="tabControl1" VerticalAlignment="Stretch" BorderThickness="0">
                                    <TabControl.Resources>
                                        <!--Remove tab headers-->
                                        <Style TargetType="TabItem">
                                            <Setter Property="Template">
                                                <Setter.Value>
                                                    <ControlTemplate TargetType="TabItem">
                                                    </ControlTemplate>
                                                </Setter.Value>
                                            </Setter>
                                        </Style>
                                    </TabControl.Resources>
                                    <TabItem Name="Tab1">
                                    </TabItem>
                                    <TabItem Name="Tab2">
                                    </TabItem>
                                </TabControl>
                            </ad:DocumentContent>
                        </ad:DocumentPane>
                        <ad:DocumentPane x:Name="documentPane2">
                            <ad:DocumentContent x:Name="DetailPanel" IsCloseable="False">
                                <TabControl HorizontalAlignment="Stretch" Name="tabControl2" VerticalAlignment="Stretch" BorderThickness="0">
                                    <TabControl.Resources>
                                        <!--Remove tab headers-->
                                        <Style TargetType="TabItem">
                                            <Setter Property="Template">
                                                <Setter.Value>
                                                    <ControlTemplate TargetType="TabItem">
                                                    </ControlTemplate>
                                                </Setter.Value>
                                            </Setter>
                                        </Style>
                                    </TabControl.Resources>
                                    <TabItem Name="Tab3">
                                    </TabItem>
                                    <TabItem Name="Tab4">
                                    </TabItem>
                                </TabControl>
                            </ad:DocumentContent>
                        </ad:DocumentPane>
                    </ad:ResizingPanel>
                </ad:ResizingPanel>
                <ad:DockablePane>
                    <ad:DockableContent>
                        <TextBox x:Name="LogMemo" VerticalScrollBarVisibility="Auto" AcceptsReturn="True" />
                    </ad:DockableContent>
                </ad:DockablePane>
            </ad:ResizingPanel>
        </ad:DockingManager>
        <StatusBar Grid.Row="2" Height="21" DockPanel.Dock="Bottom" Name="statusBar" VerticalAlignment="Bottom" Background="#FFDFE9F5">
        </StatusBar>
    </Grid>
</r:RibbonWindow>
    

Oct 19, 2010 at 7:45 AM

Nobody can confirm the problem?

Nov 10, 2010 at 12:17 PM
Edited Nov 10, 2010 at 12:41 PM

Hi I had de same problem with the ribbon. With this code my problem was solved. I haven't found a better solution. I hope there will come a solution so it can work back on the GPU

 

        private void RibbonWindow_Loaded(object sender, RoutedEventArgs e)
        {
            HwndSource hwndSource = PresentationSource.FromVisual(this) as HwndSource;
            HwndTarget hwndTarget = hwndSource.CompositionTarget;
            hwndTarget.RenderMode = RenderMode.SoftwareOnly;
        }

 

Nov 15, 2010 at 12:37 PM

Thank you for the answer. It works, and I didn't notice any slowdown in the interface.

Is it a ribbon or an avalondock bug?

Nov 15, 2010 at 7:53 PM

You're welcome. I only used the ribbon, so I think this is a ribbon bug or a WPF bug.