Missing highlight of floating document


When a floating document is focused its not highlighted properly. I'm not sure if it's only when using the VS2010Theme, but its easy to spot when using that theme (i.e, it stays gray, it does not get orange).

file attachments


mgnu wrote Jun 10, 2013 at 1:32 PM

It worked in revision 98289

wrote Jul 11, 2013 at 1:42 PM

wrote Sep 26, 2013 at 5:09 PM

bdeem wrote Sep 26, 2013 at 8:08 PM

This issue is caused by the merging of dictionaries at run time in the LayoutFloatingWindowControl.
        internal virtual void UpdateThemeResources(Theme oldTheme = null)
            if (oldTheme != null)
                var resourceDictionaryToRemove =
                    Resources.MergedDictionaries.FirstOrDefault(r => r.Source == oldTheme.GetResourceUri());
                if (resourceDictionaryToRemove != null)

            var manager = _model.Root.Manager;
            if (manager.Theme != null)
                // This has an issue with the existing LayoutDocumentFloatingControl where it
                // doesn't work with direct properties such as Background and BorderBrush.
                Resources.MergedDictionaries.Add(new ResourceDictionary() { Source = manager.Theme.GetResourceUri() });
Do one of the following.

Option A) Specify the theme in the Application.xaml and NOT in the DockManager. Unfortunately, this means you must use the same theme throughout your application.

Option B) Modify the theme to work when it's merged with limitations. I'm don't know how to fix it.
<Style x:Key="{x:Type avalonDockControls:LayoutDocumentFloatingWindowControl}" TargetType="{x:Type avalonDockControls:LayoutDocumentFloatingWindowControl}">
            <Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=Model.RootDocument.IsActive}" Value="True"/>
            <Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=Model.RootDocument.IsLastFocusedDocument}" Value="True"/>
<!--  Specifying these properties causes the trigger to run early and fail.
        <Setter Property="BorderBrush"
                        Value="{DynamicResource AvalonDock_ThemeVS2010_BaseColor31}" />
        <Setter Property="Background"
                        Value="{DynamicResource AvalonDock_ThemeVS2010_BaseColor31}" />
        <Setter Property="Background"
                        Value="{DynamicResource AvalonDock_ThemeVS2010_BaseColor25}" TargetName="Header" />
        <Setter Property="TextElement.Foreground"
                        Value="{DynamicResource AvalonDock_ThemeVS2010_BaseColor3}"  TargetName="Header"/>
        <Setter Property="Source" TargetName="PART_ImgPinClose" Value="/Xceed.Wpf.AvalonDock.Themes.VS2010;component/Images/PinClose_Dark.png"/>
        <Setter Property="Source" TargetName="PART_ImgPinRestore" Value="/Xceed.Wpf.AvalonDock.Themes.VS2010;component/Images/PinRestore_Dark.png"/>
        <Setter Property="Source" TargetName="PART_ImgPinMaximize" Value="/Xceed.Wpf.AvalonDock.Themes.VS2010;component/Images/PinMaximize_Dark.png"/>
        <Setter Property="Source" TargetName="PART_ImgPinMenu" Value="/Xceed.Wpf.AvalonDock.Themes.VS2010;component/Images/PinMenu_Dark.png"/>

bdeem wrote Sep 26, 2013 at 8:09 PM

To specify the theme in your Application.xaml use the following.
<Application x:Class="Application"

           <ResourceDictionary Source="pack://application:,,,/Xceed.Wpf.AvalonDock.Themes.VS2010;component/Theme.xaml"/>

wrote Sep 27, 2013 at 4:11 PM

bdeem wrote Sep 27, 2013 at 4:11 PM

The selection of tab items and highlighting is not quite right in the VS2010Theme either. I've modified the theme to behave more like Visual Studio.

Simply add the attached file to your project and specify the DocumentPaneControlStyle in your DockingManager as shown below.
                             DocumentPaneControlStyle="{StaticResource AvalonDock_ThemeVS2010_DocumentPaneControlStyle_Custom}">