Posted 16 years ago by Michael
Version: 4.0.0457
Platform: .NET 3.5
Environment: Windows Vista (32-bit)
I created two tabs(tool windows) in a ToolWindowContainer. I painted something in one toolwindow when the window is loaded in the C# code.

Here is the problem: I click the tab of the other window then click back to the window that I painted, the content dispears. But if I drag the window around, rearrange the windows layout, sometime the content can randomly reappear.

Here is the test code

<Window x:Class="TestBug.Window1"
    Title="Window1" Height="300" Width="300">
    <docking:DockSite x:Name="dockSite">
            <docking:ToolWindow Name="folderWindow" Title="Tool Window 1" Loaded="folderWindow_Loaded">
                <TreeView x:Name="folderTree" Background="AliceBlue" HorizontalContentAlignment="Stretch" VirtualizingStackPanel.IsVirtualizing="True" VirtualizingStackPanel.VirtualizationMode="Recycling">
                        <Style TargetType="{x:Type TreeViewItem}">
                            <Setter Property="HeaderTemplate">
                                        <StackPanel Orientation="Horizontal">

                                            <TextBlock Text="{Binding}" Margin="5,0" />

            <docking:ToolWindow Title="Tool Window 2" />

And the corresponding c# code

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.IO;
namespace TestBug
    /// <summary>
    /// Interaction logic for Window1.xaml
    /// </summary>
    public partial class Window1 : Window
        private readonly object dummyNode = null;
        public Window1()
        private void folder_Expanded(object sender, RoutedEventArgs e)
            TreeViewItem item = (TreeViewItem)sender;
            if (item.Items.Count == 1 && item.Items[0] == dummyNode)
                    foreach (string s in Directory.GetDirectories(item.Tag.ToString()))
                        TreeViewItem subitem = new TreeViewItem();
                        subitem.Header = s.Substring(s.LastIndexOf("\\") + 1);
                        subitem.Tag = s;
                        subitem.FontWeight = FontWeights.Normal;
                        subitem.Expanded += new RoutedEventHandler(folder_Expanded);
                catch (Exception) { }

        private void folderWindow_Loaded(object sender, RoutedEventArgs e)
            foreach (string s in Directory.GetLogicalDrives())
                TreeViewItem item = new TreeViewItem();
                item.Header = s;
                item.Tag = s;
                item.FontWeight = FontWeights.Normal;
                item.Expanded += new RoutedEventHandler(folder_Expanded);


[Modified at 09/20/2008 04:45 AM]

Comments (1)

Posted 16 years ago by Actipro Software Support - Cleveland, OH, USA
Hi Michael,

Actually we've had a fix for this issue for a couple weeks but it will roll out with WPF Studio v4.5, which we are working very hard to get out today.

Something Microsoft changed in .NET 3.5 SP1 caused this issue with the TransitionPresenter where it may not show content in a certain scenario when no Transition has been set. This never happened before SP1.

Actipro Software Support

The latest build of this product (v24.1.2) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.