Browse Source

Upgrade to AvalonDock 1.3.3571

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@6053 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
pull/1/head
Daniel Grunwald 15 years ago
parent
commit
6bbba8d32a
  1. 125
      src/Libraries/AvalonDock/AvalonDock.Themes/AvalonDock.Themes35.csproj
  2. 42
      src/Libraries/AvalonDock/AvalonDock.Themes/Properties/Resources.Designer.cs
  3. 20
      src/Libraries/AvalonDock/AvalonDock.Themes/Properties/Settings.Designer.cs
  4. 76
      src/Libraries/AvalonDock/AvalonDock.Themes/Themes/ExpressionDark.xaml
  5. 25
      src/Libraries/AvalonDock/AvalonDock.Themes/Themes/dev2010.xaml
  6. 187
      src/Libraries/AvalonDock/AvalonDock/AlignedImage.cs
  7. 13
      src/Libraries/AvalonDock/AvalonDock/AvalonDock.csproj
  8. 268
      src/Libraries/AvalonDock/AvalonDock/AvalonDock35.csproj
  9. 14
      src/Libraries/AvalonDock/AvalonDock/Converters.cs
  10. 73
      src/Libraries/AvalonDock/AvalonDock/DockableContent.cs
  11. 4
      src/Libraries/AvalonDock/AvalonDock/DockableFloatingWindow.cs
  12. 195
      src/Libraries/AvalonDock/AvalonDock/DockablePane.cs
  13. 443
      src/Libraries/AvalonDock/AvalonDock/DockingManager.cs
  14. 20
      src/Libraries/AvalonDock/AvalonDock/DocumentContent.cs
  15. 3
      src/Libraries/AvalonDock/AvalonDock/DocumentFloatingWindow.cs
  16. 62
      src/Libraries/AvalonDock/AvalonDock/DocumentPane.cs
  17. 30
      src/Libraries/AvalonDock/AvalonDock/DocumentTabPanel.cs
  18. 18
      src/Libraries/AvalonDock/AvalonDock/FloatingDockablePane.cs
  19. 57
      src/Libraries/AvalonDock/AvalonDock/FloatingDocumentPane.cs
  20. 4
      src/Libraries/AvalonDock/AvalonDock/FloatingWindow.cs
  21. 8
      src/Libraries/AvalonDock/AvalonDock/FlyoutDockablePane.cs
  22. 227
      src/Libraries/AvalonDock/AvalonDock/FlyoutPaneWindow.cs
  23. 31
      src/Libraries/AvalonDock/AvalonDock/HelperFunc.cs
  24. 19
      src/Libraries/AvalonDock/AvalonDock/ImageEx.cs
  25. 148
      src/Libraries/AvalonDock/AvalonDock/ManagedContent.cs
  26. 222
      src/Libraries/AvalonDock/AvalonDock/NavigatorWindow.cs
  27. 155
      src/Libraries/AvalonDock/AvalonDock/Pane.cs
  28. 10
      src/Libraries/AvalonDock/AvalonDock/PaneTabPanel.cs
  29. 4
      src/Libraries/AvalonDock/AvalonDock/Properties/AssemblyInfo.cs
  30. 20
      src/Libraries/AvalonDock/AvalonDock/Properties/Settings.Designer.cs
  31. 37
      src/Libraries/AvalonDock/AvalonDock/ResizingPanel.cs
  32. 7
      src/Libraries/AvalonDock/AvalonDock/Resources/Common.xaml
  33. 8
      src/Libraries/AvalonDock/AvalonDock/Resources/DockablePaneStyles.xaml
  34. 2
      src/Libraries/AvalonDock/AvalonDock/Resources/DockingManagerStyles.xaml
  35. 43
      src/Libraries/AvalonDock/AvalonDock/Resources/DocumentPaneStyles.xaml
  36. 12
      src/Libraries/AvalonDock/AvalonDock/Resources/FloatingWindowStyle.xaml
  37. 26
      src/Libraries/AvalonDock/AvalonDock/Resources/NavigatorWindowStyle.xaml
  38. 30
      src/Libraries/AvalonDock/AvalonDock/Resources/OverlayWindowStyle.xaml
  39. 6
      src/Libraries/AvalonDock/AvalonDock/Resources/SpecFrameworkStyles.xaml
  40. 6
      src/Libraries/AvalonDock/AvalonDock/Resources/SpecNET40Styles.xaml
  41. 123
      src/Libraries/AvalonDock/AvalonDock/Themes/aero.normalcolor.xaml
  42. 29
      src/Libraries/AvalonDock/AvalonDock/Themes/classic.xaml

125
src/Libraries/AvalonDock/AvalonDock.Themes/AvalonDock.Themes35.csproj

@ -0,0 +1,125 @@ @@ -0,0 +1,125 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{3836F4A8-4B35-4F5E-BB0F-DAD374297525}</ProjectGuid>
<OutputType>library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>AvalonDock.Themes</RootNamespace>
<AssemblyName>AvalonDock.Themes</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\v35\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\v35\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
</ItemGroup>
<ItemGroup>
<Page Include="Themes\ExpressionDark.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Themes\dev2010.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<AppDesigner Include="Properties\" />
</ItemGroup>
<ItemGroup>
<Resource Include="Images\ExpDark\HTabGroup.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Images\dev2010\HTabGroup.png" />
<Resource Include="Images\dev2010\Locked.png" />
<Resource Include="Images\dev2010\PinAutoHide.png" />
<Resource Include="Images\dev2010\PinClose.png" />
<Resource Include="Images\dev2010\PinDocMenu.png" />
<Resource Include="Images\dev2010\PinMenu.png" />
<Resource Include="Images\dev2010\VTabGroup.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Images\ExpDark\VTabGroup.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Images\ExpDark\Locked.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Images\ExpDark\PinAutoHide.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Images\ExpDark\PinClose.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Images\ExpDark\PinDocMenu.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Images\ExpDark\PinMenu.png" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\AvalonDock\AvalonDock35.csproj">
<Project>{87E61430-4243-45F2-B74E-0A4C096CEBF3}</Project>
<Name>AvalonDock35</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

42
src/Libraries/AvalonDock/AvalonDock.Themes/Properties/Resources.Designer.cs generated

@ -8,10 +8,10 @@ @@ -8,10 +8,10 @@
// </auto-generated>
//------------------------------------------------------------------------------
namespace AvalonDock.Themes.Properties
{
namespace AvalonDock.Themes.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
@ -22,48 +22,40 @@ namespace AvalonDock.Themes.Properties @@ -22,48 +22,40 @@ namespace AvalonDock.Themes.Properties
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources()
{
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("AvalonDock.Themes.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set
{
set {
resourceCulture = value;
}
}

20
src/Libraries/AvalonDock/AvalonDock.Themes/Properties/Settings.Designer.cs generated

@ -8,21 +8,17 @@ @@ -8,21 +8,17 @@
// </auto-generated>
//------------------------------------------------------------------------------
namespace AvalonDock.Themes.Properties
{
namespace AvalonDock.Themes.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
public static Settings Default {
get {
return defaultInstance;
}
}

76
src/Libraries/AvalonDock/AvalonDock.Themes/Themes/ExpressionDark.xaml

@ -283,7 +283,7 @@ @@ -283,7 +283,7 @@
x:Name="PART_DragArea"
Background="{StaticResource ManagedContentTabItemNormalBackground}"
CornerRadius="3,0,0,0"
ContextMenu="{DynamicResource {ComponentResourceKey {x:Type ad:DockingManager}, {x:Static ad:ContextMenuElement.DockablePane}}}"
>
<Grid Margin="4,2,4,2">
<Grid.ColumnDefinitions>
@ -305,7 +305,7 @@ @@ -305,7 +305,7 @@
Style="{StaticResource PaneHeaderCommandStyle}"
Command="ad:ManagedContentCommands.Close"
Width="13" Height="13" Opacity="0.6">
<Image Source="/AvalonDock;component/resources/Images/PinClose.png"/>
<ad:ImageEx Source="/AvalonDock;component/resources/Images/PinClose.png" />
</Button>
</Grid>
</Border>
@ -385,14 +385,14 @@ @@ -385,14 +385,14 @@
</Grid.ColumnDefinitions>
<Button x:Name="btnPinAutoHide" Grid.Column="1" Style="{StaticResource PaneHeaderCommandStyle}" Command="ad:DockablePaneCommands.ToggleAutoHide"
Width="15" Height="15" VerticalAlignment="Center" Opacity="0.6">
<Image Source="/AvalonDock.Themes;component/Images/ExpDark/PinAutoHide.png" Width="13" Height="13" Stretch="None"/>
<ad:ImageEx Source="/AvalonDock.Themes;component/Images/ExpDark/PinAutoHide.png" Width="13" />
</Button>
<Button x:Name="PART_CloseButton" Grid.Column="2" Margin="6,0,2,0"
Style="{StaticResource PaneHeaderCommandStyle}"
Width="14"
Height="13"
Command="ad:DockablePaneCommands.Close" Opacity="0.8">
<Image Source="/AvalonDock.Themes;component/Images/ExpDark/PinClose.png" Stretch="None"/>
<ad:ImageEx Source="/AvalonDock.Themes;component/Images/ExpDark/PinClose.png" Width="13" />
</Button>
<ad:DockableTabPanel
IsItemsHost="True"
@ -435,15 +435,16 @@ @@ -435,15 +435,16 @@
<ControlTemplate TargetType="{x:Type ad:ManagedContent}">
<Grid SnapsToDevicePixels="True">
<Border x:Name="tabItemIntBorder"
BorderThickness="1,1,1,0"
Padding="5,0,5,4"
Margin="-1,0,2,-4"
CornerRadius="3,3,0,0"
Background="{DynamicResource {ComponentResourceKey {x:Type ad:DockingManager}, {x:Static ad:AvalonDockBrushes.DocumentHeaderBackground}}}">
<StackPanel x:Name="PART_DragArea"
Orientation="Horizontal"
Margin="0,2,0,2"
ContextMenu="{DynamicResource {ComponentResourceKey {x:Type ad:DockingManager}, {x:Static ad:ContextMenuElement.DocumentPane}}}">
BorderThickness="1,1,1,0"
Padding="5,0,5,4"
Margin="-1,0,2,-4"
CornerRadius="3,3,0,0"
Background="{DynamicResource {ComponentResourceKey {x:Type ad:DockingManager}, {x:Static ad:AvalonDockBrushes.DocumentHeaderBackground}}}">
<StackPanel x:Name="PART_DragArea"
Orientation="Horizontal"
Background="Transparent"
Margin="0,2,0,2"
>
<!--This image with width=0 is required to connect the icon visual to the presentation source,
without this navigatorwindow won't work-->
<Image Source="{TemplateBinding Icon}" Width="0"/>
@ -454,7 +455,7 @@ @@ -454,7 +455,7 @@
Text="{TemplateBinding Title}"
Foreground="{DynamicResource {ComponentResourceKey {x:Type ad:DockingManager}, {x:Static ad:AvalonDockBrushes.DocumentHeaderForeground}}}"/>
<Image Source="/AvalonDock;component/resources/Images/Locked.png" x:Name="PART_LockedIcon" Margin="2,0,0,0" Visibility="Collapsed" VerticalAlignment="Center" HorizontalAlignment="Center" Width="6" UseLayoutRounding="True"/>
<ad:ImageEx Source="/AvalonDock;component/resources/Images/Locked.png" x:Name="PART_LockedIcon" Margin="2,0,0,0" Visibility="Collapsed" VerticalAlignment="Center" HorizontalAlignment="Center" Width="6"/>
<Button x:Name="PART_CloseButton" Visibility="Collapsed" Margin="6,0,2,0"
Style="{StaticResource PaneHeaderCommandStyle}"
@ -509,7 +510,7 @@ @@ -509,7 +510,7 @@
<Setter.Value>
<ControlTemplate TargetType="{x:Type ad:DocumentPane}" >
<ControlTemplate.Resources>
<ContextMenu x:Key="DocumentsListMenu" StaysOpen="True" ItemContainerStyle="{StaticResource ResourceKey=DocumentPaneMenuItemStyle}" />
<ContextMenu x:Key="DocumentsListMenu" StaysOpen="True" />
</ControlTemplate.Resources>
<Border
Background="{TemplateBinding Background}">
@ -543,7 +544,6 @@ @@ -543,7 +544,6 @@
<Border
Background="{StaticResource DefaultDocumentPaneBackground}">
<ContentPresenter
FocusManager.IsFocusScope="True"
Content="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=SelectedItem.Content}"
KeyboardNavigation.TabNavigation="Local"
KeyboardNavigation.DirectionalNavigation="Contained"/>
@ -764,23 +764,55 @@ @@ -764,23 +764,55 @@
<ad:Resizer x:Name="PART_RightBottomAnchor" Cursor="SizeNWSE" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Width="4" Height="4"
Grid.Row="3" Grid.Column="3"/>
<Border
Grid.Row="1"
Grid.RowSpan="2"
Grid.Row="2"
Grid.Column="1"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}" >
<ContentPresenter/>
BorderThickness="{TemplateBinding BorderThickness}">
<ContentPresenter />
</Border>
<Border x:Name="PART_MoveAnchor"
Grid.Row="1"
Grid.Column="1"
CornerRadius="2,2,0,0"
Margin="0,0,20,0"
Background="Transparent">
<Grid SnapsToDevicePixels="True">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="20"/>
</Grid.ColumnDefinitions>
<Border
Background="{StaticResource ManagedContentTabItemHotBackground}"
CornerRadius="3,0,0,0">
<Grid Margin="4,2,4,2">
<TextBlock
x:Name="tabItemTitle"
Grid.Column="0"
TextTrimming="CharacterEllipsis"
TextWrapping="NoWrap"
Text="{TemplateBinding Title}"
Margin="2,0,0,0" VerticalAlignment="Center"
Foreground="{StaticResource ResourceKey=LightForegroundBrush}"/>
</Grid>
</Border>
<Path x:Name="intPathLabel" Stretch="Fill" Grid.Column="1" Fill="{StaticResource ManagedContentTabItemHotBackground}" Data="M0,0 L20,20 L0,20 L0,0"/>
</Grid>
</Border>
</Grid>
<Button x:Name="PART_CloseButton"
Grid.Row="1"
Grid.Column="1"
Style="{StaticResource PaneHeaderCommandStyle}"
HorizontalAlignment="Right"
Width="14"
Height="13"
Command="ad:DockablePaneCommands.Close"
CommandTarget="{Binding HostedPane, RelativeSource={RelativeSource TemplatedParent}}"
Opacity="0.8">
<ad:ImageEx Source="/AvalonDock.Themes;component/Images/ExpDark/PinClose.png" Width="13" />
</Button>
</Grid>
</Border>
<ControlTemplate.Triggers>
</ControlTemplate.Triggers>

25
src/Libraries/AvalonDock/AvalonDock.Themes/Themes/dev2010.xaml

@ -322,14 +322,13 @@ @@ -322,14 +322,13 @@
Background="{StaticResource ManagedContentTabItemNormalBackground}"
CornerRadius="0,0,2,2"
Padding="1"
ContextMenu="{DynamicResource {ComponentResourceKey {x:Type ad:DockingManager}, {x:Static ad:ContextMenuElement.DockablePane}}}"
>
<Grid Margin="4,0,4,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Image x:Name="Icon" Width="16" Source="{TemplateBinding Icon}" UseLayoutRounding="True"/>
<ad:ImageEx x:Name="Icon" Width="16" Source="{TemplateBinding Icon}" />
<!--<ad:AlignedImage>
<ContentPresenter x:Name="Icon"
@ -455,8 +454,7 @@ @@ -455,8 +454,7 @@
</Border>
<Border x:Name="PART_Tabs"
Grid.Row="2"
Margin ="0,0,0,0"
Height ="23"
Height ="23"
BorderThickness="0,1,0,0"
BorderBrush="{StaticResource ManagedContentTabItemSelectedBackground}"
>
@ -507,7 +505,8 @@ @@ -507,7 +505,8 @@
Background="Transparent">
<StackPanel x:Name="PART_DragArea"
Orientation="Horizontal"
ContextMenu="{DynamicResource {ComponentResourceKey {x:Type ad:DockingManager}, {x:Static ad:ContextMenuElement.DocumentPane}}}">
Background="Transparent"
>
<!--This image with width=0 is required to connect the icon visual to the presentation source,
without this navigatorwindow won't work-->
<Image Source="{TemplateBinding Icon}" Width="0"/>
@ -517,12 +516,12 @@ @@ -517,12 +516,12 @@
TextWrapping="NoWrap"
Text="{TemplateBinding Title}"
Foreground="{DynamicResource {ComponentResourceKey {x:Type ad:DockingManager}, {x:Static ad:AvalonDockBrushes.DocumentHeaderForeground}}}"/>
<Image x:Name="PART_LockedIcon" Margin="2,0,0,0" Visibility="Collapsed" VerticalAlignment="Center" HorizontalAlignment="Center" Source="/AvalonDock;component/resources/Images/Locked.png" Width="6" UseLayoutRounding="True"/>
<ad:ImageEx x:Name="PART_LockedIcon" Margin="2,0,0,0" Visibility="Collapsed" VerticalAlignment="Center" HorizontalAlignment="Center" Source="/AvalonDock;component/resources/Images/Locked.png" Width="6" />
<Button x:Name="PART_CloseButton" Visibility="Hidden" Margin="6,2,2,2"
Style="{StaticResource PaneHeaderCommandStyle}"
ToolTip="{x:Static adRes:Resources.ManagedContentCommands_Close}"
Command="ad:ManagedContentCommands.Close" Opacity="0.8">
<Image Source="/AvalonDock;component/resources/Images/PinClose.png" VerticalAlignment="Center" HorizontalAlignment="Center" Width="13" UseLayoutRounding="True"/>
<ad:ImageEx Source="/AvalonDock;component/resources/Images/PinClose.png" VerticalAlignment="Center" HorizontalAlignment="Center" Width="13" />
</Button>
</StackPanel>
@ -604,7 +603,7 @@ @@ -604,7 +603,7 @@
<Setter.Value>
<ControlTemplate TargetType="{x:Type ad:DocumentPane}" >
<ControlTemplate.Resources>
<ContextMenu x:Key="DocumentsListMenu" StaysOpen="True" ItemContainerStyle="{StaticResource ResourceKey=DocumentPaneMenuItemStyle}" />
<ContextMenu x:Key="DocumentsListMenu" StaysOpen="True" />
</ControlTemplate.Resources>
<Border
Background="{TemplateBinding Background}">
@ -724,7 +723,7 @@ @@ -724,7 +723,7 @@
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Image x:Name="borderIcon" Width="16" Source="{TemplateBinding Icon}" UseLayoutRounding="True"/>
<ad:ImageEx x:Name="borderIcon" Width="16" Source="{TemplateBinding Icon}" />
<TextBlock
Grid.Column="1"
Text="{TemplateBinding Title}"
@ -1134,8 +1133,7 @@ @@ -1134,8 +1133,7 @@
<ControlTemplate TargetType="{x:Type ad:DockableFloatingWindow}">
<Border x:Name="ExtBorder"
Background="#35496A"
CornerRadius="2"
>
CornerRadius="2">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="5"/>
@ -1188,9 +1186,7 @@ @@ -1188,9 +1186,7 @@
<Border
Grid.Row="2"
Grid.Column="1"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}" >
Background="{TemplateBinding Background}">
<ContentPresenter/>
</Border>
</Grid>
@ -1202,7 +1198,6 @@ @@ -1202,7 +1198,6 @@
<Setter Property="Background" Value="{DynamicResource {ComponentResourceKey {x:Type ad:DockingManager}, {x:Static ad:AvalonDockBrushes.DockablePaneTitleBackgroundSelected}}}" TargetName="PART_MoveAnchor"/>
<Setter Property="Foreground" Value="{DynamicResource {ComponentResourceKey {x:Type ad:DockingManager}, {x:Static ad:AvalonDockBrushes.DockablePaneTitleForegroundSelected}}}" TargetName="intTitle"/>
</DataTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>

187
src/Libraries/AvalonDock/AvalonDock/AlignedImage.cs

@ -1,187 +0,0 @@ @@ -1,187 +0,0 @@
//Copyright (c) 2007-2010, Adolfo Marinucci
//All rights reserved.
//Redistribution and use in source and binary forms, with or without modification,
//are permitted provided that the following conditions are met:
//
//* Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//* Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//* Neither the name of Adolfo Marinucci nor the names of its contributors may
// be used to endorse or promote products derived from this software without
// specific prior written permission.
//
//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
//AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
//WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
//IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
//HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
//OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
//EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;
using System.Windows;
using System.Windows.Media;
namespace AvalonDock
{
public class AlignedImage : Decorator
{
public AlignedImage()
{
this.LayoutUpdated += new EventHandler(OnLayoutUpdated);
}
protected override System.Windows.Size MeasureOverride(Size constraint)
{
Size desideredSize = new Size();
if (Child != null)
{
Child.Measure(constraint);
PresentationSource ps = PresentationSource.FromVisual(this);
if (ps != null)
{
Matrix fromDevice = ps.CompositionTarget.TransformFromDevice;
Vector pixelSize = new Vector(Child.DesiredSize.Width, Child.DesiredSize.Height);
Vector measureSizeV = fromDevice.Transform(pixelSize);
desideredSize = new Size(measureSizeV.X, measureSizeV.Y);
}
}
return desideredSize;
}
protected override Size ArrangeOverride(Size arrangeBounds)
{
Size finalSize = new Size();
if (Child != null)
{
_pixelOffset = GetPixelOffset();
Child.Arrange(new Rect(_pixelOffset, Child.DesiredSize));
finalSize = arrangeBounds;
}
return finalSize;
}
private Point _pixelOffset;
private void OnLayoutUpdated(object sender, EventArgs e)
{
// This event just means that layout happened somewhere. However, this is
// what we need since layout anywhere could affect our pixel positioning.
Point pixelOffset = GetPixelOffset();
if (!AreClose(pixelOffset, _pixelOffset))
{
InvalidateArrange();
}
}
// Gets the matrix that will convert a point from "above" the
// coordinate space of a visual into the the coordinate space
// "below" the visual.
private Matrix GetVisualTransform(Visual v)
{
if (v != null)
{
Matrix m = Matrix.Identity;
Transform transform = VisualTreeHelper.GetTransform(v);
if (transform != null)
{
Matrix cm = transform.Value;
m = Matrix.Multiply(m, cm);
}
Vector offset = VisualTreeHelper.GetOffset(v);
m.Translate(offset.X, offset.Y);
return m;
}
return Matrix.Identity;
}
private Point TryApplyVisualTransform(Point point, Visual v, bool inverse, bool throwOnError, out bool success)
{
success = true;
if (v != null)
{
Matrix visualTransform = GetVisualTransform(v);
if (inverse)
{
if (!throwOnError && !visualTransform.HasInverse)
{
success = false;
return new Point(0, 0);
}
visualTransform.Invert();
}
point = visualTransform.Transform(point);
}
return point;
}
private Point ApplyVisualTransform(Point point, Visual v, bool inverse)
{
bool success = true;
return TryApplyVisualTransform(point, v, inverse, true, out success);
}
private Point GetPixelOffset()
{
Point pixelOffset = new Point();
PresentationSource ps = PresentationSource.FromVisual(this);
if (ps != null)
{
Visual rootVisual = ps.RootVisual;
// Transform (0,0) from this element up to pixels.
pixelOffset = this.TransformToAncestor(rootVisual).Transform(pixelOffset);
pixelOffset = ApplyVisualTransform(pixelOffset, rootVisual, false);
pixelOffset = ps.CompositionTarget.TransformToDevice.Transform(pixelOffset);
// Round the origin to the nearest whole pixel.
pixelOffset.X = Math.Round(pixelOffset.X);
pixelOffset.Y = Math.Round(pixelOffset.Y);
// Transform the whole-pixel back to this element.
pixelOffset = ps.CompositionTarget.TransformFromDevice.Transform(pixelOffset);
pixelOffset = ApplyVisualTransform(pixelOffset, rootVisual, true);
pixelOffset = rootVisual.TransformToDescendant(this).Transform(pixelOffset);
}
return pixelOffset;
}
private bool AreClose(Point point1, Point point2)
{
return AreClose(point1.X, point2.X) && AreClose(point1.Y, point2.Y);
}
private bool AreClose(double value1, double value2)
{
if (value1 == value2)
{
return true;
}
double delta = value1 - value2;
return ((delta < 1.53E-06) && (delta > -1.53E-06));
}
}
}

13
src/Libraries/AvalonDock/AvalonDock/AvalonDock.csproj

@ -26,22 +26,23 @@ @@ -26,22 +26,23 @@
<DebugSymbols>true</DebugSymbols>
<DebugType>Full</DebugType>
<Optimize>false</Optimize>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DefineConstants>TRACE;DEBUG;NET4</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<DefineConstants>TRACE</DefineConstants>
<DefineConstants>TRACE;NET4</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Release\AvalonDock.XML</DocumentationFile>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>true</SignAssembly>
</PropertyGroup>
<PropertyGroup>
<AssemblyOriginatorKeyFile>AvalonDock.snk</AssemblyOriginatorKeyFile>
<AssemblyOriginatorKeyFile>..\..\..\Main\ICSharpCode.SharpDevelop.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
@ -72,6 +73,7 @@ @@ -72,6 +73,7 @@
<Compile Include="AvalonDockWindow.cs" />
<Compile Include="FloatingDocumentPane.cs" />
<Compile Include="DockableFloatingWindowCommands.cs" />
<Compile Include="ImageEx.cs" />
<Compile Include="LogicalTreeAdapter.cs" />
<Compile Include="ManagedContentCollection.cs" />
<Compile Include="DockableContentCommands.cs" />
@ -148,7 +150,6 @@ @@ -148,7 +150,6 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Compile Include="AlignedImage.cs" />
<Compile Include="AvalonDockBrushes.cs" />
<Compile Include="ThemeFactory.cs" />
<Compile Include="ContextMenuElement.cs" />
@ -251,6 +252,10 @@ @@ -251,6 +252,10 @@
<Resource Include="Resources\Images\Classic\PinMenuSelected.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">

268
src/Libraries/AvalonDock/AvalonDock/AvalonDock35.csproj

@ -0,0 +1,268 @@ @@ -0,0 +1,268 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{87E61430-4243-45F2-B74E-0A4C096CEBF3}</ProjectGuid>
<OutputType>library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>AvalonDock</RootNamespace>
<AssemblyName>AvalonDock</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\v35\</OutputPath>
<DefineConstants>TRACE;DEBUG;NET35</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\v35\</OutputPath>
<DefineConstants>TRACE;NET35</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Release\v35\AvalonDock.XML</DocumentationFile>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>true</SignAssembly>
</PropertyGroup>
<PropertyGroup>
<AssemblyOriginatorKeyFile>AvalonDock.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="WindowsFormsIntegration" />
</ItemGroup>
<ItemGroup>
<Compile Include="AvalonDockWindow.cs" />
<Compile Include="FloatingDocumentPane.cs" />
<Compile Include="DockableFloatingWindowCommands.cs" />
<Compile Include="ImageEx.cs" />
<Compile Include="LogicalTreeAdapter.cs" />
<Compile Include="ManagedContentCollection.cs" />
<Compile Include="DockableContentCommands.cs" />
<Compile Include="DockablePaneCommands.cs" />
<Compile Include="DocumentContentCommands.cs" />
<Compile Include="DocumentPaneCommands.cs" />
<Compile Include="GreyableImage.cs" />
<Compile Include="InteropHelper.cs" />
<Compile Include="ManagedContentCommands.cs" />
<Compile Include="PaneCommands.cs" />
<Compile Include="Properties\Resources.de.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.de.resx</DependentUpon>
</Compile>
<Compile Include="Properties\Resources.it-IT.Designer.cs">
<DependentUpon>Resources.it-IT.resx</DependentUpon>
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
</Compile>
<Compile Include="RequestDocumentCloseEventArgs.cs" />
<Compile Include="ResizingPanel.cs" />
<Compile Include="Resizer.cs" />
<Compile Include="RoutedEventHandler.cs" />
<Compile Include="RoutedEventHelper.cs" />
<Compile Include="WindowInteropWrapper.cs" />
<Page Include="Resources\Brushes.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Resources\Common.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Resources\DockablePaneStyles.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Resources\DockingManagerStyles.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Resources\DocumentNavigatorWindowStyle.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Resources\DocumentPaneStyles.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Resources\FloatingWindowStyle.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Resources\ManagedContentStyle.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Resources\NavigatorWindowStyle.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Resources\OverlayWindowStyle.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Themes\aero.normalcolor.brushes.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Themes\aero.normalcolor.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Themes\classic.brushes.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Themes\classic.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Themes\generic.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Compile Include="AlignedImage.cs" />
<Compile Include="AvalonDockBrushes.cs" />
<Compile Include="ThemeFactory.cs" />
<Compile Include="ContextMenuElement.cs" />
<Compile Include="Converters.cs" />
<Page Include="Themes\luna.normalcolor.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<ItemGroup>
<Compile Include="DeserializationCallbackEventArgs.cs" />
<Compile Include="DockableContent.cs" />
<Compile Include="DockableFloatingWindow.cs" />
<Compile Include="DockablePane.cs" />
<Compile Include="DockablePaneAnchorTab.cs" />
<Compile Include="DockablePaneAnchorTabGroup.cs" />
<Compile Include="DockableTabPanel.cs" />
<Compile Include="DockingManager.cs" />
<Compile Include="DocumentContent.cs" />
<Compile Include="DocumentFloatingWindow.cs" />
<Compile Include="DocumentNavigatorWindow.cs" />
<Compile Include="DocumentPane.cs" />
<Compile Include="DocumentPaneResizingPanel.cs" />
<Compile Include="DocumentTabPanel.cs" />
<Compile Include="DragPaneServices.cs" />
<Compile Include="FloatingDockablePane.cs" />
<Compile Include="FloatingWindow.cs" />
<Compile Include="FlyoutDockablePane.cs" />
<Compile Include="FlyoutPaneWindow.cs" />
<Compile Include="HelperFunc.cs" />
<Compile Include="IDockableControl.cs" />
<Compile Include="IDropSurface.cs" />
<Compile Include="ManagedContent.cs" />
<Compile Include="NavigatorWindow.cs" />
<Compile Include="OverlayWindow.cs" />
<Compile Include="OverlayWindowAnchorButton.cs" />
<Compile Include="Pane.cs" />
<Compile Include="PaneTabPanel.cs" />
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<EmbeddedResource Include="Properties\Resources.it-IT.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.it-IT.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.de.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.de.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="AvalonDock.snk" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<AppDesigner Include="Properties\" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\Images\DockBottom.PNG" />
<Resource Include="Resources\Images\DockLeft.PNG" />
<Resource Include="Resources\Images\DockPane.PNG" />
<Resource Include="Resources\Images\DockRight.PNG" />
<Resource Include="Resources\Images\DockTop.PNG" />
<Resource Include="Resources\Images\HTabGroup.png" />
<Resource Include="Resources\Images\Locked.png" />
<Resource Include="Resources\Images\PinAutoHide.png" />
<Resource Include="Resources\Images\PinClose.png" />
<Resource Include="Resources\Images\PinDocMenu.png" />
<Resource Include="Resources\Images\PinMenu.png" />
<Resource Include="Resources\Images\VTabGroup.png" />
</ItemGroup>
<ItemGroup />
<ItemGroup>
<Resource Include="Resources\Images\Aero\AeroDockBottom.png" />
<Resource Include="Resources\Images\Aero\AeroDockBottomHover.png" />
<Resource Include="Resources\Images\Aero\AeroDockLeft.png" />
<Resource Include="Resources\Images\Aero\AeroDockLeftHover.png" />
<Resource Include="Resources\Images\Aero\AeroDockPane.png" />
<Resource Include="Resources\Images\Aero\AeroDockPaneBottom.png" />
<Resource Include="Resources\Images\Aero\AeroDockPaneInto.png" />
<Resource Include="Resources\Images\Aero\AeroDockPaneLeft.png" />
<Resource Include="Resources\Images\Aero\AeroDockPaneRight.png" />
<Resource Include="Resources\Images\Aero\AeroDockPaneTop.png" />
<Resource Include="Resources\Images\Aero\AeroDockRight.png" />
<Resource Include="Resources\Images\Aero\AeroDockRightHover.png" />
<Resource Include="Resources\Images\Aero\AeroDockTop.png" />
<Resource Include="Resources\Images\Aero\AeroDockTopHover.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\Images\Classic\PinAutoHide.png" />
<Resource Include="Resources\Images\Classic\PinAutoHideSelected.png" />
<Resource Include="Resources\Images\Classic\PinClose.png" />
<Resource Include="Resources\Images\Classic\PinCloseSelected.png" />
<Resource Include="Resources\Images\Classic\PinMenu.png" />
<Resource Include="Resources\Images\Classic\PinMenuSelected.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

14
src/Libraries/AvalonDock/AvalonDock/Converters.cs

@ -101,11 +101,13 @@ namespace AvalonDock @@ -101,11 +101,13 @@ namespace AvalonDock
var img = new BitmapImage(iconUri);
if (img != null)
{
return new Image()
return new Image()
{
UseLayoutRounding = true,
Width = width,
Source = img
#if NET4
UseLayoutRounding = true,
#endif
Width = width,
Source = img
};
}
}
@ -115,13 +117,15 @@ namespace AvalonDock @@ -115,13 +117,15 @@ namespace AvalonDock
var img = value as BitmapImage;
return new Image()
{
#if NET4
UseLayoutRounding = true,
#endif
Width = width,
Source = new BitmapImage(img.UriSource)
};
}
return value;
}

73
src/Libraries/AvalonDock/AvalonDock/DockableContent.cs

@ -702,14 +702,12 @@ namespace AvalonDock @@ -702,14 +702,12 @@ namespace AvalonDock
if (e.Cancel)
return false;
DockingManager oldManager = Manager;
if (e.Cancel)
return false;
((DockablePane)ContainerPane).RemoveContent(
ContainerPane.Items.IndexOf(this));
if (ContainerPane != null)
{
ContainerPane.RemoveContent(
ContainerPane.Items.IndexOf(this));
}
OnClosed();
return true;
@ -870,6 +868,12 @@ namespace AvalonDock @@ -870,6 +868,12 @@ namespace AvalonDock
"FloatingWindowSize", new SizeConverter().ConvertToInvariantString(FloatingWindowSize));
}
if (!FlyoutWindowSize.IsEmpty)
{
storeWriter.WriteAttributeString(
"FlyoutWindowSize", new SizeConverter().ConvertToInvariantString(FlyoutWindowSize));
}
if (SavedStateAndPosition != null)
{
storeWriter.WriteAttributeString(
@ -902,6 +906,8 @@ namespace AvalonDock @@ -902,6 +906,8 @@ namespace AvalonDock
{
if (contentElement.HasAttribute("FloatingWindowSize"))
FloatingWindowSize = (Size)(new SizeConverter()).ConvertFromInvariantString(contentElement.GetAttribute("FloatingWindowSize"));
if (contentElement.HasAttribute("FlyoutWindowSize"))
FlyoutWindowSize = (Size)(new SizeConverter()).ConvertFromInvariantString(contentElement.GetAttribute("FlyoutWindowSize"));
Size effectiveSize = new Size(0d, 0d);
if (contentElement.HasAttribute("EffectiveSize"))
@ -918,7 +924,7 @@ namespace AvalonDock @@ -918,7 +924,7 @@ namespace AvalonDock
Guid containerPaneGuid = Guid.Empty;
if (contentElement.HasAttribute("ContainerPaneID"))
{
containerPaneGuid = Guid.Parse(contentElement.GetAttribute("ContainerPaneID"));
containerPaneGuid = new Guid(contentElement.GetAttribute("ContainerPaneID"));
if (Manager != null)
{
@ -950,5 +956,54 @@ namespace AvalonDock @@ -950,5 +956,54 @@ namespace AvalonDock
}
}
#endregion
#region FlyoutWindowSize
/// <summary>
/// FlyoutWindowSize Dependency Property
/// </summary>
public static readonly DependencyProperty FlyoutWindowSizeProperty =
DependencyProperty.Register("FlyoutWindowSize", typeof(Size), typeof(DockableContent),
new FrameworkPropertyMetadata((Size)Size.Empty,
new PropertyChangedCallback(OnFlyoutWindowSizeChanged),
new CoerceValueCallback(CoerceFlyoutWindowSizeValue)));
/// <summary>
/// Gets or sets the FlyoutWindowSize property. This dependency property
/// indicates size of the window hosting this content when is in auto-hidden state.
/// This property is persisted when layout of the container <see cref="DockingManager"/> is saved.
/// </summary>
public Size FlyoutWindowSize
{
get { return (Size)GetValue(FlyoutWindowSizeProperty); }
set { SetValue(FlyoutWindowSizeProperty, value); }
}
/// <summary>
/// Handles changes to the FlyoutWindowSize property.
/// </summary>
private static void OnFlyoutWindowSizeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
}
/// <summary>
/// Coerces the FlyoutWindowSize value.
/// </summary>
private static object CoerceFlyoutWindowSizeValue(DependencyObject d, object value)
{
//coerces size to 100.0-100.0
Size newSize = (Size)value;
newSize.Width = Math.Max(100.0, newSize.Width);
newSize.Height = Math.Max(100.0, newSize.Height);
return newSize;
}
#endregion
}
}

4
src/Libraries/AvalonDock/AvalonDock/DockableFloatingWindow.cs

@ -59,10 +59,6 @@ namespace AvalonDock @@ -59,10 +59,6 @@ namespace AvalonDock
new CoerceValueCallback(OnCoerceValueContentProperty)));
}
//Pane _previousPane = null;
//int _arrayIndexPreviousPane = -1;
internal DockableFloatingWindow(DockingManager manager)
: base(manager)

195
src/Libraries/AvalonDock/AvalonDock/DockablePane.cs

@ -39,6 +39,8 @@ using System.Diagnostics; @@ -39,6 +39,8 @@ using System.Diagnostics;
using System.ComponentModel;
using System.Collections;
using System.Linq;
using System.Windows.Threading;
using System.Threading;
namespace AvalonDock
{
@ -108,14 +110,11 @@ namespace AvalonDock @@ -108,14 +110,11 @@ namespace AvalonDock
protected override void OnItemsChanged(System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
{
if (e.NewItems != null)
Items.Cast<DockableContent>().ForEach(c =>
{
e.NewItems.Cast<DockableContent>().ForEach(c =>
{
if (c.State == DockableContentState.None)
c.SetStateToDock();
});
}
if (c.State == DockableContentState.None)
c.SetStateToDock();
});
UpdateCanAutohideProperty();
base.OnItemsChanged(e);
@ -176,7 +175,20 @@ namespace AvalonDock @@ -176,7 +175,20 @@ namespace AvalonDock
_partHeader.MouseRightButtonDown += (s, e) =>
{
OpenOptionsMenu(null); e.Handled = true;
if (_partHeader.ContextMenu == null)
{
FocusContent();
if (_partHeader.ContextMenu == null)
{
Dispatcher.BeginInvoke(DispatcherPriority.Input, new ThreadStart(delegate
{
OpenOptionsMenu(null);
}));
e.Handled = true;
}
}
};
}
@ -233,7 +245,7 @@ namespace AvalonDock @@ -233,7 +245,7 @@ namespace AvalonDock
flag = flag && ((c.DockableStyle & DockableStyle.AutoHide) > 0);
#if DEBUG
Debug.WriteLine("{0} CanAutohide()= {1}", c.Title, flag);
Debug.WriteLine(string.Format("{0} CanAutohide()= {1}", c.Title, flag));
#endif
return flag;
})
@ -266,93 +278,108 @@ namespace AvalonDock @@ -266,93 +278,108 @@ namespace AvalonDock
#region OptionsContextMenu
ContextMenu cxOptions = null;
/// <summary>
/// Open the option context menu
/// </summary>
public bool OpenOptionsMenu(UIElement menuTarget)
public override bool OpenOptionsMenu(UIElement menuTarget)
{
if (cxOptions == null)
{
Debug.Assert(cxOptions == null);
cxOptions = TryFindResource(new ComponentResourceKey(typeof(DockingManager), ContextMenuElement.DockablePane)) as ContextMenu;
if (cxOptions != null)
{
cxOptions.Opened += (s, e) => IsOptionsMenuOpen = true;
cxOptions.Closed += (s, e) => IsOptionsMenuOpen = false;
}
}
if (cxOptions != null)
{
cxOptions.DataContext = this.SelectedItem as DockableContent;
foreach (MenuItem menuItem in cxOptions.Items.OfType<MenuItem>())
menuItem.CommandTarget = this.SelectedItem as DockableContent;
if (menuTarget != null)
{
cxOptions.Placement = PlacementMode.Bottom;
cxOptions.PlacementTarget = menuTarget;
}
else
{
cxOptions.Placement = PlacementMode.MousePoint;
cxOptions.PlacementTarget = this;
}
FocusContent();
cxOptions.IsOpen = true;
}
return (cxOptions != null && cxOptions.IsOpen);
}
/// <summary>
/// Close the options context menu
/// </summary>
public void CloseOptionsMenu()
{
if (cxOptions != null)
{
cxOptions.IsOpen = false;
cxOptions = null;
}
}
/// <summary>
/// Gets a value indicating if the options context menu is open
/// </summary>
public bool IsOptionsMenuOpen
{
get { return (bool)GetValue(IsOptionsMenuOpenProperty); }
protected set { SetValue(IsOptionsMenuOpenPropertyKey, value); }
}
// Using a DependencyProperty as the backing store for IsOptionsMenuOpen. This enables animation, styling, binding, etc...
static readonly DependencyPropertyKey IsOptionsMenuOpenPropertyKey =
DependencyProperty.RegisterReadOnly("IsOptionsMenuOpen", typeof(bool), typeof(DockablePane), new UIPropertyMetadata(false));
public static readonly DependencyProperty IsOptionsMenuOpenProperty = IsOptionsMenuOpenPropertyKey.DependencyProperty;
return base.OpenOptionsMenu(menuTarget);
}
//ContextMenu cxOptions = null;
///// <summary>
///// Open the option context menu
///// </summary>
///// <param name="menuTarget">Target element under which context menu will be shown. Pass null if context menu
///// should be shown at mouse position.</param>
///// <returns>True if context menu resource was found and open, false otherwise.</returns>
//public bool OpenOptionsMenu(UIElement menuTarget)
//{
// if (cxOptions == null)
// {
// cxOptions = TryFindResource(new ComponentResourceKey(typeof(DockingManager), ContextMenuElement.DockablePane)) as ContextMenu;
// if (cxOptions != null)
// {
// cxOptions.Opened += (s, e) => UpdateIsOptionsMenuOpen();
// cxOptions.Closed += (s, e) => UpdateIsOptionsMenuOpen();
// }
// }
// if (cxOptions != null)
// {
// cxOptions.DataContext = this.SelectedItem as DockableContent;
// foreach (MenuItem menuItem in cxOptions.Items.OfType<MenuItem>())
// menuItem.CommandTarget = this.SelectedItem as DockableContent;
// if (menuTarget != null)
// {
// cxOptions.Placement = PlacementMode.Bottom;
// cxOptions.PlacementTarget = menuTarget;
// }
// else
// {
// cxOptions.Placement = PlacementMode.MousePoint;
// cxOptions.PlacementTarget = this;
// }
// FocusContent();
// cxOptions.IsOpen = true;
// }
// return (cxOptions != null && cxOptions.IsOpen);
//}
///// <summary>
///// Close the options context menu
///// </summary>
//public void CloseOptionsMenu()
//{
// if (cxOptions != null)
// {
// cxOptions.IsOpen = false;
// cxOptions = null;
// }
//}
///// <summary>
///// Gets a value indicating if the options context menu is open
///// </summary>
//public bool IsOptionsMenuOpen
//{
// get { return (bool)GetValue(IsOptionsMenuOpenProperty); }
// protected set { SetValue(IsOptionsMenuOpenPropertyKey, value); }
//}
//// Using a DependencyProperty as the backing store for IsOptionsMenuOpen. This enables animation, styling, binding, etc...
//static readonly DependencyPropertyKey IsOptionsMenuOpenPropertyKey =
// DependencyProperty.RegisterReadOnly("IsOptionsMenuOpen", typeof(bool), typeof(DockablePane), new UIPropertyMetadata(false));
//public static readonly DependencyProperty IsOptionsMenuOpenProperty = IsOptionsMenuOpenPropertyKey.DependencyProperty;
//void UpdateIsOptionsMenuOpen()
//{
// if (cxOptions != null)
// {
// var selectedContent = cxOptions.DataContext as DockableContent;
// if (selectedContent != null)
// {
// (selectedContent.ContainerPane as DockablePane).IsOptionsMenuOpen =
// cxOptions.IsOpen;
// }
// }
//}
#endregion
#region Mouse management
void FocusContent()
{
ManagedContent selectedContent = SelectedItem as ManagedContent;
if (selectedContent != null)// && selectedContent.Content is UIElement)
{
UIElement internalContent = selectedContent.Content as UIElement;
bool res = Focus();
//Keyboard.Focus(internalContent);
selectedContent.Activate();
}
}
Point ptStartDrag;
bool isMouseDown = false;

443
src/Libraries/AvalonDock/AvalonDock/DockingManager.cs

@ -427,21 +427,6 @@ namespace AvalonDock @@ -427,21 +427,6 @@ namespace AvalonDock
}
}
/// <summary>
/// Gets an array of all dockable contents currenty managed
/// </summary>
//public DockableContent[] DockableContents
//{
// get
// {
// List<DockableContent> contents = FindContents<DockableContent>();
// foreach (DockableContent content in HiddenContents)
// contents.Add(content);
// return contents.ToArray();
// }
//}
#region DockableContents
/// <summary>
@ -480,7 +465,7 @@ namespace AvalonDock @@ -480,7 +465,7 @@ namespace AvalonDock
/// <summary>
/// Gets the DockableContents property. This dependency property
/// retrives the collection of <see cref="DocumentContents"/> that are bound to <see cref="DockingManager"/>
/// retrives the collection of <see cref="DocumentContent"/> that are bound to <see cref="DockingManager"/>
/// </summary>
public ManagedContentCollection<DocumentContent> Documents
{
@ -490,18 +475,6 @@ namespace AvalonDock @@ -490,18 +475,6 @@ namespace AvalonDock
#endregion
///// <summary>
///// Gets an array of all document contents
///// </summary>
//public DocumentContent[] Documents
//{
// get
// {
// return FindContents<DocumentContent>().ToArray();
// }
//}
#region Documents Source
/// <summary>
@ -535,32 +508,17 @@ namespace AvalonDock @@ -535,32 +508,17 @@ namespace AvalonDock
}
}
void DocumentsSourceCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
{
void DocumentsSourceCollectionChanged(
object sender,
NotifyCollectionChangedEventArgs e)
{
if (e.Action == NotifyCollectionChangedAction.Reset)
{
//close first documents that do not belong to the MainDocumentPane
DocumentContent[] docs = this.Documents.ToArray();
List<DocumentContent> documentsToCloseFirst = new List<DocumentContent>();
foreach (DocumentContent doc in docs)
{
if (doc.Parent is DocumentPane)
{
if ((doc.Parent as DocumentPane).IsMainDocumentPane == false)
{
documentsToCloseFirst.Add(doc);
}
}
}
foreach (DocumentContent doc in documentsToCloseFirst)
{
doc.InternalClose();
}
foreach (DocumentContent doc in docs)
doc.InternalClose();
docs.Where(d => ((DocumentPane)d.Parent).IsMainDocumentPane.GetValueOrDefault()).ForEach(d => d.InternalClose());
docs.Where(d => d.Parent != null && !((DocumentPane)d.Parent).IsMainDocumentPane.GetValueOrDefault()).ForEach(d => d.InternalClose());
}
if (e.OldItems != null &&
@ -590,7 +548,6 @@ namespace AvalonDock @@ -590,7 +548,6 @@ namespace AvalonDock
if (MainDocumentPane == null)
throw new InvalidOperationException("DockingManager must have at least a DocumentPane to host documents");
int iInsertIndex = e.NewStartingIndex;
foreach (object newDoc in e.NewItems)
{
if (newDoc is DocumentContent)
@ -601,7 +558,7 @@ namespace AvalonDock @@ -601,7 +558,7 @@ namespace AvalonDock
((DocumentPane)documentToAdd.Parent).Items.Clear();
}
MainDocumentPane.Items.Insert(iInsertIndex, documentToAdd);
MainDocumentPane.Items.Add(documentToAdd);
}
else if (newDoc is UIElement) //limit objects to be at least framework elements
{
@ -610,14 +567,14 @@ namespace AvalonDock @@ -610,14 +567,14 @@ namespace AvalonDock
Content = newDoc
};
MainDocumentPane.Items.Insert(iInsertIndex, documentToAdd);
MainDocumentPane.Items.Add(documentToAdd);
}
else
throw new InvalidOperationException(string.Format("Unable to add type {0} as DocumentContent", newDoc));
iInsertIndex++;
}
}
RefreshContents();
}
internal void HandleDocumentClose(DocumentContent contentClosed)
@ -754,8 +711,13 @@ namespace AvalonDock @@ -754,8 +711,13 @@ namespace AvalonDock
RefreshContents();
}
bool _allowRefreshContents = true;
internal void RefreshContents()
{
if (!_allowRefreshContents)
return;
var contentsFoundUnderMe = new LogicalTreeAdapter(this).Descendants<DependencyObject>().Where(d => d.Item is ManagedContent).Select(d => d.Item).Cast<ManagedContent>();
var contentsFoundInFloatingMode = _floatingWindows.SelectMany(d => d.HostedPane.Items.Cast<ManagedContent>());
DockableContent contentFoundInFlyoutMode = null;
@ -1077,7 +1039,7 @@ namespace AvalonDock @@ -1077,7 +1039,7 @@ namespace AvalonDock
navigatorWindow.Height = this.ActualHeight;
navigatorWindow.ShowActivated = false;
navigatorWindow.Show();
navigatorWindow.Focus();
//navigatorWindow.Focus();
}
void HideNavigatorWindow()
@ -1102,12 +1064,13 @@ namespace AvalonDock @@ -1102,12 +1064,13 @@ namespace AvalonDock
{
ShowNavigatorWindow();
}
navigatorWindow.MoveNextSelectedContent();
e.Handled = true;
}
else
else if (NavigatorWindow.IsKeyHandled(e.Key))
{
HideNavigatorWindow();
}
base.OnKeyDown(e);
@ -1119,93 +1082,38 @@ namespace AvalonDock @@ -1119,93 +1082,38 @@ namespace AvalonDock
bool _navigatorWindowIsVisible = navigatorWindow != null ? navigatorWindow.IsVisible : false;
Debug.WriteLine(string.Format("OnKeyUp {0} CtrlDn={1}", e.Key, isCtrlDown));
if (e.Key != Key.Tab || !isCtrlDown)
HideNavigatorWindow();
base.OnKeyUp(e);
}
//void OnExecuteCommand(object sender, ExecutedRoutedEventArgs e)
//{
// if (e.Command == ShowNavigatorWindowCommand && ((Keyboard.Modifiers & ModifierKeys.Control)>0) )
// {
// ShowNavigatorWindow();
// e.Handled = true;
// }
// else if (e.Command == ShowDocumentNavigatorWindowCommand && ((Keyboard.Modifiers & ModifierKeys.Shift) > 0))
// {
// ShowDocumentNavigatorWindow();
// e.Handled = true;
// }
//}
//void OnCanExecuteCommand(object sender, CanExecuteRoutedEventArgs e)
//{
// e.CanExecute = true;
//}
//private static RoutedUICommand showDocumentNavigatorCommand = null;
///// <summary>
///// Get the command to show document navigator window
///// </summary>
//public static RoutedUICommand ShowDocumentNavigatorWindowCommand
//{
// get
// {
// lock (syncRoot)
// {
// if (null == showDocumentNavigatorCommand)
// {
// showDocumentNavigatorCommand = new RoutedUICommand("S_how document navigator window", "DocumentNavigator", typeof(DockingManager));
// showDocumentNavigatorCommand.InputGestures.Add(new KeyGesture(Key.Tab, ModifierKeys.Shift));
// }
// }
// return showDocumentNavigatorCommand;
// }
//}
//DocumentNavigatorWindow documentNavigatorWindow = null;
//void ShowDocumentNavigatorWindow()
//{
// HideDocumentNavigatorWindow();
// //if (documentNavigatorWindow == null)
// {
// documentNavigatorWindow = new DocumentNavigatorWindow(this);
// documentNavigatorWindow.Owner = Window.GetWindow(this);
// }
// if (MainDocumentPane == null)
// return;
if (NavigatorWindow.IsKeyHandled(e.Key) && isCtrlDown)
{
if (!_navigatorWindowIsVisible && e.Key == Key.Tab)
{
ShowNavigatorWindow();
}
// Point locMainDocumentPane = MainDocumentPane.PointToScreenDPI(new Point());
// documentNavigatorWindow.Left = locMainDocumentPane.X;
// documentNavigatorWindow.Top = locMainDocumentPane.Y;
// documentNavigatorWindow.Width = MainDocumentPane.ActualWidth;
// documentNavigatorWindow.Height = MainDocumentPane.ActualHeight;
// documentNavigatorWindow.Show();
// documentNavigatorWindow.Focus();
//}
if (_navigatorWindowIsVisible)
navigatorWindow.HandleKey(e.Key);
}
else
{
if (_navigatorWindowIsVisible)
{
if (navigatorWindow.Documents.CurrentItem != null)
{
var docSelected = (navigatorWindow.Documents.CurrentItem as NavigatorWindowDocumentItem).ItemContent as DocumentContent;
docSelected.Activate();
}
else if (navigatorWindow.DockableContents.CurrentItem != null)
{
var cntSelected = (navigatorWindow.DockableContents.CurrentItem as NavigatorWindowItem).ItemContent as DockableContent;
cntSelected.Activate();
}
//void HideDocumentNavigatorWindow()
//{
// //if (documentNavigatorWindow != null)
// //{
// // documentNavigatorWindow.Hide();
// // //don't close this window to be more responsive
// // documentNavigatorWindow.Close();
// // documentNavigatorWindow = null;
// //}
//}
HideNavigatorWindow();
}
}
//#endregion
base.OnKeyUp(e);
}
#region DockablePane operations
/// <summary>
@ -1268,7 +1176,9 @@ namespace AvalonDock @@ -1268,7 +1176,9 @@ namespace AvalonDock
toplevelPanel.Orientation = requestedOrientation;
FrameworkElement contentElement = Content as FrameworkElement;
Content = toplevelPanel;
_allowRefreshContents = false;
Content = null;
if (anchor == AnchorStyle.Left ||
anchor == AnchorStyle.Top)
@ -1281,6 +1191,9 @@ namespace AvalonDock @@ -1281,6 +1191,9 @@ namespace AvalonDock
toplevelPanel.Children.Add(paneToAnchor);
toplevelPanel.InsertChildRelativeTo(contentElement, paneToAnchor, false);
}
_allowRefreshContents = true;
Content = toplevelPanel;
}
else
{
@ -1329,16 +1242,13 @@ namespace AvalonDock @@ -1329,16 +1242,13 @@ namespace AvalonDock
}
//refresh contents state
foreach (ManagedContent content in paneToAnchor.Items)
{
if (content is DockableContent)
paneToAnchor.Items.OfType<DockableContent>().ForEach(dc =>
{
((DockableContent)content).SetStateToDock();
}
}
dc.SetStateToDock();
});
paneToAnchor.Focus();
//paneToAnchor.Focus();
toplevelPanel.InvalidateMeasure();
}
@ -1533,7 +1443,7 @@ namespace AvalonDock @@ -1533,7 +1443,7 @@ namespace AvalonDock
//than set the new anchor style for the pane
paneToAnchor.Anchor = anchor;
paneToAnchor.Focus();
//paneToAnchor.Focus();
}
/// <summary>
@ -1632,20 +1542,20 @@ namespace AvalonDock @@ -1632,20 +1542,20 @@ namespace AvalonDock
relativePane, true);
}
if (relativePaneContainer.Orientation == Orientation.Horizontal)
{
Size desideredSize = ResizingPanel.GetEffectiveSize(paneToAnchor);
double approxStarForNewPane = desideredSize.Width / relativePaneContainer.ActualWidth;
approxStarForNewPane = Math.Min(approxStarForNewPane, 1.0);
paneToAnchor.SetValue(ResizingPanel.ResizeWidthProperty, new GridLength(approxStarForNewPane, GridUnitType.Star));
}
//if (relativePaneContainer.Orientation == Orientation.Horizontal)
//{
// Size desideredSize = ResizingPanel.GetEffectiveSize(paneToAnchor);
// double approxStarForNewPane = desideredSize.Width / relativePaneContainer.ActualWidth;
// approxStarForNewPane = Math.Min(approxStarForNewPane, 1.0);
// paneToAnchor.SetValue(ResizingPanel.ResizeWidthProperty, new GridLength(approxStarForNewPane, GridUnitType.Star));
//}
}
relativePaneContainer.InvalidateMeasure();
}
#endregion
paneToAnchor.Focus();
//paneToAnchor.Focus();
//(paneToAnchor.SelectedItem as ManagedContent).Activate();
//if (paneToAnchor.SelectedItem is DocumentContent)
@ -1766,7 +1676,7 @@ namespace AvalonDock @@ -1766,7 +1676,7 @@ namespace AvalonDock
if (relativePaneContainer != null)
relativePaneContainer.AdjustPanelSizes();
paneToAnchor.Focus();
//paneToAnchor.Focus();
}
#region DropInto methods
@ -1788,19 +1698,20 @@ namespace AvalonDock @@ -1788,19 +1698,20 @@ namespace AvalonDock
{
//transfer tha contents of dragged pane (conatined in a FloatingWindow)
//to the pane which user select
ManagedContent contentToFocus = null;
//ManagedContent contentToFocus = null;
while (paneDragged.Items.Count > 0)
{
ManagedContent contentToTransfer = paneDragged.RemoveContent(0);
var contentToTransfer = paneDragged.RemoveContent(0);
paneToDropInto.Items.Insert(0, contentToTransfer);
contentToFocus = contentToTransfer;
//contentToFocus = contentToTransfer;
contentToTransfer.Activate();
}
paneToDropInto.SelectedIndex = 0;
paneToDropInto.Focus();
if (contentToFocus != null)
contentToFocus.Activate();
//paneToDropInto.SelectedIndex = 0;
//paneToDropInto.Focus();
//if (contentToFocus != null)
// contentToFocus.Activate();
}
internal void DropInto(DockablePane paneDragged, DocumentPane paneToDropInto)
{
@ -1812,18 +1723,20 @@ namespace AvalonDock @@ -1812,18 +1723,20 @@ namespace AvalonDock
//to Dock (using Dock() method of class DockablePane).
while (paneDragged.Items.Count > 0)
{
ManagedContent contentToTransfer = paneDragged.RemoveContent(0);
var contentToTransfer = paneDragged.RemoveContent(0);
paneToDropInto.Items.Add(contentToTransfer);
DockableContent dockContentToTransfer = contentToTransfer as DockableContent;
var dockContentToTransfer = contentToTransfer as DockableContent;
if (dockContentToTransfer != null)
dockContentToTransfer.SetStateToDocument();
contentToTransfer.Activate();
}
paneToDropInto.SelectedIndex = paneToDropInto.Items.Count - 1;
paneToDropInto.Focus();
//paneToDropInto.SelectedIndex = paneToDropInto.Items.Count - 1;
//paneToDropInto.Focus();
}
internal void DropInto(DockablePane paneDragged, DockablePane paneToDropInto)
{
@ -1844,7 +1757,7 @@ namespace AvalonDock @@ -1844,7 +1757,7 @@ namespace AvalonDock
paneToDropInto.SelectedIndex = paneToDropInto.Items.Count - 1;
paneToDropInto.Focus();
//paneToDropInto.Focus();
}
#endregion
@ -2175,6 +2088,7 @@ namespace AvalonDock @@ -2175,6 +2088,7 @@ namespace AvalonDock
if (floating)
{
DocumentFloatingWindow floatingWindow = new DocumentFloatingWindow(this);
floatingWindow.Owner = Window.GetWindow(this);
floatingWindow.Content = document;
floatingWindow.Show();
}
@ -2286,6 +2200,11 @@ namespace AvalonDock @@ -2286,6 +2200,11 @@ namespace AvalonDock
else
{
//if no suitable pane was found create e new one on the fly
if (content.ContainerPane != null)
{
content.ContainerPane.RemoveContent(content);
}
DockablePane pane = new DockablePane();
pane.Items.Add(content);
Anchor(pane, desideredAnchor);
@ -2370,9 +2289,9 @@ namespace AvalonDock @@ -2370,9 +2289,9 @@ namespace AvalonDock
ResizingPanel.SetEffectiveSize(dockParent, new Size(200, 0.0));
}
else if (content.ActualWidth == 0.0 && (
dockParent.Anchor == AnchorStyle.Left || dockParent.Anchor == AnchorStyle.Right))
dockParent.Anchor == AnchorStyle.Top || dockParent.Anchor == AnchorStyle.Bottom))
{
ResizingPanel.SetResizeWidth(dockParent, new GridLength(200));
ResizingPanel.SetResizeHeight(dockParent, new GridLength(200));
ResizingPanel.SetEffectiveSize(dockParent, new Size(200, 0.0));
}
@ -2628,10 +2547,13 @@ namespace AvalonDock @@ -2628,10 +2547,13 @@ namespace AvalonDock
#region Anchor Style Update routines
protected override Size ArrangeOverride(Size arrangeBounds)
{
//at the moment this is the easy way to get anchor properties always updated
//at the moment this is the easiest way to get anchor properties always updated
if (this.Content as ResizingPanel != null)
UpdateAnchorStyle();
//hide the flyout window because transform could be changed
HideFlyoutWindow();
return base.ArrangeOverride(arrangeBounds);
}
@ -2741,10 +2663,10 @@ namespace AvalonDock @@ -2741,10 +2663,10 @@ namespace AvalonDock
{
if (_flyoutWindow != null && !_flyoutWindow.IsClosing)
{
_flyoutWindow.Height = 0.0;
_flyoutWindow.Width = 0.0;
_flyoutWindow.Close();
var flWindow = _flyoutWindow;
_flyoutWindow = null;
flWindow.Closing -= new System.ComponentModel.CancelEventHandler(OnFlyoutWindowClosing);
flWindow.Close();
}
}
@ -2770,13 +2692,13 @@ namespace AvalonDock @@ -2770,13 +2692,13 @@ namespace AvalonDock
//_flyoutWindow.KeepWindowOpen();
return;
}
//hide previous create window
//hide previous window
HideFlyoutWindow();
//select this content in the referenced pane
content.ContainerPane.SelectedItem = content;
if (_wndInteropWrapper == null)
{
_wndInteropWrapper = new WindowInteropWrapper(parentWindow);
@ -2819,8 +2741,11 @@ namespace AvalonDock @@ -2819,8 +2741,11 @@ namespace AvalonDock
/// <param name="e"></param>
void OnFlyoutWindowClosing(object sender, System.ComponentModel.CancelEventArgs e)
{
_flyoutWindow.Closing -= new System.ComponentModel.CancelEventHandler(OnFlyoutWindowClosing);
_flyoutWindow.Owner = null;
if (_flyoutWindow != null)
{
_flyoutWindow.Closing -= new System.ComponentModel.CancelEventHandler(OnFlyoutWindowClosing);
_flyoutWindow.Owner = null;
}
}
/// <summary>
@ -2839,70 +2764,86 @@ namespace AvalonDock @@ -2839,70 +2764,86 @@ namespace AvalonDock
{
if (_flyoutWindow == null)
return;
double leftTabsWidth = FlowDirection == FlowDirection.LeftToRight ? _leftAnchorTabPanel.ActualWidth : _rightAnchorTabPanel.ActualWidth;
double rightTabsWidth = FlowDirection == FlowDirection.LeftToRight ? _rightAnchorTabPanel.ActualWidth : _leftAnchorTabPanel.ActualWidth;
double topTabsHeight = _topAnchorTabPanel.ActualHeight;
double bottomTabsHeight = _bottomAnchorTabPanel.ActualHeight;
if (_flyoutWindow.ReferencedPane == null)
return;
if (_flyoutWindow.ReferencedPane.SelectedItem == null)
return;
var actualSize = this.TransformedActualSize();
double leftTabsWidth = FlowDirection == FlowDirection.LeftToRight ? _leftAnchorTabPanel.TransformedActualSize().Width : _rightAnchorTabPanel.TransformedActualSize().Width;
double rightTabsWidth = FlowDirection == FlowDirection.LeftToRight ? _rightAnchorTabPanel.TransformedActualSize().Width : _leftAnchorTabPanel.TransformedActualSize().Width;
double topTabsHeight = _topAnchorTabPanel.TransformedActualSize().Height;
double bottomTabsHeight = _bottomAnchorTabPanel.TransformedActualSize().Height;
bool hOrientation = _flyoutWindow.ReferencedPane.Anchor == AnchorStyle.Right || _flyoutWindow.ReferencedPane.Anchor == AnchorStyle.Left;
Point locDockingManager = HelperFunc.PointToScreenWithoutFlowDirection(this, new Point());
Point locContent = HelperFunc.PointToScreenWithoutFlowDirection(Content as FrameworkElement, new Point());
double resWidth = initialSetup ? ResizingPanel.GetResizeWidth(_flyoutWindow.ReferencedPane).Value : _flyoutWindow.Width;
double resHeight = initialSetup ? ResizingPanel.GetResizeHeight(_flyoutWindow.ReferencedPane).Value : _flyoutWindow.Height;
Size initialSetupFlyoutWindowSize = Size.Empty;
initialSetupFlyoutWindowSize = (_flyoutWindow.ReferencedPane.SelectedItem as DockableContent).FlyoutWindowSize;
if (hOrientation && initialSetupFlyoutWindowSize.Width <= 0.0)
initialSetupFlyoutWindowSize = ResizingPanel.GetEffectiveSize(_flyoutWindow.ReferencedPane.ReferencedPane);
if (!hOrientation && initialSetupFlyoutWindowSize.Height <= 0.0)
initialSetupFlyoutWindowSize = ResizingPanel.GetEffectiveSize(_flyoutWindow.ReferencedPane.ReferencedPane);
initialSetupFlyoutWindowSize = this.TransformSize(initialSetupFlyoutWindowSize);
double resWidth = initialSetup ? initialSetupFlyoutWindowSize.Width : _flyoutWindow.Width;
double resHeight = initialSetup ? initialSetupFlyoutWindowSize.Height : _flyoutWindow.Height;
if (_flyoutWindow.ReferencedPane.Anchor == AnchorStyle.Right)
{
_flyoutWindow.MaxWidth = actualSize.Width - rightTabsWidth;
_flyoutWindow.MaxHeight = actualSize.Height - topTabsHeight - bottomTabsHeight;
_flyoutWindow.Top = locDockingManager.Y + topTabsHeight;
_flyoutWindow.Height = this.ActualHeight - topTabsHeight - bottomTabsHeight;
_flyoutWindow.Height = _flyoutWindow.MaxHeight;
_flyoutWindow.MaxWidth = ActualWidth - rightTabsWidth;
_flyoutWindow.MaxHeight = ActualHeight;
if (initialSetup)
{
_flyoutWindow.Left = FlowDirection == FlowDirection.LeftToRight ? locDockingManager.X + this.ActualWidth - rightTabsWidth : locDockingManager.X + leftTabsWidth;
_flyoutWindow.Left = (FlowDirection == FlowDirection.LeftToRight ? locDockingManager.X + actualSize.Width - rightTabsWidth : locDockingManager.X + leftTabsWidth);
_flyoutWindow.Width = 0.0;
_flyoutWindow.TargetWidth = resWidth;
}
else
{
if (!_flyoutWindow.IsOpening && !_flyoutWindow.IsClosing)
_flyoutWindow.Left = FlowDirection == FlowDirection.LeftToRight ? locDockingManager.X + this.ActualWidth - rightTabsWidth - _flyoutWindow.Width : locDockingManager.X + leftTabsWidth;
_flyoutWindow.Left = (FlowDirection == FlowDirection.LeftToRight ? locDockingManager.X + actualSize.Width - rightTabsWidth - _flyoutWindow.Width : locDockingManager.X + leftTabsWidth);
}
}
if (_flyoutWindow.ReferencedPane.Anchor == AnchorStyle.Left)
{
_flyoutWindow.MaxWidth = actualSize.Width - leftTabsWidth;
_flyoutWindow.MaxHeight = actualSize.Height - topTabsHeight - bottomTabsHeight;
_flyoutWindow.Top = locDockingManager.Y + topTabsHeight;
//_flyoutWindow.Top = locContent.Y;
_flyoutWindow.Height = this.ActualHeight - topTabsHeight - bottomTabsHeight;
//_flyoutWindow.Height = ((FrameworkElement)this.Content).ActualHeight;
_flyoutWindow.Height = _flyoutWindow.MaxHeight;
_flyoutWindow.MaxWidth = ActualWidth - leftTabsWidth;
_flyoutWindow.MaxHeight = ActualHeight;
if (initialSetup)
{
_flyoutWindow.Left = FlowDirection == FlowDirection.RightToLeft ? locDockingManager.X + this.ActualWidth - rightTabsWidth : locDockingManager.X + leftTabsWidth;
_flyoutWindow.Left = FlowDirection == FlowDirection.RightToLeft ? locDockingManager.X + actualSize.Width - rightTabsWidth : locDockingManager.X + leftTabsWidth;
_flyoutWindow.Width = 0.0;
_flyoutWindow.TargetWidth = resWidth;
}
else
{
if (!_flyoutWindow.IsOpening && !_flyoutWindow.IsClosing)
_flyoutWindow.Left = FlowDirection == FlowDirection.RightToLeft ? locDockingManager.X + this.ActualWidth - rightTabsWidth - _flyoutWindow.Width : locDockingManager.X + leftTabsWidth;
_flyoutWindow.Left = FlowDirection == FlowDirection.RightToLeft ? locDockingManager.X + actualSize.Width - rightTabsWidth - _flyoutWindow.Width : locDockingManager.X + leftTabsWidth;
}
}
if (_flyoutWindow.ReferencedPane.Anchor == AnchorStyle.Top)
{
_flyoutWindow.Left = locDockingManager.X + leftTabsWidth;
_flyoutWindow.Width = this.ActualWidth - rightTabsWidth -leftTabsWidth;
_flyoutWindow.MaxWidth = ActualWidth;
_flyoutWindow.MaxHeight = ActualHeight - topTabsHeight;
_flyoutWindow.MaxWidth = actualSize.Width - rightTabsWidth - leftTabsWidth;
_flyoutWindow.MaxHeight = actualSize.Height - topTabsHeight;
_flyoutWindow.Left = locDockingManager.X + leftTabsWidth;
_flyoutWindow.Width = _flyoutWindow.MaxWidth;
if (initialSetup)
{
_flyoutWindow.Height = 0.0;
@ -2916,31 +2857,35 @@ namespace AvalonDock @@ -2916,31 +2857,35 @@ namespace AvalonDock
}
if (_flyoutWindow.ReferencedPane.Anchor == AnchorStyle.Bottom)
{
_flyoutWindow.Left = locDockingManager.X + leftTabsWidth;
_flyoutWindow.Width = this.ActualWidth - rightTabsWidth - leftTabsWidth;
_flyoutWindow.MaxWidth = actualSize.Width - rightTabsWidth - leftTabsWidth;
_flyoutWindow.MaxHeight = actualSize.Height - bottomTabsHeight;
_flyoutWindow.MaxWidth = ActualWidth;
_flyoutWindow.MaxHeight = ActualHeight - bottomTabsHeight;
_flyoutWindow.Left = locDockingManager.X + leftTabsWidth;
_flyoutWindow.Width = _flyoutWindow.MaxWidth;
if (initialSetup)
{
_flyoutWindow.Top = locDockingManager.Y + this.ActualHeight - bottomTabsHeight;
_flyoutWindow.Top = locDockingManager.Y + actualSize.Height - bottomTabsHeight;
_flyoutWindow.Height = 0.0;
_flyoutWindow.TargetHeight = resHeight;
}
else
{
if (!_flyoutWindow.IsOpening && !_flyoutWindow.IsClosing)
_flyoutWindow.Top = locDockingManager.Y + this.ActualHeight - bottomTabsHeight - _flyoutWindow.Height;
if (_flyoutWindow.IsClosing)
_flyoutWindow.Top = locDockingManager.Y + this.ActualHeight - bottomTabsHeight - _flyoutWindow.Height;
_flyoutWindow.Top = locDockingManager.Y + actualSize.Height - bottomTabsHeight - _flyoutWindow.Height;
//if (_flyoutWindow.IsClosing)
// _flyoutWindow.Top = locDockingManager.Y + actualSize.Height - bottomTabsHeight - _flyoutWindow.Height;
}
}
if (_flyoutWindow != null && !_flyoutWindow.IsClosing)
_flyoutWindow.UpdatePositionAndSize();
}
if (initialSetup)
_flyoutWindow.ReferencedPane.LayoutTransform = (MatrixTransform)this.TansformToAncestor();
Debug.WriteLine(string.Format("UpdateFlyoutWindowPosition() Rect->{0} InitialSetup={1}", new Rect(_flyoutWindow.Left, _flyoutWindow.Top, _flyoutWindow.Width, _flyoutWindow.Height), initialSetup));
}
#endregion
@ -2999,7 +2944,7 @@ namespace AvalonDock @@ -2999,7 +2944,7 @@ namespace AvalonDock
{
if (CaptureMouse())
{
DockableFloatingWindow floatingWindow = new DockableFloatingWindow(this);
var floatingWindow = new DockableFloatingWindow(this);
floatingWindow.Content = dockablePane;
floatingWindow.Owner = Window.GetWindow(this);
Drag(floatingWindow, point, offset);
@ -3079,9 +3024,13 @@ namespace AvalonDock @@ -3079,9 +3024,13 @@ namespace AvalonDock
Rect IDropSurface.SurfaceRectangle
{
get
{
{
if (PresentationSource.FromVisual(this) != null)
return new Rect(HelperFunc.PointToScreenWithoutFlowDirection(this, new Point(0, 0)), new Size(ActualWidth, ActualHeight));
{
var actualSize = this.TransformedActualSize();
return new Rect(HelperFunc.PointToScreenWithoutFlowDirection(this, new Point(0, 0)), new Size(actualSize.Width, actualSize.Height));
}
return Rect.Empty;
}
}
@ -3117,15 +3066,15 @@ namespace AvalonDock @@ -3117,15 +3066,15 @@ namespace AvalonDock
if (OverlayWindow.IsVisible)
return;
var actualSize = this.TransformedActualSize();
OverlayWindow.Owner = DragPaneServices.FloatingWindow;
//OverlayWindow.Left = PointToScreen(new Point(0, 0)).X;
//OverlayWindow.Top = PointToScreen(new Point(0, 0)).Y;
Point origPoint = HelperFunc.PointToScreenWithoutFlowDirection(this, new Point());
OverlayWindow.Left = origPoint.X;
OverlayWindow.Top = origPoint.Y;
OverlayWindow.Width = ActualWidth;
OverlayWindow.Height = ActualHeight;
OverlayWindow.Width = actualSize.Width;
OverlayWindow.Height = actualSize.Height;
//don't pass transform matrix to Overlay window otherwise anchor thumbs will be resized
OverlayWindow.Show();
}
@ -3146,9 +3095,6 @@ namespace AvalonDock @@ -3146,9 +3095,6 @@ namespace AvalonDock
{
OverlayWindow.Owner = null;
OverlayWindow.Hide();
//Window mainWindow = Window.GetWindow(this);
//if (mainWindow != null)
// mainWindow.Activate();
}
/// <summary>
@ -3193,6 +3139,9 @@ namespace AvalonDock @@ -3193,6 +3139,9 @@ namespace AvalonDock
xmlWriter.WriteAttributeString("EffectiveSize", new SizeConverter().ConvertToInvariantString(ResizingPanel.GetEffectiveSize(pane)));
xmlWriter.WriteAttributeString("ID", pane.ID.ToString());
xmlWriter.WriteAttributeString("Anchor", pane.Anchor.ToString());
if (pane.Items.Count > 1)
xmlWriter.WriteAttributeString("SelectedIndex", XmlConvert.ToString(pane.SelectedIndex));
xmlWriter.WriteAttributeString("IsAutoHidden", XmlConvert.ToString(pane.IsAutoHidden));
@ -3234,7 +3183,6 @@ namespace AvalonDock @@ -3234,7 +3183,6 @@ namespace AvalonDock
xmlWriter.WriteStartElement("DockableContent");
xmlWriter.WriteAttributeString("Name", content.Name);
//xmlWriter.WriteAttributeString("AutoHide", XmlConvert.ToString(content.State == DockableContentState.AutoHide));
content.SaveLayout(xmlWriter);
@ -3266,6 +3214,13 @@ namespace AvalonDock @@ -3266,6 +3214,13 @@ namespace AvalonDock
if (pane.IsMainDocumentPane.GetValueOrDefault())
xmlWriter.WriteAttributeString("IsMain", "true");
if (pane.Items.Count > 1)
xmlWriter.WriteAttributeString("SelectedIndex", XmlConvert.ToString(pane.SelectedIndex));
xmlWriter.WriteAttributeString("ResizeWidth", ResizingPanel.GetResizeWidth(pane).ToString());
xmlWriter.WriteAttributeString("ResizeHeight", ResizingPanel.GetResizeHeight(pane).ToString());
xmlWriter.WriteAttributeString("EffectiveSize", new SizeConverter().ConvertToInvariantString(ResizingPanel.GetEffectiveSize(pane)));
foreach (ManagedContent content in pane.Items)
{
if (content is DockableContent)
@ -3402,8 +3357,6 @@ namespace AvalonDock @@ -3402,8 +3357,6 @@ namespace AvalonDock
SaveLayout(sw, Content as ResizingPanel);
else if (Content is DocumentPane)
SaveLayout(sw, Content as DocumentPane);
//else if (Content is DocumentPaneResizingPanel)
// SaveLayout(sw, Content as DocumentPaneResizingPanel);
sw.WriteStartElement("Hidden");
@ -3610,6 +3563,13 @@ namespace AvalonDock @@ -3610,6 +3563,13 @@ namespace AvalonDock
{
var documentPane = new DocumentPane();
if (mainElement.HasAttribute("ResizeWidth"))
ResizingPanel.SetResizeWidth(documentPane, (GridLength)GLConverter.ConvertFromInvariantString(mainElement.GetAttribute("ResizeWidth")));
if (mainElement.HasAttribute("ResizeHeight"))
ResizingPanel.SetResizeHeight(documentPane, (GridLength)GLConverter.ConvertFromInvariantString(mainElement.GetAttribute("ResizeHeight")));
if (mainElement.HasAttribute("EffectiveSize"))
ResizingPanel.SetEffectiveSize(documentPane, (Size)(new SizeConverter()).ConvertFromInvariantString(mainElement.GetAttribute("EffectiveSize")));
foreach (XmlElement contentElement in mainElement.ChildNodes)
{
if (contentElement.Name == "DockableContent" &&
@ -3666,6 +3626,9 @@ namespace AvalonDock @@ -3666,6 +3626,9 @@ namespace AvalonDock
}
}
if (mainElement.HasAttribute("SelectedIndex"))
documentPane.SelectedIndex = XmlConvert.ToInt32(mainElement.GetAttribute("SelectedIndex"));
return documentPane;
}
@ -3684,7 +3647,7 @@ namespace AvalonDock @@ -3684,7 +3647,7 @@ namespace AvalonDock
if (mainElement.HasAttribute("EffectiveSize"))
ResizingPanel.SetEffectiveSize(pane, (Size)(new SizeConverter()).ConvertFromInvariantString(mainElement.GetAttribute("EffectiveSize")));
if (mainElement.HasAttribute("ID"))
pane.ID = Guid.Parse(mainElement.GetAttribute("ID"));
pane.ID = new Guid(mainElement.GetAttribute("ID"));
bool toggleAutoHide = false;
if (mainElement.HasAttribute("IsAutoHidden"))
@ -3724,6 +3687,9 @@ namespace AvalonDock @@ -3724,6 +3687,9 @@ namespace AvalonDock
if (toggleAutoHide && pane.Items.Count > 0)
ToggleAutoHide(pane);
if (mainElement.HasAttribute("SelectedIndex"))
pane.SelectedIndex = XmlConvert.ToInt32(mainElement.GetAttribute("SelectedIndex"));
return pane;
}
@ -3989,16 +3955,17 @@ namespace AvalonDock @@ -3989,16 +3955,17 @@ namespace AvalonDock
ClearEmptyPanes();
RefreshContents();
if (Documents.Count() > 0)
{
ActiveContent = Documents[0];
}
else
if (ActiveDocument != null &&
(ActiveDocument.ContainerPane == null ||
ActiveDocument.ContainerPane.GetManager() != this))
{
ActiveContent = null;
ActiveDocument = null;
if (Documents.Count > 0)
ActiveDocument = Documents[0];
else
ActiveDocument = null;
}
ActiveContent = ActiveDocument;
}
#endregion

20
src/Libraries/AvalonDock/AvalonDock/DocumentContent.cs

@ -226,13 +226,13 @@ namespace AvalonDock @@ -226,13 +226,13 @@ namespace AvalonDock
if (!e.Handled && e.Command == DocumentContentCommands.FloatingDocument)
{
this.Show(true);
Activate();
e.Handled = true;
}
else if (!e.Handled && e.Command == DocumentContentCommands.TabbedDocument)
{
this.Show(false);
Activate();
e.Handled = true;
}
}
@ -307,6 +307,13 @@ namespace AvalonDock @@ -307,6 +307,13 @@ namespace AvalonDock
parentPane.SelectedIndex = 0;
}
}
//Active this content as the active document
if (Manager != null)
Manager.ActiveDocument = this;
//ensure this content is rendered first
Panel.SetZIndex(this, 2);
}
/// <summary>
@ -391,8 +398,8 @@ namespace AvalonDock @@ -391,8 +398,8 @@ namespace AvalonDock
DockingManager oldManager = Manager;
if (Manager != null)
Manager.FireDocumentClosingEvent(e);
if (oldManager != null)
oldManager.FireDocumentClosingEvent(e);
if (e.Cancel)
return false;
@ -403,9 +410,10 @@ namespace AvalonDock @@ -403,9 +410,10 @@ namespace AvalonDock
//if documents are attached to an external source via DockingManager.DocumentsSource
//let application host handle the document closing by itself
if (Manager != null && Manager.DocumentsSource != null)
if (oldManager != null &&
oldManager.DocumentsSource != null)
{
Manager.HandleDocumentClose(this);
oldManager.HandleDocumentClose(this);
}
if (oldManager != null)

3
src/Libraries/AvalonDock/AvalonDock/DocumentFloatingWindow.cs

@ -140,7 +140,8 @@ namespace AvalonDock @@ -140,7 +140,8 @@ namespace AvalonDock
// Close();
//}
((FloatingDocumentPane)HostedPane).PreviousPane.CheckContentsEmpty();
if (((FloatingDocumentPane)HostedPane).PreviousPane != null)
((FloatingDocumentPane)HostedPane).PreviousPane.CheckContentsEmpty();
if (HostedPane.Items.Count == 0)
Close();

62
src/Libraries/AvalonDock/AvalonDock/DocumentPane.cs

@ -101,7 +101,7 @@ namespace AvalonDock @@ -101,7 +101,7 @@ namespace AvalonDock
Items.Cast<ManagedContent>().FirstOrDefault(d => d.IsActiveDocument) != null);
if (Items.Count > 0)
Debug.WriteLine("{0} ContainsActiveDocument ={1}", (Items[0] as ManagedContent).Title, ContainsActiveDocument);
Debug.WriteLine(string.Format("{0} ContainsActiveDocument ={1}", (Items[0] as ManagedContent).Title, ContainsActiveDocument));
}
@ -297,28 +297,41 @@ namespace AvalonDock @@ -297,28 +297,41 @@ namespace AvalonDock
public DocumentPane CreateNewHorizontalTabGroup()
{
ManagedContent activeContent = SelectedItem as ManagedContent;
DocumentPane newContainerPane = new DocumentPane();
var activeContent = SelectedItem as ManagedContent;
var oldContainerPane = activeContent.ContainerPane as DocumentPane;
var newContainerPane = new DocumentPane();
int indexOfDocumentInItsContainer = activeContent.ContainerPane.Items.IndexOf(activeContent);
activeContent.ContainerPane.RemoveContent(indexOfDocumentInItsContainer);
oldContainerPane.RemoveContent(activeContent);
newContainerPane.Items.Add(activeContent);
GetManager().Anchor(newContainerPane, this, AnchorStyle.Bottom);
activeContent.Activate();
newContainerPane.RefreshContainsActiveContentProperty();
newContainerPane.RefreshContainsActiveDocumentProperty();
oldContainerPane.RefreshContainsActiveContentProperty();
oldContainerPane.RefreshContainsActiveDocumentProperty();
return newContainerPane;
}
public DocumentPane CreateNewVerticalTabGroup()
{
ManagedContent activeContent = SelectedItem as ManagedContent;
DocumentPane newContainerPane = new DocumentPane();
var activeContent = SelectedItem as ManagedContent;
var oldContainerPane = activeContent.ContainerPane as DocumentPane;
var newContainerPane = new DocumentPane();
int indexOfDocumentInItsContainer = activeContent.ContainerPane.Items.IndexOf(activeContent);
activeContent.ContainerPane.RemoveContent(indexOfDocumentInItsContainer);
oldContainerPane.RemoveContent(activeContent);
newContainerPane.Items.Add(activeContent);
GetManager().Anchor(newContainerPane, this, AnchorStyle.Right);
activeContent.Activate();
newContainerPane.RefreshContainsActiveContentProperty();
newContainerPane.RefreshContainsActiveDocumentProperty();
oldContainerPane.RefreshContainsActiveContentProperty();
oldContainerPane.RefreshContainsActiveDocumentProperty();
return newContainerPane;
}
@ -349,7 +362,26 @@ namespace AvalonDock @@ -349,7 +362,26 @@ namespace AvalonDock
ContextMenu cxMenuDocuments = (ContextMenu)TryFindResource("DocumentsListMenu");
if (cxMenuDocuments != null)
{
cxMenuDocuments.ItemsSource = Items.OfType<ManagedContent>().OrderBy(c => c.Title);
//cxMenuDocuments.ItemsSource = Items.OfType<ManagedContent>().OrderBy(c => c.Title);
cxMenuDocuments.Items.Clear();
Items.OfType<ManagedContent>().OrderBy(c => c.Title).ForEach(
c =>
{
cxMenuDocuments.Items.Add(new MenuItem()
{
Header = c.Title,
Command = ManagedContentCommands.Activate,
CommandTarget = c,
Icon = new Image()
{
Source = c.Icon,
Width = 16,
#if NET4
UseLayoutRounding = true
#endif
}
});
});
//cxMenuDocuments.CommandBindings.Add(new CommandBinding(ActivateDocumentCommand, new ExecutedRoutedEventHandler(this.ExecutedActivateDocumentCommand), new CanExecuteRoutedEventHandler(CanExecuteActivateDocumentCommand)));
if (_optionsContextMenuPlacementTarget != null)
@ -521,5 +553,15 @@ namespace AvalonDock @@ -521,5 +553,15 @@ namespace AvalonDock
base.OnSelectionChanged(e);
}
public override bool OpenOptionsMenu(UIElement menuTarget)
{
if (cxOptions == null)
{
cxOptions = TryFindResource(new ComponentResourceKey(typeof(DockingManager), ContextMenuElement.DocumentPane)) as ContextMenu;
}
return base.OpenOptionsMenu(menuTarget);
}
}
}

30
src/Libraries/AvalonDock/AvalonDock/DocumentTabPanel.cs

@ -58,7 +58,6 @@ namespace AvalonDock @@ -58,7 +58,6 @@ namespace AvalonDock
public static readonly DependencyProperty IsHeaderVisibleProperty =
DependencyProperty.RegisterAttached("IsHeaderVisible", typeof(bool), typeof(DocumentTabPanel), new UIPropertyMetadata(false));
protected override Size MeasureOverride(Size availableSize)
{
Size desideredSize = new Size();
@ -66,18 +65,14 @@ namespace AvalonDock @@ -66,18 +65,14 @@ namespace AvalonDock
foreach (ManagedContent child in Children)
{
Panel.SetZIndex(child, Selector.GetIsSelected(child)?1:-i);
Panel.SetZIndex(child, Selector.GetIsSelected(child) ? 1 : -i);
i++;
//child.Width = double.NaN;
//child.Height = double.NaN;
child.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
desideredSize.Width += child.DesiredSize.Width;
desideredSize.Height = Math.Max(desideredSize.Height, child.DesiredSize.Height);
}
return new Size(Math.Min(desideredSize.Width, availableSize.Width), desideredSize.Height);
//return base.MeasureOverride(availableSize);
//return desideredSize;
}
protected override Size ArrangeOverride(Size finalSize)
@ -104,28 +99,5 @@ namespace AvalonDock @@ -104,28 +99,5 @@ namespace AvalonDock
}
//#region Padding
///// <summary>
///// Padding Dependency Property
///// </summary>
//public static readonly DependencyProperty PaddingProperty =
// DependencyProperty.Register("Padding", typeof(Thickness), typeof(DocumentTabPanel),
// new FrameworkPropertyMetadata((Thickness)new Thickness(),
// FrameworkPropertyMetadataOptions.AffectsMeasure));
///// <summary>
///// Gets or sets the Padding property. This dependency property
///// indicates internal padding of the panel.
///// </summary>
//public Thickness Padding
//{
// get { return (Thickness)GetValue(PaddingProperty); }
// set { SetValue(PaddingProperty, value); }
//}
//#endregion
}
}

18
src/Libraries/AvalonDock/AvalonDock/FloatingDockablePane.cs

@ -29,6 +29,7 @@ using System.Text; @@ -29,6 +29,7 @@ using System.Text;
using System.Windows;
using System.Linq;
using System.Windows.Data;
using System.Windows.Media;
namespace AvalonDock
{
@ -40,7 +41,6 @@ namespace AvalonDock @@ -40,7 +41,6 @@ namespace AvalonDock
//by design avoid style change
Pane.ShowHeaderProperty.OverrideMetadata(typeof(FloatingDockablePane), new FrameworkPropertyMetadata(false));
}
@ -106,6 +106,8 @@ namespace AvalonDock @@ -106,6 +106,8 @@ namespace AvalonDock
AttachStyleFromPane(_paneToTransfer);
ApplyTemplate();
LayoutTransform = (MatrixTransform)_paneToTransfer.TansformToAncestor();
}
else if (_contentToTransfer != null)
{
@ -131,10 +133,7 @@ namespace AvalonDock @@ -131,10 +133,7 @@ namespace AvalonDock
SelectedIndex = 0;
//if (_previousPane is DockablePane)
//{
// Style = _previousPane.Style;
//}
AttachStyleFromPane(_previousPane as DockablePane);
DocumentPane originalDocumentPane = _previousPane as DocumentPane;
@ -143,6 +142,7 @@ namespace AvalonDock @@ -143,6 +142,7 @@ namespace AvalonDock
_contentToTransfer.SetStateToDockableWindow();
LayoutTransform = (MatrixTransform)_contentToTransfer.TansformToAncestor();
}
base.OnInitialized(e);
@ -153,11 +153,11 @@ namespace AvalonDock @@ -153,11 +153,11 @@ namespace AvalonDock
if (copyFromPane == null)
return;
Binding bnd = new Binding("Style");
bnd.Source = copyFromPane;
bnd.Mode = BindingMode.OneWay;
//Binding bnd = new Binding("Style");
//bnd.Source = copyFromPane;
//bnd.Mode = BindingMode.OneWay;
SetBinding(StyleProperty, bnd);
//SetBinding(StyleProperty, bnd);
}
DockablePane _paneToTransfer = null;

57
src/Libraries/AvalonDock/AvalonDock/FloatingDocumentPane.cs

@ -4,6 +4,7 @@ using System.Linq; @@ -4,6 +4,7 @@ using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Data;
using System.Windows.Media;
namespace AvalonDock
{
@ -38,27 +39,49 @@ namespace AvalonDock @@ -38,27 +39,49 @@ namespace AvalonDock
protected override void OnInitialized(EventArgs e)
{
//setup window size
_floatingWindow.Width = _documentToTransfer.ContainerPane.ActualWidth;
_floatingWindow.Height = _documentToTransfer.ContainerPane.ActualHeight;
//save current content position in container pane
_previousPane = _documentToTransfer.ContainerPane as DocumentPane;
_arrayIndexPreviousPane = _previousPane.Items.IndexOf(_documentToTransfer);
SetValue(ResizingPanel.ResizeWidthProperty, _previousPane.GetValue(ResizingPanel.ResizeWidthProperty));
SetValue(ResizingPanel.ResizeHeightProperty, _previousPane.GetValue(ResizingPanel.ResizeHeightProperty));
//Style = _previousPane.Style;
AttachStyleFromPane(_previousPane);
if (_documentToTransfer != null && _documentToTransfer.FloatingWindowSize.IsEmpty)
{
if (_previousPane != null)
_documentToTransfer.FloatingWindowSize = new Size(_previousPane.ActualWidth, _previousPane.ActualHeight);
else
_documentToTransfer.FloatingWindowSize = new Size(400.0, 400.0);
}
if (_documentToTransfer != null && !_documentToTransfer.FloatingWindowSize.IsEmpty)
{
_floatingWindow.Width = _documentToTransfer.FloatingWindowSize.Width;
_floatingWindow.Height = _documentToTransfer.FloatingWindowSize.Height;
}
if (_previousPane != null)
{
//setup window size
_floatingWindow.Width = _documentToTransfer.ContainerPane.ActualWidth;
_floatingWindow.Height = _documentToTransfer.ContainerPane.ActualHeight;
//save current content position in container pane
_arrayIndexPreviousPane = _previousPane.Items.IndexOf(_documentToTransfer);
SetValue(ResizingPanel.ResizeWidthProperty, _previousPane.GetValue(ResizingPanel.ResizeWidthProperty));
SetValue(ResizingPanel.ResizeHeightProperty, _previousPane.GetValue(ResizingPanel.ResizeHeightProperty));
//remove content from container pane
_previousPane.RemoveContent(_arrayIndexPreviousPane);
//Style = _previousPane.Style;
AttachStyleFromPane(_previousPane);
//remove content from container pane
_previousPane.RemoveContent(_arrayIndexPreviousPane);
}
//add content to my temporary pane
Items.Add(_documentToTransfer);
_documentToTransfer.SetIsFloating(true);
LayoutTransform = (MatrixTransform)_documentToTransfer.TansformToAncestor();
base.OnInitialized(e);
}
@ -67,11 +90,11 @@ namespace AvalonDock @@ -67,11 +90,11 @@ namespace AvalonDock
if (copyFromPane == null)
return;
Binding bnd = new Binding("Style");
bnd.Source = copyFromPane;
bnd.Mode = BindingMode.OneWay;
//Binding bnd = new Binding("Style");
//bnd.Source = copyFromPane;
//bnd.Mode = BindingMode.OneWay;
SetBinding(StyleProperty, bnd);
//SetBinding(StyleProperty, bnd);
}
protected override void OnUnloaded(object sender, RoutedEventArgs e)

4
src/Libraries/AvalonDock/AvalonDock/FloatingWindow.cs

@ -608,8 +608,8 @@ namespace AvalonDock @@ -608,8 +608,8 @@ namespace AvalonDock
{
if (cnt.Manager == null ||
cnt.Manager != Manager ||
(!cnt.Manager.DockableContents.Contains(cnt) &&
!cnt.Manager.Documents.Contains(cnt)))
(!cnt.Manager.DockableContents.Contains(cnt as DockableContent) &&
!cnt.Manager.Documents.Contains(cnt as DocumentContent)))
cnt.ContainerPane.RemoveContent(cnt);
});
}

8
src/Libraries/AvalonDock/AvalonDock/FlyoutDockablePane.cs

@ -53,8 +53,8 @@ namespace AvalonDock @@ -53,8 +53,8 @@ namespace AvalonDock
_arrayIndexPreviousPane = _referencedPane.Items.IndexOf(content);
Anchor = _referencedPane.Anchor;
SetValue(ResizingPanel.ResizeWidthProperty, new GridLength(ResizingPanel.GetEffectiveSize(_referencedPane).Width));
SetValue(ResizingPanel.ResizeHeightProperty, new GridLength(ResizingPanel.GetEffectiveSize(_referencedPane).Height));
//SetValue(ResizingPanel.ResizeWidthProperty, new GridLength(ResizingPanel.GetEffectiveSize(_referencedPane).Width));
//SetValue(ResizingPanel.ResizeHeightProperty, new GridLength(ResizingPanel.GetEffectiveSize(_referencedPane).Height));
this.Style = _referencedPane.Style;
@ -78,8 +78,8 @@ namespace AvalonDock @@ -78,8 +78,8 @@ namespace AvalonDock
if (this.Items.Count == 1)
{
_referencedPane.Items.Insert(_arrayIndexPreviousPane, RemoveContent(0));
ResizingPanel.SetResizeWidth(_referencedPane, ResizingPanel.GetResizeWidth(this));
ResizingPanel.SetResizeHeight(_referencedPane, ResizingPanel.GetResizeHeight(this));
//ResizingPanel.SetResizeWidth(_referencedPane, ResizingPanel.GetResizeWidth(this));
//ResizingPanel.SetResizeHeight(_referencedPane, ResizingPanel.GetResizeHeight(this));
}
}

227
src/Libraries/AvalonDock/AvalonDock/FlyoutPaneWindow.cs

@ -147,6 +147,7 @@ namespace AvalonDock @@ -147,6 +147,7 @@ namespace AvalonDock
IsResizing = true;
ShowResizerOverlayWindow(s as Resizer);
Debug.WriteLine(string.Format("resizer.DragStarted() Rect->{0}", new Rect(Left, Top, Width, Height)));
};
if (resizer != null) resizer.DragDelta += (s, e) =>
@ -175,6 +176,9 @@ namespace AvalonDock @@ -175,6 +176,9 @@ namespace AvalonDock
break;
}
Debug.WriteLine(string.Format("resizer.DragDelta() Rect->{0}", new Rect(Left, Top, Width, Height)));
};
if (resizer != null) resizer.DragCompleted += (s, e) =>
@ -216,14 +220,33 @@ namespace AvalonDock @@ -216,14 +220,33 @@ namespace AvalonDock
}
IsResizing = false;
SaveFlyoutSizeToContent();
HideResizerOverlayWindow();
};
Debug.WriteLine(string.Format("resizer.DragCompleted() Rect->{0}", new Rect(Left, Top, Width, Height)));
};
base.OnApplyTemplate();
}
void SaveFlyoutSizeToContent()
{
if (ReferencedPane.ActualWidth > 0.0 &&
ReferencedPane.ActualHeight > 0.0)
{
var flyoutContent = ReferencedPane.SelectedItem as DockableContent;
if (Anchor == AnchorStyle.Left ||
Anchor == AnchorStyle.Right)
flyoutContent.FlyoutWindowSize =
new Size(ReferencedPane.ActualWidth, flyoutContent.FlyoutWindowSize.Height <= 0 ? ReferencedPane.ActualHeight : flyoutContent.FlyoutWindowSize.Height);
else
flyoutContent.FlyoutWindowSize =
new Size(flyoutContent.FlyoutWindowSize.Width <= 0 ? ReferencedPane.ActualWidth : flyoutContent.FlyoutWindowSize.Width, ReferencedPane.ActualHeight);
Debug.WriteLine(string.Format("Save flyout size for content '{0}' -> {1}", flyoutContent.Name, flyoutContent.FlyoutWindowSize));
}
}
/// <summary>
/// Handles the closed event
@ -240,6 +263,7 @@ namespace AvalonDock @@ -240,6 +263,7 @@ namespace AvalonDock
IsClosed = true;
}
/// <summary>
/// Gets a value indicating i fthis window is closed
/// </summary>
@ -402,136 +426,6 @@ namespace AvalonDock @@ -402,136 +426,6 @@ namespace AvalonDock
}
}
//void ShowResizerPopup()
//{
// _resizerPopup = new Window()
// {
// AllowsTransparency = true,
// Background = Brushes.Transparent,
// ShowActivated = false,
// ShowInTaskbar = false,
// ResizeMode = System.Windows.ResizeMode.NoResize,
// WindowStyle = System.Windows.WindowStyle.None,
// Owner = this
// };
// Debug.WriteLine(string.Format("{0}-{1} {2}-{3}",
// Left,
// Top,
// Width,
// Height));
// Canvas resizerCanvas = new Canvas() { Width = MaxWidth, Height = MaxHeight, Background = null};
// Border resizer = new Border() { Background = new SolidColorBrush(Colors.DarkGray), Opacity = 0.1 };
// switch (CorrectedAnchor)
// {
// case AnchorStyle.Left:
// {
// _resizerPopup.Left = Left;
// _resizerPopup.Top = Top;
// _resizerPopup.Width = MaxWidth;
// _resizerPopup.Height = MaxHeight;
// resizer.Width = 4;
// resizer.Height = MaxHeight;
// resizer.Cursor = Cursors.SizeWE;
// Canvas.SetLeft(resizer, Width - resizer.Width);
// Canvas.SetTop(resizer, 0.0);
// }
// break;
// case AnchorStyle.Right:
// {
// _resizerPopup.Left = Left - MaxWidth + Width;
// _resizerPopup.Top = Top;
// _resizerPopup.Width = MaxWidth;
// _resizerPopup.Height = MaxHeight;
// resizer.Width = 4;
// resizer.Height = MaxHeight;
// resizer.Cursor = Cursors.SizeWE;
// Canvas.SetLeft(resizer, MaxWidth - Width);
// Canvas.SetTop(resizer, 0.0);
// }
// break;
// case AnchorStyle.Top:
// {
// _resizerPopup.Left = Left;
// _resizerPopup.Top = Top;
// _resizerPopup.Width = MaxWidth;
// _resizerPopup.Height = MaxHeight;
// resizer.Width = MaxWidth;
// resizer.Height = 4;
// resizer.Cursor = Cursors.SizeNS;
// Canvas.SetLeft(resizer, 4);
// Canvas.SetTop(resizer, Height - resizer.Height);
// }
// break;
// case AnchorStyle.Bottom:
// {
// _resizerPopup.Left = Left;
// _resizerPopup.Top = Top - MaxHeight + Height;
// _resizerPopup.Width = MaxWidth;
// _resizerPopup.Height = MaxHeight;
// resizer.Width = MaxWidth;
// resizer.Height = 4;
// resizer.Cursor = Cursors.SizeNS;
// Canvas.SetLeft(resizer, 4);
// Canvas.SetTop(resizer, MaxHeight - Height);
// }
// break;
// }
// resizerCanvas.Children.Add(resizer);
// _resizerPopup.Content = resizerCanvas;
// _resizerPopup.Show();
//}
//void HideResizerPopup()
//{
// if (_resizerPopup == null)
// return;
// //_resizerPopup.IsOpen = false;
// _resizerPopup.Close();
// _resizerPopup = null;
//}
//void UpdateResizerPopup()
//{
// if (_resizerPopup == null)
// return;
// switch (CorrectedAnchor)
// {
// case AnchorStyle.Left:
// {
// //_resizerPopup.PlacementRectangle = new Rect(Left, Top, MaxWidth, MaxHeight);
// _resizerPopup.Left = Left;
// _resizerPopup.Top = Top;
// _resizerPopup.Width = MaxWidth;
// _resizerPopup.Height = MaxHeight;
// }
// break;
// case AnchorStyle.Right:
// {
// //_resizerPopup.PlacementRectangle = new Rect(Left - MaxWidth + Width, Top, MaxWidth, MaxHeight);
// }
// break;
// }
//}
/// <summary>
/// Gets a value indicating if user is resizer the window
/// </summary>
@ -544,15 +438,6 @@ namespace AvalonDock @@ -544,15 +438,6 @@ namespace AvalonDock
DispatcherTimer _closingTimer = null;
///// <summary>
///// Start the closing timer
///// </summary>
//void StartClosingTimer()
//{
// //if (_closingTimer != null)
// // _closingTimer.Start();
//}
/// <summary>
/// Creates the closing timer
/// </summary>
@ -581,15 +466,6 @@ namespace AvalonDock @@ -581,15 +466,6 @@ namespace AvalonDock
}
}
///// <summary>
///// Stop the closing timer
///// </summary>
//void StopClosingTimer()
//{
// //if (_closingTimer != null)
// // _closingTimer.Stop();
//}
/// <summary>
/// This handler is called when the closing time delay is elapsed (user is focusing to something else of the UI)
/// </summary>
@ -639,55 +515,6 @@ namespace AvalonDock @@ -639,55 +515,6 @@ namespace AvalonDock
}
//protected override void OnMouseLeave(MouseEventArgs e)
//{
// base.OnMouseLeave(e);
// if (!IsFocused && !IsKeyboardFocusWithin && !ReferencedPane.IsOptionsMenuOpen)
// StartClosingTimer();
//}
//protected override void OnMouseMove(MouseEventArgs e)
//{
// base.OnMouseMove(e);
// StopClosingTimer();
//}
//protected override void OnLostFocus(RoutedEventArgs e)
//{
// base.OnLostFocus(e);
// if (!IsMouseOver && !ReferencedPane.IsOptionsMenuOpen)
// StartClosingTimer();
//}
//protected override void OnLostKeyboardFocus(KeyboardFocusChangedEventArgs e)
//{
// base.OnLostKeyboardFocus(e);
// if (!IsMouseOver)
// StopClosingTimer();
//}
//protected override void OnGotFocus(RoutedEventArgs e)
//{
// base.OnGotFocus(e);
// StopClosingTimer();
//}
//protected override void OnGotKeyboardFocus(KeyboardFocusChangedEventArgs e)
//{
// base.OnGotKeyboardFocus(e);
// StopClosingTimer();
//}
//internal void KeepWindowOpen()
//{
// StopClosingTimer();
//}
#endregion
#region Open/Close Flyout window
@ -1003,7 +830,6 @@ namespace AvalonDock @@ -1003,7 +830,6 @@ namespace AvalonDock
}
}
/// <summary>
/// Close the flyout window with or without animation depending on the ShowAnimated flag
/// </summary>
@ -1019,6 +845,7 @@ namespace AvalonDock @@ -1019,6 +845,7 @@ namespace AvalonDock
Close();
}
}
#endregion

31
src/Libraries/AvalonDock/AvalonDock/HelperFunc.cs

@ -54,8 +54,9 @@ namespace AvalonDock @@ -54,8 +54,9 @@ namespace AvalonDock
{
if (FrameworkElement.GetFlowDirection(element) == FlowDirection.RightToLeft)
{
var actualSize = element.TransformedActualSize();
Point leftToRightPoint = new Point(
element.ActualWidth - point.X,
actualSize.Width - point.X,
point.Y);
return element.PointToScreenDPI(leftToRightPoint);
}
@ -190,6 +191,34 @@ namespace AvalonDock @@ -190,6 +191,34 @@ namespace AvalonDock
return PresentationSource.FromVisual(visual) != null;
}
public static Size TransformedActualSize(this FrameworkElement element)
{
if (PresentationSource.FromVisual(element) == null)
return new Size(element.ActualWidth, element.ActualHeight);
var parentWindow = PresentationSource.FromVisual(element).RootVisual;
var transformToWindow = element.TransformToAncestor(parentWindow);
return transformToWindow.TransformBounds(new Rect(0, 0, element.ActualWidth, element.ActualHeight)).Size;
}
public static Size TransformSize(this FrameworkElement element, Size sizeToTransform)
{
if (PresentationSource.FromVisual(element) == null)
return sizeToTransform;
var parentWindow = PresentationSource.FromVisual(element).RootVisual;
var transformToWindow = element.TransformToAncestor(parentWindow);
return transformToWindow.TransformBounds(new Rect(0, 0, sizeToTransform.Width, sizeToTransform.Height)).Size;
}
public static GeneralTransform TansformToAncestor(this FrameworkElement element)
{
if (PresentationSource.FromVisual(element) == null)
return new MatrixTransform(Matrix.Identity);
var parentWindow = PresentationSource.FromVisual(element).RootVisual;
return element.TransformToAncestor(parentWindow);
}
public static void CallMethod(this object o, string methodName, object[] args)
{

19
src/Libraries/AvalonDock/AvalonDock/ImageEx.cs

@ -0,0 +1,19 @@ @@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;
using System.Windows;
namespace AvalonDock
{
public class ImageEx : Image
{
static ImageEx()
{
#if NET4
UseLayoutRoundingProperty.OverrideMetadata(typeof(ImageEx), new FrameworkPropertyMetadata(true));
#endif
}
}
}

148
src/Libraries/AvalonDock/AvalonDock/ManagedContent.cs

@ -101,8 +101,8 @@ namespace AvalonDock @@ -101,8 +101,8 @@ namespace AvalonDock
// return contentHost;
//}
void ManagedContent_SizeChanged(object sender, SizeChangedEventArgs e)
{
//void ManagedContent_SizeChanged(object sender, SizeChangedEventArgs e)
//{
//WindowsFormsHost contentHost = GetWinFormsHost();
//if (contentHost != null)
@ -114,7 +114,7 @@ namespace AvalonDock @@ -114,7 +114,7 @@ namespace AvalonDock
// this.Dispatcher.Invoke(new Action<object>((o) => o.CallMethod("Refresh", null)), DispatcherPriority.Render, childCtrl);
// }
//}
}
//}
protected virtual void OnContentLoaded()
{
@ -265,6 +265,24 @@ namespace AvalonDock @@ -265,6 +265,24 @@ namespace AvalonDock
if (_dragEnabledArea != null)
_dragEnabledArea.InputBindings.Add(new InputBinding(ManagedContentCommands.Close, new MouseGesture(MouseAction.MiddleClick)));
if (_dragEnabledArea != null && _dragEnabledArea.ContextMenu == null)
{
_dragEnabledArea.MouseRightButtonDown += (s, e) =>
{
if (!e.Handled)
{
Activate();
if (_dragEnabledArea.ContextMenu == null)
{
Dispatcher.BeginInvoke(DispatcherPriority.Input, new ThreadStart(delegate
{
ContainerPane.OpenOptionsMenu(null);
}));
}
e.Handled = true;
}
};
}
}
#region Mouse management
@ -294,6 +312,7 @@ namespace AvalonDock @@ -294,6 +312,7 @@ namespace AvalonDock
protected virtual void OnDragMouseDown(object sender, MouseButtonEventArgs e)
{
Debug.WriteLine("OnDragMouseDown" + e.ClickCount);
if (!e.Handled && Manager != null)// && State != DockableContentState.AutoHide)
{
isMouseDown = true;
@ -308,17 +327,18 @@ namespace AvalonDock @@ -308,17 +327,18 @@ namespace AvalonDock
protected virtual void OnDragMouseUp(object sender, MouseButtonEventArgs e)
{
isMouseDown = false;
Debug.WriteLine("OnDragMouseUp" + e.ClickCount);
}
Point ptRelativePosition;
protected virtual void OnDragMouseLeave(object sender, MouseEventArgs e)
{
if (!e.Handled && e.LeftButton == MouseButtonState.Pressed && Manager != null)
if (!e.Handled && isMouseDown && e.LeftButton == MouseButtonState.Pressed && Manager != null)
{
if (!IsMouseCaptured)
{
//Point ptMouseMove = e.GetPosition(this);
Point ptMouseMove = e.GetPosition((IInputElement)System.Windows.Media.VisualTreeHelper.GetParent(this));
ManagedContent contentToSwap = null;
if (ContainerPane != null)
@ -337,7 +357,8 @@ namespace AvalonDock @@ -337,7 +357,8 @@ namespace AvalonDock
}
}
if (contentToSwap != null)
if (contentToSwap != null &&
contentToSwap != this)
{
Pane containerPane = ContainerPane;
int myIndex = containerPane.Items.IndexOf(this);
@ -352,8 +373,9 @@ namespace AvalonDock @@ -352,8 +373,9 @@ namespace AvalonDock
containerPane.Items.Insert(myIndex, contentToSwap);
containerPane.SelectedItem = this;
e.Handled = false;
//avoid ismouseDown = false call
return;
}
else if (Math.Abs(ptMouseMove.X - StartDragPoint.X) > SystemParameters.MinimumHorizontalDragDistance ||
@ -367,8 +389,8 @@ namespace AvalonDock @@ -367,8 +389,8 @@ namespace AvalonDock
}
}
}
isMouseDown = false;
ResetIsMouseDownFlag();
}
@ -579,52 +601,77 @@ namespace AvalonDock @@ -579,52 +601,77 @@ namespace AvalonDock
{
if (IsActiveContent && !IsKeyboardFocused)
{
Dispatcher.BeginInvoke(DispatcherPriority.Input, new ThreadStart(delegate
#region Focus on winforms content
if (this.Content is WindowsFormsHost)
{
if (IsActiveContent && !IsKeyboardFocused)
{
if (this.Content is WindowsFormsHost)
//Use reflection in order to remove WinForms assembly reference
//WindowsFormsHost contentHost = this.Content as WindowsFormsHost;
//object childCtrl = contentHost.GetType().GetProperty("Child").GetValue(contentHost, null);
//if (childCtrl != null)
//{
// if (!childCtrl.GetPropertyValue<bool>("Focused"))
// {
// childCtrl.CallMethod("Focus", null);
// }
//}
//Dispatcher.BeginInvoke(DispatcherPriority.Background, new ThreadStart(delegate
// {
// if (IsActiveContent && !IsKeyboardFocused)
// {
// if (this.Content is WindowsFormsHost)
// {
// //Use reflection in order to remove WinForms assembly reference
// WindowsFormsHost contentHost = this.Content as WindowsFormsHost;
// object childCtrl = contentHost.GetType().GetProperty("Child").GetValue(contentHost, null);
// if (childCtrl != null)
// {
// if (!childCtrl.GetPropertyValue<bool>("Focused"))
// {
// childCtrl.CallMethod("Focus", null);
// }
// }
// }
// }
// }));
}
#endregion
Dispatcher.BeginInvoke(DispatcherPriority.Input, new ThreadStart(delegate
{
//Use reflection in order to remove WinForms assembly reference
WindowsFormsHost contentHost = this.Content as WindowsFormsHost;
if (IsActiveContent && !IsKeyboardFocused)
{
if (DefaultElement != null)
{
Debug.WriteLine("Try to set kb focus to " + DefaultElement);
object childCtrl = contentHost.GetType().GetProperty("Child").GetValue(contentHost, null);
IInputElement kbFocused = Keyboard.Focus(DefaultElement);
if (childCtrl != null)
{
if (!childCtrl.GetPropertyValue<bool>("Focused"))
if (kbFocused != null)
Debug.WriteLine("Focused element " + kbFocused);
else
Debug.WriteLine("No focused element");
}
else if (Content is UIElement && Content is DependencyObject)
{
childCtrl.CallMethod("Focus", null);
Debug.WriteLine("Try to set kb focus to " + this.Content.ToString());
(Content as UIElement).Focus();
IInputElement kbFocused = Keyboard.Focus(this.Content as IInputElement);
if (kbFocused != null)
Debug.WriteLine("Focused element " + kbFocused);
else
Debug.WriteLine("No focused element");
}
}
}
else if (DefaultElement != null)
{
Debug.WriteLine("Try to set kb focus to " + DefaultElement);
IInputElement kbFocused = Keyboard.Focus(DefaultElement);
if (kbFocused != null)
Debug.WriteLine("Focused element " + kbFocused);
else
Debug.WriteLine("No focused element");
}));
}
else if (this.Content is IInputElement)
{
Debug.WriteLine("Try to set kb focus to " + this.Content.ToString());
IInputElement kbFocused = Keyboard.Focus(this.Content as IInputElement);
if (kbFocused != null)
Debug.WriteLine("Focused element " + kbFocused);
else
Debug.WriteLine("No focused element");
}
}
}));
}
}
/// <summary>
@ -690,7 +737,7 @@ namespace AvalonDock @@ -690,7 +737,7 @@ namespace AvalonDock
parentDocumentPane.RefreshContainsActiveDocumentProperty();
}
Debug.WriteLine("{0}-{1}-{2}", IsFocused, IsKeyboardFocused, IsKeyboardFocusWithin);
//Debug.WriteLine("{0}-{1}-{2}", IsFocused, IsKeyboardFocused, IsKeyboardFocusWithin);
//for backward compatibility
RaisePropertyChanged("IsActiveDocumentChanged");
@ -764,6 +811,7 @@ namespace AvalonDock @@ -764,6 +811,7 @@ namespace AvalonDock
#endregion
#region INotifyPropertyChanged Members
public event PropertyChangedEventHandler PropertyChanged;
@ -930,7 +978,9 @@ namespace AvalonDock @@ -930,7 +978,9 @@ namespace AvalonDock
if (ContainerPane != null && Manager != null)// && Manager.ActiveContent != this)
{
ContainerPane.SelectedItem = this;
ContainerPane.Focus();
FocusContent();
if (Manager != null)
Manager.ActiveContent = this;
}
@ -957,5 +1007,7 @@ namespace AvalonDock @@ -957,5 +1007,7 @@ namespace AvalonDock
}
#endregion
}
}

222
src/Libraries/AvalonDock/AvalonDock/NavigatorWindow.cs

@ -134,7 +134,7 @@ namespace AvalonDock @@ -134,7 +134,7 @@ namespace AvalonDock
/// </summary>
/// <remarks>This window allow user to rapidly select a <see cref="DockableContent"/> object or a <see cref="DocumentContent"/> object.
/// When selected a content is also activate with the function <see cref="ManagedContent.Activate"/></remarks>
public class NavigatorWindow : AvalonDockWindow
public class NavigatorWindow : AvalonDockWindow, INotifyPropertyChanged
{
#region Constructors
static NavigatorWindow()
@ -191,33 +191,66 @@ namespace AvalonDock @@ -191,33 +191,66 @@ namespace AvalonDock
#endregion
#region Handlers for Tab+ctrl keys events
protected override void OnPreviewKeyDown(KeyEventArgs e)
internal bool HandleKey(Key key)
{
if (e.Key != Key.Tab)
Hide();
else
if (key == Key.Tab)
{
e.Handled = true;
MoveNextSelectedContent();
MoveToNextContent();
return true;
}
base.OnKeyDown(e);
}
protected override void OnPreviewKeyUp(KeyEventArgs e)
{
if (e.Key != Key.Tab)
else if (key == Key.Down)
{
var docSelected = (Documents.CurrentItem as NavigatorWindowDocumentItem).ItemContent as DocumentContent;
docSelected.Activate();
Hide();
MoveToNextContent(true);
return true;
}
else
else if (key == Key.Up)
{
MoveToPreviousContent(true);
return true;
}
else if (key == Key.Left || key == Key.Right)
{
e.Handled = true;
MoveToOtherList();
return true;
}
base.OnPreviewKeyUp(e);
return false;
}
//protected override void OnPreviewKeyDown(KeyEventArgs e)
//{
// if (e.Key == Key.Tab)
// {
// e.Handled = true;
// MoveToNextContent();
// }
// else
// Hide();
// base.OnKeyDown(e);
//}
//protected override void OnPreviewKeyUp(KeyEventArgs e)
//{
// if (e.Key == Key.Tab)
// {
// e.Handled = true;
// }
// else
// {
// var docSelected = (Documents.CurrentItem as NavigatorWindowDocumentItem).ItemContent as DocumentContent;
// docSelected.Activate();
// Hide();
// }
// base.OnPreviewKeyUp(e);
//}
internal static bool IsKeyHandled(Key key)
{
return key == Key.Tab || key == Key.Down ||
key == Key.Up || key == Key.Left || key == Key.Right;
}
#endregion
@ -232,9 +265,15 @@ namespace AvalonDock @@ -232,9 +265,15 @@ namespace AvalonDock
void DockableContents_CurrentChanged(object sender, EventArgs e)
{
if (!_documentsSelected)
SelectedContent = DockableContents.CurrentItem as NavigatorWindowItem;
if (DockableContents.CurrentItem == null)
return;
if (_intMoveFlag)
return;
Debug.WriteLine(string.Format("DockContent current changed to {0}", (DockableContents.CurrentItem as NavigatorWindowItem).ItemContent.Title));
var dockCntSelected = (DockableContents.CurrentItem as NavigatorWindowItem).ItemContent as DockableContent;
Hide();
@ -243,6 +282,9 @@ namespace AvalonDock @@ -243,6 +282,9 @@ namespace AvalonDock
void Documents_CurrentChanged(object sender, EventArgs e)
{
if (_documentsSelected)
SelectedContent = Documents.CurrentItem as NavigatorWindowItem;
if (Documents.CurrentItem == null)
return;
if (_intMoveFlag)
@ -253,7 +295,36 @@ namespace AvalonDock @@ -253,7 +295,36 @@ namespace AvalonDock
var docSelected = (Documents.CurrentItem as NavigatorWindowDocumentItem).ItemContent as DocumentContent;
docSelected.Activate();
Hide();
}
}
#region SelectedContent
private NavigatorWindowItem _selectedContent = null;
public NavigatorWindowItem SelectedContent
{
get { return _selectedContent; }
set
{
if (_selectedContent != value)
{
NavigatorWindowItem oldValue = _selectedContent;
_selectedContent = value;
OnSelectedContentChanged(oldValue, value);
RaisePropertyChanged("SelectedContent");
}
}
}
/// <summary>
/// Provides derived classes an opportunity to handle changes to the SelectedContent property.
/// </summary>
protected virtual void OnSelectedContentChanged(NavigatorWindowItem oldValue, NavigatorWindowItem newValue)
{
}
#endregion
#endregion
#region Documents
@ -324,15 +395,114 @@ namespace AvalonDock @@ -324,15 +395,114 @@ namespace AvalonDock
#region Move to Next document
bool _intMoveFlag = false;
public void MoveNextSelectedContent()
bool _documentsSelected = true;
public void MoveToNextContent(bool moveToNextList = false)
{
_intMoveFlag = true;
if (!Documents.MoveCurrentToNext())
Documents.MoveCurrentToFirst();
if (Documents.IsCurrentAfterLast)
Documents.MoveCurrentToFirst();
if (_documentsSelected)
{
if (!Documents.MoveCurrentToNext())
{
if (moveToNextList)
{
_documentsSelected = false;
DockableContents.MoveCurrentToFirst();
}
else
Documents.MoveCurrentToFirst();
}
}
else
{
if (!DockableContents.MoveCurrentToNext())
{
if (moveToNextList)
{
_documentsSelected = true;
Documents.MoveCurrentToFirst();
}
else
DockableContents.MoveCurrentToFirst();
}
}
_intMoveFlag = false;
}
public void MoveToPreviousContent(bool moveToNextList = false)
{
_intMoveFlag = true;
if (_documentsSelected)
{
if (!Documents.MoveCurrentToPrevious())
{
if (moveToNextList)
{
_documentsSelected = false;
DockableContents.MoveCurrentToLast();
}
else
Documents.MoveCurrentToLast();
}
}
else
{
if (!DockableContents.MoveCurrentToPrevious())
{
if (moveToNextList)
{
_documentsSelected = true;
Documents.MoveCurrentToLast();
}
else
DockableContents.MoveCurrentToLast();
}
}
_intMoveFlag = false;
}
public void MoveToOtherList()
{
_intMoveFlag = true;
if (_documentsSelected)
{
_documentsSelected = false;
int currentPos = Documents.CurrentPosition;
if (currentPos <= 0)
DockableContents.MoveCurrentToFirst();
else if (currentPos >= DockableContents.Count)
DockableContents.MoveCurrentToLast();
else
DockableContents.MoveCurrentToPosition(currentPos);
Documents.MoveCurrentTo(null);
}
else
{
_documentsSelected = true;
int currentPos = DockableContents.CurrentPosition;
if (currentPos <= 0)
Documents.MoveCurrentToFirst();
else if (currentPos >= Documents.Count)
Documents.MoveCurrentToLast();
else
Documents.MoveCurrentToPosition(currentPos);
DockableContents.MoveCurrentTo(null);
}
_intMoveFlag = false;
}
#endregion
#region INotifyPropertyChanged Members
public event PropertyChangedEventHandler PropertyChanged;
protected void RaisePropertyChanged(string propertyName)
{
if (PropertyChanged != null)
PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
#endregion
}
}

155
src/Libraries/AvalonDock/AvalonDock/Pane.cs

@ -31,6 +31,9 @@ using System.Diagnostics; @@ -31,6 +31,9 @@ using System.Diagnostics;
using System.ComponentModel;
using System.Collections;
using System.Linq;
using System.Windows.Controls.Primitives;
using System.Threading;
using System.Windows.Threading;
namespace AvalonDock
{
@ -93,6 +96,7 @@ namespace AvalonDock @@ -93,6 +96,7 @@ namespace AvalonDock
base.OnSelectionChanged(e);
}
protected override void OnItemsChanged(System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
{
DockingManager dockManager = GetManager();
@ -116,6 +120,9 @@ namespace AvalonDock @@ -116,6 +120,9 @@ namespace AvalonDock
SelectedItem = _lastSelectedContent;
}
//let base class handle SelectedIndex/Item value
base.OnItemsChanged(e);
if (Items.Count > 0)
{
int currentIndex = SelectedIndex;
@ -140,7 +147,7 @@ namespace AvalonDock @@ -140,7 +147,7 @@ namespace AvalonDock
}
}
base.OnItemsChanged(e);
}
protected override void OnVisualParentChanged(DependencyObject oldParent)
@ -161,32 +168,6 @@ namespace AvalonDock @@ -161,32 +168,6 @@ namespace AvalonDock
}
}
//void RefreshContentsSelectedProperty()
//{
// //foreach (ManagedContent mc in Items)
// //{
// // //mc.IsSelected = (mc == SelectedItem);
// // //Selector.SetIsSelected(mc
// // if (Selector.GetIsSelected(mc))
// // mc.FocusContent();
// //}
//}
//protected override void OnPropertyChanged(DependencyPropertyChangedEventArgs e)
//{
// if (e.Property == SelectedItemProperty)
// RefreshContentsSelectedProperty();
// // SetValue(ActiveContentProperty, SelectedItem);
// //if (e.Property == ActiveContentProperty)
// //{
// // //SetValue(SelectedItemProperty, ActiveContent);
// //}
// base.OnPropertyChanged(e);
//}
#endregion
#region IDockableControl Members
@ -264,7 +245,7 @@ namespace AvalonDock @@ -264,7 +245,7 @@ namespace AvalonDock
Items.Cast<ManagedContent>().FirstOrDefault(d => d.IsActiveContent) != null);
if (Items.Count> 0)
Debug.WriteLine("{0} ContainsActiveContent ={1}", (Items[0] as ManagedContent).Title, ContainsActiveContent);
Debug.WriteLine(string.Format("{0} ContainsActiveContent ={1}", (Items[0] as ManagedContent).Title, ContainsActiveContent));
}
#endregion
@ -318,7 +299,8 @@ namespace AvalonDock @@ -318,7 +299,8 @@ namespace AvalonDock
if (PresentationSource.FromVisual(this) == null)
return new Rect();
return new Rect(HelperFunc.PointToScreenWithoutFlowDirection(this, new Point()), new Size(ActualWidth, ActualHeight));
var actualSize = this.TransformedActualSize();
return new Rect(HelperFunc.PointToScreenWithoutFlowDirection(this, new Point()), new Size(actualSize.Width, actualSize.Height));
}
}
Rect IDropSurface.SurfaceRectangle
@ -399,7 +381,7 @@ namespace AvalonDock @@ -399,7 +381,7 @@ namespace AvalonDock
}
}
Debug.WriteLine("Pane.OnCanExecuteCommand({0}) = {1} (ContinueRouting={2})", e.Command, e.CanExecute, e.ContinueRouting);
Debug.WriteLine(string.Format("Pane.OnCanExecuteCommand({0}) = {1} (ContinueRouting={2})", e.Command, e.CanExecute, e.ContinueRouting));
}
/// <summary>
@ -455,7 +437,120 @@ namespace AvalonDock @@ -455,7 +437,120 @@ namespace AvalonDock
public static readonly DependencyProperty ShowHeaderProperty =
DependencyProperty.Register("ShowHeader", typeof(bool), typeof(Pane), new UIPropertyMetadata(true));
/// <summary>
/// Move focus to pane content and activate it
/// </summary>
protected void FocusContent()
{
ManagedContent selectedContent = SelectedItem as ManagedContent;
if (selectedContent != null)// && selectedContent.Content is UIElement)
{
//UIElement internalContent = selectedContent.Content as UIElement;
//bool res = Focus();
//Keyboard.Focus(internalContent);
selectedContent.Activate();
}
}
#region OptionsContextMenu
protected ContextMenu cxOptions = null;
ContextMenu _attachedCxOptions = null;
/// <summary>
/// Open the option context menu
/// </summary>
/// <param name="menuTarget">Target element under which context menu will be shown. Pass null if context menu
/// should be shown at mouse position.</param>
/// <returns>True if context menu resource was found and open, false otherwise.</returns>
public virtual bool OpenOptionsMenu(UIElement menuTarget)
{
if (_attachedCxOptions != cxOptions)
{
if (_attachedCxOptions != null)
{
cxOptions.Opened -= (s, e) => UpdateIsOptionsMenuOpen();
cxOptions.Closed -= (s, e) => UpdateIsOptionsMenuOpen();
}
_attachedCxOptions = cxOptions;
if (_attachedCxOptions != null)
{
cxOptions.Opened += (s, e) => UpdateIsOptionsMenuOpen();
cxOptions.Closed += (s, e) => UpdateIsOptionsMenuOpen();
}
}
if (cxOptions != null)
{
//FocusContent();
}
if (cxOptions != null)
{
cxOptions.DataContext = this.SelectedItem;
foreach (MenuItem menuItem in cxOptions.Items.OfType<MenuItem>())
menuItem.CommandTarget = this.SelectedItem as IInputElement;
if (menuTarget != null)
{
cxOptions.Placement = PlacementMode.Bottom;
cxOptions.PlacementTarget = menuTarget;
}
else
{
cxOptions.Placement = PlacementMode.MousePoint;
cxOptions.PlacementTarget = this;
}
cxOptions.IsOpen = true;
}
return (cxOptions != null && cxOptions.IsOpen);
}
/// <summary>
/// Close the options context menu
/// </summary>
public virtual void CloseOptionsMenu()
{
if (cxOptions != null)
{
cxOptions.IsOpen = false;
cxOptions = null;
}
}
/// <summary>
/// Gets a value indicating if the options context menu is open
/// </summary>
public bool IsOptionsMenuOpen
{
get { return (bool)GetValue(IsOptionsMenuOpenProperty); }
protected set { SetValue(IsOptionsMenuOpenPropertyKey, value); }
}
// Using a DependencyProperty as the backing store for IsOptionsMenuOpen. This enables animation, styling, binding, etc...
static readonly DependencyPropertyKey IsOptionsMenuOpenPropertyKey =
DependencyProperty.RegisterReadOnly("IsOptionsMenuOpen", typeof(bool), typeof(DockablePane), new UIPropertyMetadata(false));
public static readonly DependencyProperty IsOptionsMenuOpenProperty = IsOptionsMenuOpenPropertyKey.DependencyProperty;
void UpdateIsOptionsMenuOpen()
{
if (cxOptions != null)
{
var selectedContent = cxOptions.DataContext as DockableContent;
if (selectedContent != null && selectedContent.ContainerPane != null)
{
(selectedContent.ContainerPane as Pane).IsOptionsMenuOpen =
cxOptions.IsOpen;
}
}
}
#endregion
#region INotifyPropertyChanged Members

10
src/Libraries/AvalonDock/AvalonDock/PaneTabPanel.cs

@ -42,13 +42,6 @@ namespace AvalonDock @@ -42,13 +42,6 @@ namespace AvalonDock
{
public abstract class PaneTabPanel : Panel
{
//static PaneTabPanel()
//{
// //This OverrideMetadata call tells the system that this element wants to provide a style that is different than its base class.
// //This style is defined in themes\generic.xaml
// DefaultStyleKeyProperty.OverrideMetadata(typeof(PaneTabPanel), new FrameworkPropertyMetadata(typeof(PaneTabPanel)));
//}
protected override void OnVisualChildrenChanged(DependencyObject visualAdded, DependencyObject visualRemoved)
{
base.OnVisualChildrenChanged(visualAdded, visualRemoved);
@ -62,8 +55,7 @@ namespace AvalonDock @@ -62,8 +55,7 @@ namespace AvalonDock
}
internal PaneTabPanel()
{

4
src/Libraries/AvalonDock/AvalonDock/Properties/AssemblyInfo.cs

@ -51,5 +51,5 @@ using System.Windows; @@ -51,5 +51,5 @@ using System.Windows;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.3.3391")]
[assembly: AssemblyFileVersion("1.3.3391")]
[assembly: AssemblyVersion("1.3.3571")]
[assembly: AssemblyFileVersion("1.3.3571")]

20
src/Libraries/AvalonDock/AvalonDock/Properties/Settings.Designer.cs generated

@ -8,21 +8,17 @@ @@ -8,21 +8,17 @@
// </auto-generated>
//------------------------------------------------------------------------------
namespace AvalonDock.Properties
{
namespace AvalonDock.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
public static Settings Default {
get {
return defaultInstance;
}
}

37
src/Libraries/AvalonDock/AvalonDock/ResizingPanel.cs

@ -879,13 +879,21 @@ namespace AvalonDock @@ -879,13 +879,21 @@ namespace AvalonDock
{
Resizer splitter = sender as Resizer;
//Point draggedPoint = this.PointToScreenDPI(
// new Point(e.HorizontalChange, e.VerticalChange));
Window wnd = Window.GetWindow(this);
var trToWnd = TransformToAncestor(wnd);
Vector transformedDelta = trToWnd.Transform(new Point(e.HorizontalChange, e.VerticalChange)) -
trToWnd.Transform(new Point());
if (Orientation == System.Windows.Controls.Orientation.Horizontal)
{
Canvas.SetLeft(_resizerGhost, _initialStartPoint.X + e.HorizontalChange);
Canvas.SetLeft(_resizerGhost, _initialStartPoint.X + transformedDelta.X);
}
else
{
Canvas.SetTop(_resizerGhost, _initialStartPoint.Y + e.VerticalChange);
Canvas.SetTop(_resizerGhost, _initialStartPoint.Y + transformedDelta.Y);
}
@ -1163,7 +1171,11 @@ namespace AvalonDock @@ -1163,7 +1171,11 @@ namespace AvalonDock
visibleChildren.RemoveAt(visibleChildren.Count - 1);
Size[] currentSizes = new Size[visibleChildren.Count];
double delta = Orientation == Orientation.Horizontal ? e.HorizontalChange : e.VerticalChange;
Window wnd = Window.GetWindow(this);
var trToWnd = TransformToAncestor(wnd).Inverse;
Vector transformedDelta = trToWnd.Transform(new Point(e.HorizontalChange, e.VerticalChange)) -
trToWnd.Transform(new Point());
double delta = Orientation == Orientation.Horizontal ? transformedDelta.X : transformedDelta.Y;
if (_childrenFinalSizes == null)
return;
@ -1352,7 +1364,7 @@ namespace AvalonDock @@ -1352,7 +1364,7 @@ namespace AvalonDock
void ShowResizerOverlayWindow(Resizer splitter)
{
Point ptTopLeftScreen = this.PointToScreen(new Point());
Point ptTopLeftScreen = this.PointToScreenDPI(new Point());
_resizerGhost = new Border()
{
@ -1360,18 +1372,20 @@ namespace AvalonDock @@ -1360,18 +1372,20 @@ namespace AvalonDock
Opacity = 0.7
};
Size actualSize = this.TransformedActualSize();
if (Orientation == System.Windows.Controls.Orientation.Horizontal)
{
_resizerGhost.Width = 5.0;
_resizerGhost.Height = ActualHeight;
_resizerGhost.Height = actualSize.Height;
}
else
{
_resizerGhost.Height = 5.0;
_resizerGhost.Width = ActualWidth;
_resizerGhost.Width = actualSize.Width;
}
_initialStartPoint = splitter.PointToScreen(new Point()) - this.PointToScreen(new Point());
_initialStartPoint = splitter.PointToScreenDPI(new Point()) - this.PointToScreenDPI(new Point());
if (Orientation == System.Windows.Controls.Orientation.Horizontal)
{
@ -1389,7 +1403,8 @@ namespace AvalonDock @@ -1389,7 +1403,8 @@ namespace AvalonDock
};
panelHostResizer.Children.Add(_resizerGhost);
_resizerWindowHost = new Window()
{
ResizeMode = ResizeMode.NoResize,
@ -1397,13 +1412,15 @@ namespace AvalonDock @@ -1397,13 +1412,15 @@ namespace AvalonDock
ShowInTaskbar = false,
AllowsTransparency = true,
Background = null,
Width = ActualWidth,
Height = ActualHeight,
Width = actualSize.Width,
Height = actualSize.Height,
Left = ptTopLeftScreen.X,
Top = ptTopLeftScreen.Y,
ShowActivated = false,
Owner = Window.GetWindow(this),
Content = panelHostResizer
//,
//LayoutTransform = (MatrixTransform)this.TansformToAncestor()
};
_resizerWindowHost.Show();

7
src/Libraries/AvalonDock/AvalonDock/Resources/Common.xaml

@ -83,6 +83,9 @@ @@ -83,6 +83,9 @@
Value="1"/>
</Trigger>
</Style.Triggers>
</Style>
</Style>
</ResourceDictionary>

8
src/Libraries/AvalonDock/AvalonDock/Resources/DockablePaneStyles.xaml

@ -52,7 +52,7 @@ @@ -52,7 +52,7 @@
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Image x:Name="Icon" Width="16" Source="{TemplateBinding Icon}" UseLayoutRounding="True"/>
<ad:ImageEx x:Name="Icon" Width="16" Source="{TemplateBinding Icon}"/>
<TextBlock
x:Name="tabItemTitle"
Grid.Column="1"
@ -136,17 +136,17 @@ @@ -136,17 +136,17 @@
<DockPanel LastChildFill="True">
<Button DockPanel.Dock="Right" Width="15" Height="15" Style="{StaticResource PaneHeaderCommandStyle}" Command="ad:DockablePaneCommands.Close" Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=SelectedItem.IsCloseable, Converter={x:Static ad:Converters.BoolToVisibilityConverter}}" ToolTip="{x:Static adRes:Resources.DockablePaneCommands_Close}">
<!--<ad:AlignedImage>-->
<Image Source="Images\PinClose.png" Width="13" UseLayoutRounding="True"/>
<ad:ImageEx Source="Images\PinClose.png" Width="13" />
<!--</ad:AlignedImage>-->
</Button>
<Button x:Name="btnPinAutoHide" DockPanel.Dock="Right" Width="15" Height="15" Style="{StaticResource PaneHeaderCommandStyle}" Command="ad:DockablePaneCommands.ToggleAutoHide" ToolTip="{x:Static adRes:Resources.DockablePaneCommands_ToggleAutoHide}">
<!--<ad:AlignedImage>-->
<Image Source="Images\PinAutoHide.png" Width="13" UseLayoutRounding="True"/>
<ad:ImageEx Source="Images\PinAutoHide.png" Width="13" />
<!--</ad:AlignedImage>-->
</Button>
<Border x:Name="PART_ShowContextMenuButton" DockPanel.Dock="Right" Width="15" Height="15" Style="{StaticResource PaneHeaderContextMenuCommandStyle}" ToolTip="{x:Static adRes:Resources.DockablePane_ShowOptionsMenu}">
<!--<ad:AlignedImage>-->
<Image Source="Images\PinMenu.png" Width="13" UseLayoutRounding="True"/>
<ad:ImageEx Source="Images\PinMenu.png" Width="13" />
<!--</ad:AlignedImage>-->
</Border>
<TextBlock

2
src/Libraries/AvalonDock/AvalonDock/Resources/DockingManagerStyles.xaml

@ -19,7 +19,7 @@ @@ -19,7 +19,7 @@
BorderBrush="{StaticResource ManagedContentTabControlNormalBorderBrush}"
Background="{StaticResource ManagedContentTabItemNormalBackground}">
<StackPanel Orientation="Horizontal">
<Image x:Name="borderIcon" Width="16" Source="{TemplateBinding Icon}" UseLayoutRounding="True"/>
<ad:ImageEx x:Name="borderIcon" Width="16" Source="{TemplateBinding Icon}" />
<TextBlock
Text="{TemplateBinding Title}"
Foreground="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}"

43
src/Libraries/AvalonDock/AvalonDock/Resources/DocumentPaneStyles.xaml

@ -9,22 +9,23 @@ @@ -9,22 +9,23 @@
</ResourceDictionary.MergedDictionaries>
<ContextMenu x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type ad:DockingManager}, ResourceId={x:Static ad:ContextMenuElement.DocumentPane}}">
<MenuItem Command="ad:DocumentPaneCommands.CloseThis" />
<MenuItem Command="ad:DocumentPaneCommands.CloseAllButThis" />
<MenuItem Command="ad:DocumentPaneCommands.CloseThis" />
<MenuItem Command="ad:DocumentPaneCommands.CloseAllButThis" />
<Separator/>
<MenuItem Command="ad:DocumentPaneCommands.NewHorizontalTabGroup">
<MenuItem.Icon>
<Image Source="/AvalonDock;component/resources/Images/HTabGroup.png" Width="13" Height="14" UseLayoutRounding="True"/>
<ad:ImageEx Source="/AvalonDock;component/resources/Images/HTabGroup.png" Width="13" Height="14"/>
</MenuItem.Icon>
</MenuItem>
<MenuItem
Command="ad:DocumentPaneCommands.NewVerticalTabGroup">
Command="ad:DocumentPaneCommands.NewVerticalTabGroup" >
<MenuItem.Icon>
<Image Source="/AvalonDock;component/resources/Images/VTabGroup.png" Width="13" UseLayoutRounding="True" />
<ad:ImageEx Source="/AvalonDock;component/resources/Images/VTabGroup.png" Width="13"/>
</MenuItem.Icon>
</MenuItem>
</ContextMenu>
<!--ContextMenu="{DynamicResource {ComponentResourceKey {x:Type ad:DockingManager}, {x:Static ad:ContextMenuElement.DocumentPane}}}"-->
<!--DocumentTabItemStyle-->
<Style x:Key="DocumentTabItemStyle" TargetType="{x:Type ad:ManagedContent}">
@ -38,9 +39,7 @@ @@ -38,9 +39,7 @@
x:Name="PART_DragArea"
BorderBrush="{StaticResource ManagedContentTabControlNormalBorderBrush}"
Margin="0,0,-10,0"
SnapsToDevicePixels="True"
ContextMenu="{DynamicResource {ComponentResourceKey {x:Type ad:DockingManager}, {x:Static ad:ContextMenuElement.DocumentPane}}}"
>
SnapsToDevicePixels="True">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="20"/>
@ -72,12 +71,12 @@ @@ -72,12 +71,12 @@
x:Name="tabItemTitle"
TextTrimming="CharacterEllipsis"
TextWrapping="NoWrap"
Text="{TemplateBinding Title}"
Text="{Binding Title, RelativeSource={RelativeSource TemplatedParent}}"
Margin="5,0,4,0"
Foreground="{DynamicResource {ComponentResourceKey {x:Type ad:DockingManager}, {x:Static ad:AvalonDockBrushes.DocumentHeaderForeground}}}"/>
<ad:AlignedImage x:Name="PART_LockedIcon" Margin="2,0,0,0" Visibility="Collapsed" VerticalAlignment="Center" HorizontalAlignment="Center">
<Image Source="/AvalonDock;component/resources/Images/Locked.png" Width="6" Height="8" Stretch="Uniform"/>
</ad:AlignedImage>
<!--<ad:AlignedImage x:Name="PART_LockedIcon" Margin="2,0,0,0" Visibility="Collapsed" VerticalAlignment="Center" HorizontalAlignment="Center">-->
<ad:ImageEx x:Name="PART_LockedIcon" Margin="2,0,0,0" Visibility="Collapsed" Source="/AvalonDock;component/resources/Images/Locked.png" Width="6" />
<!--</ad:AlignedImage>-->
</StackPanel>
</Border>
</Grid>
@ -128,12 +127,20 @@ @@ -128,12 +127,20 @@
<!--DocumentPane MenuItem Style-->
<Style x:Key="DocumentPaneMenuItemStyle" TargetType="{x:Type MenuItem}">
<!--Setting MenuItem.Icon in style doesn't work even in .NET 4
http://connect.microsoft.com/VisualStudio/feedback/details/497408/wpf-menuitem-icon-cannot-be-set-via-setter#
-->
<!--<Style x:Key="DocumentPaneMenuItemStyle" TargetType="{x:Type MenuItem}">
<Setter Property="MenuItem.CommandTarget" Value="{Binding}"/>
<Setter Property="MenuItem.Command" Value="{x:Static ad:ManagedContentCommands.Activate}"/>
<Setter Property="MenuItem.Header" Value="{Binding Path=Title}"/>
<Setter Property="MenuItem.Icon" Value="{Binding Icon, Converter={x:Static ad:Converters.ObjectToImageConverter}}"/>
</Style>
<Setter Property="MenuItem.Icon">
<Setter.Value>
<Image Source="{Binding Icon,Converter={x:Static ad:Converters.ObjectToImageConverter}}" Style="{StaticResource DefaultAvalonDockImageStyle}"/>
</Setter.Value>
</Setter>
</Style>-->
<!--DocumentPane-->
<Style x:Key="{x:Type ad:DocumentPane}" TargetType="{x:Type ad:DocumentPane}">
@ -143,7 +150,7 @@ @@ -143,7 +150,7 @@
<Setter.Value>
<ControlTemplate TargetType="{x:Type ad:DocumentPane}" >
<ControlTemplate.Resources>
<ContextMenu x:Key="DocumentsListMenu" StaysOpen="True" ItemContainerStyle="{StaticResource DocumentPaneMenuItemStyle}"/>
<ContextMenu x:Key="DocumentsListMenu" StaysOpen="True" />
</ControlTemplate.Resources>
<Border
Focusable="False"
@ -176,10 +183,10 @@ @@ -176,10 +183,10 @@
<Button DockPanel.Dock="Right" Width="18" Height="18" Style="{StaticResource PaneHeaderCommandStyle}"
Command="ad:ManagedContentCommands.Close"
CommandTarget="{TemplateBinding SelectedItem}">
<Image Source="Images\PinClose.png" Width="13" UseLayoutRounding="True"/>
<ad:ImageEx Source="Images\PinClose.png" Width="13" />
</Button>
<Button x:Name="PART_ShowContextMenuButton" DockPanel.Dock="Right" Width="18" Height="18" Style="{StaticResource PaneHeaderCommandStyle}">
<Image x:Name="ShowContextMenuIcon" Source="Images\PinMenu.png" Width="13" UseLayoutRounding="True"/>
<ad:ImageEx x:Name="ShowContextMenuIcon" Source="Images\PinMenu.png" Width="13"/>
</Button>
<ad:DocumentTabPanel
x:Name="paneTabsPanel"

12
src/Libraries/AvalonDock/AvalonDock/Resources/FloatingWindowStyle.xaml

@ -76,32 +76,32 @@ @@ -76,32 +76,32 @@
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<ContentPresenter Name="INT_pane" Grid.Column="1" Grid.Row="1"/>
<ad:Resizer x:Name="PART_Resizer" Grid.Column="2" Grid.Row="1"
<ad:Resizer x:Name="PART_Resizer"
Background="Transparent"/>
</Grid>
<ControlTemplate.Triggers>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Anchor}" Value="Right">
<Setter Property="Grid.Row" Value="1" TargetName="PART_Resizer"/>
<Setter Property="Grid.Column" Value="0" TargetName="PART_Resizer"/>
<Setter Property="Width" Value="4" TargetName="PART_Resizer"/>
<Setter Property="Width" Value="5" TargetName="PART_Resizer"/>
<Setter Property="Cursor" Value="SizeWE" TargetName="PART_Resizer"/>
</DataTrigger>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Anchor}" Value="Left">
<Setter Property="Grid.Row" Value="1" TargetName="PART_Resizer"/>
<Setter Property="Grid.Column" Value="2" TargetName="PART_Resizer"/>
<Setter Property="Width" Value="4" TargetName="PART_Resizer"/>
<Setter Property="Width" Value="5" TargetName="PART_Resizer"/>
<Setter Property="Cursor" Value="SizeWE" TargetName="PART_Resizer"/>
</DataTrigger>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Anchor}" Value="Bottom">
<Setter Property="Grid.Column" Value="1" TargetName="PART_Resizer"/>
<Setter Property="Grid.Row" Value="0" TargetName="PART_Resizer"/>
<Setter Property="Height" Value="4" TargetName="PART_Resizer"/>
<Setter Property="Height" Value="5" TargetName="PART_Resizer"/>
<Setter Property="Cursor" Value="SizeNS" TargetName="PART_Resizer"/>
</DataTrigger>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Anchor}" Value="Top">
<Setter Property="Grid.Row" Value="2" TargetName="PART_Resizer"/>
<Setter Property="Grid.Column" Value="1" TargetName="PART_Resizer"/>
<Setter Property="Height" Value="4" TargetName="PART_Resizer"/>
<Setter Property="Grid.Row" Value="2" TargetName="PART_Resizer"/>
<Setter Property="Height" Value="5" TargetName="PART_Resizer"/>
<Setter Property="Cursor" Value="SizeNS" TargetName="PART_Resizer"/>
</DataTrigger>
</ControlTemplate.Triggers>

26
src/Libraries/AvalonDock/AvalonDock/Resources/NavigatorWindowStyle.xaml

@ -33,8 +33,7 @@ @@ -33,8 +33,7 @@
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<!--<Image Source="{Binding Icon, Converter={x:Static ad:Converters.ObjectToImageConverter}}" Width="16" UseLayoutRounding="True"/>-->
<Image Source="{Binding Icon}" UseLayoutRounding="True" Width="16"/>
<ad:ImageEx Source="{Binding Icon}" Width="16"/>
<TextBlock Text="{Binding Title}" TextTrimming="CharacterEllipsis" Margin="4,0,0,0" TextWrapping="NoWrap" Grid.Column="1"/>
</Grid>
</Border>
@ -47,8 +46,7 @@ @@ -47,8 +46,7 @@
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<!--<Image Source="{Binding Icon, Converter={x:Static ad:Converters.ObjectToImageConverter}}" Width="16" UseLayoutRounding="True"/>-->
<Image Source="{Binding Icon}" UseLayoutRounding="True" Width="16"/>
<ad:ImageEx Source="{Binding Icon}" Width="16"/>
<TextBlock Text="{Binding Title}" TextTrimming="CharacterEllipsis" Margin="4,0,0,0" TextWrapping="NoWrap" Grid.Column="1"/>
</Grid>
</Border>
@ -82,13 +80,17 @@ @@ -82,13 +80,17 @@
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Visibility" Value="Visible" TargetName="intMouseOverBorder"/>
</Trigger>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Visibility" Value="Visible" TargetName="intMouseOverBorder"/>
<Setter Property="Opacity" Value="1.0" TargetName="intSelectedItemBorder"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="NavigatorWindowDocumentsListItemContainerStyle" TargetType="ListBoxItem">
<!--<Style x:Key="NavigatorWindowDocumentsListItemContainerStyle" TargetType="ListBoxItem">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListBoxItem">
@ -123,7 +125,7 @@ @@ -123,7 +125,7 @@
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Style>-->
<Style x:Key="NavigatorWindowContentsListStyle" TargetType="ListBox">
<Setter Property="ItemTemplate" Value="{StaticResource NavigatorWindowContentsListItemTemplate}"/>
@ -134,8 +136,8 @@ @@ -134,8 +136,8 @@
</Style>
<Style x:Key="NavigatorWindowDocumentsListStyle" TargetType="ListBox">
<Setter Property="ItemTemplate" Value="{StaticResource NavigatorWindowDocumentsListItemTemplate}"/>
<Setter Property="ItemContainerStyle" Value="{StaticResource NavigatorWindowDocumentsListItemContainerStyle}"/>
<Setter Property="ItemTemplate" Value="{StaticResource NavigatorWindowContentsListItemTemplate}"/>
<Setter Property="ItemContainerStyle" Value="{StaticResource NavigatorWindowContentsListItemContainerStyle}"/>
<Setter Property="Background" Value="{x:Null}"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Disabled"/>
@ -174,10 +176,10 @@ @@ -174,10 +176,10 @@
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Image UseLayoutRounding="True" Source="{Binding Path=SelectedItem.Icon, ElementName=activeFileList}" Width="16"/>
<TextBlock x:Name="titleSelectedDocument" Grid.Column="1" Text="{Binding Path=SelectedItem.Title, ElementName=activeFileList}" FontSize="14" FontWeight="Bold" VerticalAlignment="Center" Margin="4,0,0,0" TextTrimming="CharacterEllipsis"/>
<ad:ImageEx Source="{Binding Path=SelectedContent.Icon, RelativeSource={RelativeSource TemplatedParent}}" Width="16"/>
<TextBlock x:Name="titleSelectedDocument" Grid.Column="1" Text="{Binding Path=SelectedContent.Title, RelativeSource={RelativeSource TemplatedParent}}" FontSize="14" FontWeight="Bold" VerticalAlignment="Center" Margin="4,0,0,0" TextTrimming="CharacterEllipsis"/>
</Grid>
<TextBlock Grid.Row="1" Text="{Binding Path=SelectedItem.ContentTypeDescription, ElementName=activeFileList}" VerticalAlignment="Center" TextTrimming="CharacterEllipsis"/>
<TextBlock Grid.Row="1" Text="{Binding Path=SelectedContent.ContentTypeDescription, RelativeSource={RelativeSource TemplatedParent}, FallbackValue=''}" VerticalAlignment="Center" TextTrimming="CharacterEllipsis"/>
</Grid>
</Border>
<Border Grid.Row="1" Background="{StaticResource NavigatorWindowContentsBackground}">
@ -218,7 +220,7 @@ @@ -218,7 +220,7 @@
</Border>
<Border Grid.Row="2" Margin="5">
<TextBlock Text="{Binding Path=SelectedItem.ItemContent.InfoTip, ElementName=activeFileList}" VerticalAlignment="Center" TextTrimming="CharacterEllipsis"/>
<TextBlock Text="{Binding Path=SelectedContent.ItemContent.InfoTip, RelativeSource={RelativeSource TemplatedParent}, FallbackValue=''}" VerticalAlignment="Center" TextTrimming="CharacterEllipsis"/>
</Border>
</Grid>
</Border>

30
src/Libraries/AvalonDock/AvalonDock/Resources/OverlayWindowStyle.xaml

@ -14,18 +14,18 @@ @@ -14,18 +14,18 @@
<Border x:Name="PART_SelectionBox" Background="{DynamicResource {x:Static SystemColors.ActiveCaptionBrushKey}}" BorderBrush="Gray" BorderThickness="3" Opacity="0.2" Visibility="Hidden"/>
</Canvas>
<Grid x:Name="panelDrag" >
<ad:AlignedImage x:Name="PART_btnDockLeft" VerticalAlignment="Center" HorizontalAlignment="Left">
<Image Source="Images\DockLeft.PNG" Stretch="None"/>
</ad:AlignedImage>
<ad:AlignedImage x:Name="PART_btnDockRight" VerticalAlignment="Center" HorizontalAlignment="Right">
<Image Source="Images\DockRight.PNG" Stretch="None" />
</ad:AlignedImage>
<ad:AlignedImage x:Name="PART_btnDockBottom" VerticalAlignment="Bottom" HorizontalAlignment="Center">
<Image Source="Images\DockBottom.PNG" Stretch="None" />
</ad:AlignedImage>
<ad:AlignedImage x:Name="PART_btnDockTop" VerticalAlignment="Top" HorizontalAlignment="Center">
<Image Source="Images\DockTop.PNG" Stretch="None"/>
</ad:AlignedImage>
<!--<ad:AlignedImage >-->
<ad:ImageEx x:Name="PART_btnDockLeft" VerticalAlignment="Center" HorizontalAlignment="Left" Source="Images\DockLeft.PNG" Stretch="None" />
<!--</ad:AlignedImage>-->
<!--<ad:AlignedImage >-->
<ad:ImageEx x:Name="PART_btnDockRight" VerticalAlignment="Center" HorizontalAlignment="Right" Source="Images\DockRight.PNG" Stretch="None" />
<!--</ad:AlignedImage>-->
<!--<ad:AlignedImage >-->
<ad:ImageEx x:Name="PART_btnDockBottom" VerticalAlignment="Bottom" HorizontalAlignment="Center" Source="Images\DockBottom.PNG" Stretch="None" />
<!--</ad:AlignedImage>-->
<!--<ad:AlignedImage >-->
<ad:ImageEx x:Name="PART_btnDockTop" VerticalAlignment="Top" HorizontalAlignment="Center" Source="Images\DockTop.PNG" Stretch="None"/>
<!--</ad:AlignedImage>-->
</Grid>
<Canvas>
<Grid Name="PART_gridPaneRelativeDockingOptions" Visibility="Collapsed">
@ -40,9 +40,9 @@ @@ -40,9 +40,9 @@
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<ad:AlignedImage Grid.ColumnSpan="3" Grid.RowSpan="3" >
<Image Source="Images\DockPane.png" Stretch="Uniform"/>
</ad:AlignedImage>
<!--<ad:AlignedImage >-->
<Image Grid.ColumnSpan="3" Grid.RowSpan="3" Source="Images\DockPane.png" Stretch="Uniform"/>
<!--</ad:AlignedImage>-->
<Border Name="PART_btnDockPaneTop" Grid.Column="1" Grid.Row="0"/>
<Border Name="PART_btnDockPaneRight" Grid.Column="2" Grid.Row="1"/>
<Border Name="PART_btnDockPaneBottom" Grid.Column="1" Grid.Row="2"/>

6
src/Libraries/AvalonDock/AvalonDock/Resources/SpecFrameworkStyles.xaml

@ -0,0 +1,6 @@ @@ -0,0 +1,6 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style x:Key="DefaultAvalonDockImageStyle" TargetType="Image">
<Setter Property="UseLayoutRounding" Value="True"/>
</Style>
</ResourceDictionary>

6
src/Libraries/AvalonDock/AvalonDock/Resources/SpecNET40Styles.xaml

@ -0,0 +1,6 @@ @@ -0,0 +1,6 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style x:Key="DefaultAvalonDockImageStyle" TargetType="Image">
<Setter Property="UseLayoutRounding" Value="True"/>
</Style>
</ResourceDictionary>

123
src/Libraries/AvalonDock/AvalonDock/Themes/aero.normalcolor.xaml

@ -31,13 +31,12 @@ @@ -31,13 +31,12 @@
Background="{StaticResource ManagedContentTabItemNormalBackground}"
Padding="1"
>
<!--<StackPanel Orientation="Horizontal" Margin="4,0,4,0">-->
<Grid Margin="4,0,4,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Image x:Name="Icon" Width="16" Source="{TemplateBinding Icon}" UseLayoutRounding="True"/>
<ad:ImageEx x:Name="Icon" Width="16" Source="{TemplateBinding Icon}" />
<TextBlock
x:Name="tabItemTitle"
Grid.Column="1"
@ -46,7 +45,6 @@ @@ -46,7 +45,6 @@
Margin="2,0,0,0" VerticalAlignment="Center"
Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
</Grid>
<!--</StackPanel>-->
</Border>
</Grid>
@ -124,18 +122,18 @@ @@ -124,18 +122,18 @@
<Button DockPanel.Dock="Right" Style="{StaticResource PaneHeaderCommandStyle}" Command="ad:ManagedContentCommands.Close" CommandTarget="{TemplateBinding SelectedItem}"
ToolTip="{x:Static adRes:Resources.DockablePaneCommands_Close}"
Width="15" Height="15" Margin="2,0,2,0" VerticalAlignment="Center">
<Image Source="/AvalonDock;component/resources/Images/PinClose.png" Width="13" UseLayoutRounding="True"/>
<ad:ImageEx Source="/AvalonDock;component/resources/Images/PinClose.png" Width="13" />
</Button>
<Button x:Name="btnPinAutoHide" DockPanel.Dock="Right" Style="{StaticResource PaneHeaderCommandStyle}"
ToolTip="{x:Static adRes:Resources.DockablePaneCommands_ToggleAutoHide}"
Command="ad:DockablePaneCommands.ToggleAutoHide"
Width="15" Height="15" VerticalAlignment="Center">
<Image Source="/AvalonDock;component/resources/Images/PinAutoHide.png" Width="13" UseLayoutRounding="True"/>
<ad:ImageEx Source="/AvalonDock;component/resources/Images/PinAutoHide.png" Width="13" />
</Button>
<Border x:Name="PART_ShowContextMenuButton" DockPanel.Dock="Right" Style="{StaticResource PaneHeaderContextMenuCommandStyle}"
ToolTip="{x:Static adRes:Resources.DockablePane_ShowOptionsMenu}"
Width="15" Height="15" VerticalAlignment="Center"> <!--Command="ad:DockablePaneCommands.ShowOptionsCommand"-->
<Image Source="/AvalonDock;component/resources/Images/PinMenu.png" Width="13" UseLayoutRounding="True"/>
<ad:ImageEx Source="/AvalonDock;component/resources/Images/PinMenu.png" Width="13" />
</Border>
<TextBlock
Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=SelectedItem.Title}"
@ -147,13 +145,13 @@ @@ -147,13 +145,13 @@
</DockPanel>
</Border>
<Border Grid.Row="1"
x:Name="intContentBorder"
BorderThickness="1,0,1,1"
BorderBrush="DarkGray"
Background="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=SelectedItem.Background}"
>
<ContentPresenter
x:Name="PART_SelectedContent"
Content="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=SelectedItem.Content}"
KeyboardNavigation.TabNavigation="Local"
KeyboardNavigation.DirectionalNavigation="Contained"
@ -185,6 +183,7 @@ @@ -185,6 +183,7 @@
</DataTrigger>
<Trigger Property ="ShowHeader" Value="False">
<Setter Property="Visibility" Value="Collapsed" TargetName="PART_Header"/>
<Setter Property="BorderThickness" Value="0" TargetName="intContentBorder"/>
</Trigger>
<Trigger Property ="ShowTabs" Value="False">
<Setter Property="Visibility" Value="Collapsed" TargetName="PART_Tabs"/>
@ -217,8 +216,7 @@ @@ -217,8 +216,7 @@
x:Name="PART_DragArea"
BorderBrush="{StaticResource ManagedContentTabControlNormalBorderBrush}"
Margin="0,0,-10,0"
SnapsToDevicePixels="True"
ContextMenu="{DynamicResource {ComponentResourceKey {x:Type ad:DockingManager}, {x:Static ad:ContextMenuElement.DocumentPane}}}">
SnapsToDevicePixels="True">
<Grid >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="20"/>
@ -249,12 +247,12 @@ @@ -249,12 +247,12 @@
x:Name="tabItemTitle"
TextTrimming="CharacterEllipsis"
TextWrapping="NoWrap"
Text="{TemplateBinding Title}"
Text="{Binding Title, RelativeSource={RelativeSource TemplatedParent}, StringFormat='{}{0} '}"
Foreground="{DynamicResource {ComponentResourceKey {x:Type ad:DockingManager}, {x:Static ad:AvalonDockBrushes.DocumentHeaderForeground}}}"/>
<!--<ad:AlignedImage x:Name="PART_LockedIcon" Margin="2,0,0,0" Visibility="Collapsed" VerticalAlignment="Center" HorizontalAlignment="Center">
<Image Source="/AvalonDock;component/resources/Images/Locked.png" Width="6" Height="8" Stretch="Uniform"/>
</ad:AlignedImage>-->
<Image x:Name="PART_LockedIcon" Source="/AvalonDock;component/resources/Images/Locked.png" Width="6" UseLayoutRounding="True" Visibility="Collapsed" Margin="2,0,0,0" VerticalAlignment="Center"/>
<ad:ImageEx x:Name="PART_LockedIcon" Source="/AvalonDock;component/resources/Images/Locked.png" Width="6" Visibility="Collapsed" Margin="2,0,0,0" VerticalAlignment="Center"/>
</StackPanel>
</Border>
</Grid>
@ -306,7 +304,7 @@ @@ -306,7 +304,7 @@
<Setter.Value>
<ControlTemplate TargetType="{x:Type ad:DocumentPane}" >
<ControlTemplate.Resources>
<ContextMenu x:Key="DocumentsListMenu" StaysOpen="True" ItemContainerStyle="{StaticResource ResourceKey=DocumentPaneMenuItemStyle}" ></ContextMenu>
<ContextMenu x:Key="DocumentsListMenu" StaysOpen="True" ></ContextMenu>
</ControlTemplate.Resources>
<Border
Focusable="False"
@ -329,7 +327,7 @@ @@ -329,7 +327,7 @@
BorderThickness="2"
BorderBrush="{StaticResource ResourceKey=DocumentHeaderBorder2}"
CornerRadius="3"
Margin="1"
Margin="2,1,2,2"
Focusable="False"
Background="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=SelectedItem.Background}">
<ContentPresenter
@ -350,10 +348,10 @@ @@ -350,10 +348,10 @@
<Button DockPanel.Dock="Right" Width="15" Height="15" Margin="2,0,2,0" Style="{StaticResource PaneHeaderCommandStyle}"
Command="ad:ManagedContentCommands.Close"
CommandTarget="{TemplateBinding SelectedItem}">
<Image Source="/AvalonDock;component/resources/Images/PinClose.png" Width="13" UseLayoutRounding="True"/>
<ad:ImageEx Source="/AvalonDock;component/resources/Images/PinClose.png" Width="13" />
</Button>
<Button x:Name="PART_ShowContextMenuButton" DockPanel.Dock="Right" Width="15" Height="15" Style="{StaticResource PaneHeaderCommandStyle}">
<Image x:Name="ShowContextMenuIcon" Source="/AvalonDock;component/resources/Images/PinMenu.png" Width="13" UseLayoutRounding="True"/>
<ad:ImageEx x:Name="ShowContextMenuIcon" Source="/AvalonDock;component/resources/Images/PinMenu.png" Width="13" />
</Button>
<ad:DocumentTabPanel
x:Name="paneTabsPanel"
@ -411,7 +409,7 @@ @@ -411,7 +409,7 @@
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Image x:Name="Icon" Width="16" Source="{TemplateBinding Icon}" UseLayoutRounding="True" />
<ad:ImageEx x:Name="Icon" Width="16" Source="{TemplateBinding Icon}" />
<TextBlock
Grid.Column="1"
Text="{TemplateBinding Title}"
@ -499,77 +497,78 @@ @@ -499,77 +497,78 @@
<Border x:Name="PART_SelectionBox" Background="{DynamicResource {x:Static SystemColors.ActiveCaptionBrushKey}}" BorderBrush="Gray" BorderThickness="3" Opacity="0.2" Visibility="Hidden"/>
</Canvas>
<Grid x:Name="panelDrag" >
<ad:AlignedImage x:Name="PART_btnDockLeft" VerticalAlignment="Center" HorizontalAlignment="Left">
<Image x:Name="IMG_DockLeft" Source="/AvalonDock;component/resources/Images/Aero/AeroDockLeft.PNG" Stretch="Uniform" Width="32" Height="31"/>
</ad:AlignedImage>
<ad:AlignedImage x:Name="PART_btnDockRight" VerticalAlignment="Center" HorizontalAlignment="Right">
<Image x:Name="IMG_DockRight" Source="/AvalonDock;component/resources/Images/Aero/AeroDockRight.PNG" Stretch="Uniform" Width="32" Height="31"/>
</ad:AlignedImage>
<ad:AlignedImage x:Name="PART_btnDockBottom" VerticalAlignment="Bottom" HorizontalAlignment="Center">
<Image x:Name="IMG_DockBottom" Source="/AvalonDock;component/resources/Images/Aero/AeroDockBottom.PNG" Stretch="Uniform" Width="31" Height="32"/>
</ad:AlignedImage>
<ad:AlignedImage x:Name="PART_btnDockTop" VerticalAlignment="Top" HorizontalAlignment="Center">
<Image x:Name="IMG_DockTop" Source="/AvalonDock;component/resources/Images/Aero/AeroDockTop.PNG" Stretch="Uniform" Width="31" Height="32"/>
</ad:AlignedImage>
<!--<ad:AlignedImage >-->
<ad:ImageEx x:Name="PART_btnDockLeft" VerticalAlignment="Center" HorizontalAlignment="Left" Source="/AvalonDock;component/resources/Images/Aero/AeroDockLeft.PNG" Width="32" />
<!--</ad:AlignedImage>-->
<!--<ad:AlignedImage >-->
<ad:ImageEx x:Name="PART_btnDockRight" VerticalAlignment="Center" HorizontalAlignment="Right" Source="/AvalonDock;component/resources/Images/Aero/AeroDockRight.PNG" Width="32" />
<!--</ad:AlignedImage>-->
<!--<ad:AlignedImage >-->
<ad:ImageEx x:Name="PART_btnDockBottom" VerticalAlignment="Bottom" HorizontalAlignment="Center" Source="/AvalonDock;component/resources/Images/Aero/AeroDockBottom.PNG" Width="31" />
<!--</ad:AlignedImage>-->
<!--<ad:AlignedImage >-->
<ad:ImageEx x:Name="PART_btnDockTop" VerticalAlignment="Top" HorizontalAlignment="Center" Source="/AvalonDock;component/resources/Images/Aero/AeroDockTop.PNG" Width="31" />
<!--</ad:AlignedImage>-->
</Grid>
<Canvas>
<Grid Name="PART_gridPaneRelativeDockingOptions" Visibility="Collapsed">
<Grid Width="103" Height="101" VerticalAlignment="Center" HorizontalAlignment="Center">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<ad:AlignedImage Grid.ColumnSpan="3" Grid.RowSpan="3" >
<Image x:Name="IMG_DockPane" Source="/AvalonDock;component/resources/Images/Aero/AeroDockPane.png" Stretch="Uniform"/>
</ad:AlignedImage>
<Border Name="PART_btnDockPaneTop" Grid.Column="1" Grid.Row="0"/>
<Border Name="PART_btnDockPaneRight" Grid.Column="2" Grid.Row="1"/>
<Border Name="PART_btnDockPaneBottom" Grid.Column="1" Grid.Row="2"/>
<Border Name="PART_btnDockPaneLeft" Grid.Column="0" Grid.Row="1"/>
<Border Name="PART_btnDockPaneInto" Grid.Column="1" Grid.Row="1"/>
</Grid>
<Canvas>
<Grid Name="PART_gridPaneRelativeDockingOptions" Visibility="Collapsed">
<ad:ImageEx x:Name="PART_btnDockPane" VerticalAlignment="Center" HorizontalAlignment="Center" Source="/AvalonDock;component/resources/Images/Aero/AeroDockPane.png" Width="103" Stretch="Uniform" />
<Grid Width="103" Height="101" VerticalAlignment="Center" HorizontalAlignment="Center">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<!--<ad:AlignedImage >-->
<!--</ad:AlignedImage>-->
<Border Name="PART_btnDockPaneTop" Grid.Column="1" Grid.Row="0"/>
<Border Name="PART_btnDockPaneRight" Grid.Column="2" Grid.Row="1"/>
<Border Name="PART_btnDockPaneBottom" Grid.Column="1" Grid.Row="2"/>
<Border Name="PART_btnDockPaneLeft" Grid.Column="0" Grid.Row="1"/>
<Border Name="PART_btnDockPaneInto" Grid.Column="1" Grid.Row="1"/>
</Grid>
</Canvas>
</Grid>
</Grid>
</Canvas>
</Grid>
<ControlTemplate.Triggers>
<DataTrigger Binding="{Binding Path=OverlayButtonHover, RelativeSource={RelativeSource Self}}" Value="DropBorderLeft">
<Setter Property="Source" Value="/AvalonDock;component/resources/Images/Aero/AeroDockLeftHover.PNG" TargetName="IMG_DockLeft"/>
<Setter Property="Source" Value="/AvalonDock;component/resources/Images/Aero/AeroDockLeftHover.PNG" TargetName="PART_btnDockLeft"/>
</DataTrigger>
<DataTrigger Binding="{Binding Path=OverlayButtonHover, RelativeSource={RelativeSource Self}}" Value="DropBorderRight">
<Setter Property="Source" Value="/AvalonDock;component/resources/Images/Aero/AeroDockRightHover.PNG" TargetName="IMG_DockRight"/>
<Setter Property="Source" Value="/AvalonDock;component/resources/Images/Aero/AeroDockRightHover.PNG" TargetName="PART_btnDockRight"/>
</DataTrigger>
<DataTrigger Binding="{Binding Path=OverlayButtonHover, RelativeSource={RelativeSource Self}}" Value="DropBorderTop">
<Setter Property="Source" Value="/AvalonDock;component/resources/Images/Aero/AeroDockTopHover.PNG" TargetName="IMG_DockTop"/>
<Setter Property="Source" Value="/AvalonDock;component/resources/Images/Aero/AeroDockTopHover.PNG" TargetName="PART_btnDockTop"/>
</DataTrigger>
<DataTrigger Binding="{Binding Path=OverlayButtonHover, RelativeSource={RelativeSource Self}}" Value="DropBorderBottom">
<Setter Property="Source" Value="/AvalonDock;component/resources/Images/Aero/AeroDockBottomHover.PNG" TargetName="IMG_DockBottom"/>
<Setter Property="Source" Value="/AvalonDock;component/resources/Images/Aero/AeroDockBottomHover.PNG" TargetName="PART_btnDockBottom"/>
</DataTrigger>
<DataTrigger Binding="{Binding Path=OverlayButtonHover, RelativeSource={RelativeSource Self}}" Value="DropPaneInto">
<Setter Property="Source" Value="/AvalonDock;component/resources/Images/Aero/AeroDockPaneInto.PNG" TargetName="IMG_DockPane"/>
<Setter Property="Source" Value="/AvalonDock;component/resources/Images/Aero/AeroDockPaneInto.PNG" TargetName="PART_btnDockPane"/>
</DataTrigger>
<DataTrigger Binding="{Binding Path=OverlayButtonHover, RelativeSource={RelativeSource Self}}" Value="DropPaneLeft">
<Setter Property="Source" Value="/AvalonDock;component/resources/Images/Aero/AeroDockPaneLeft.PNG" TargetName="IMG_DockPane"/>
<Setter Property="Source" Value="/AvalonDock;component/resources/Images/Aero/AeroDockPaneLeft.PNG" TargetName="PART_btnDockPane"/>
</DataTrigger>
<DataTrigger Binding="{Binding Path=OverlayButtonHover, RelativeSource={RelativeSource Self}}" Value="DropPaneRight">
<Setter Property="Source" Value="/AvalonDock;component/resources/Images/Aero/AeroDockPaneRight.PNG" TargetName="IMG_DockPane"/>
<Setter Property="Source" Value="/AvalonDock;component/resources/Images/Aero/AeroDockPaneRight.PNG" TargetName="PART_btnDockPane"/>
</DataTrigger>
<DataTrigger Binding="{Binding Path=OverlayButtonHover, RelativeSource={RelativeSource Self}}" Value="DropPaneTop">
<Setter Property="Source" Value="/AvalonDock;component/resources/Images/Aero/AeroDockPaneTop.PNG" TargetName="IMG_DockPane"/>
<Setter Property="Source" Value="/AvalonDock;component/resources/Images/Aero/AeroDockPaneTop.PNG" TargetName="PART_btnDockPane"/>
</DataTrigger>
<DataTrigger Binding="{Binding Path=OverlayButtonHover, RelativeSource={RelativeSource Self}}" Value="DropPaneBottom">
<Setter Property="Source" Value="/AvalonDock;component/resources/Images/Aero/AeroDockPaneBottom.PNG" TargetName="IMG_DockPane"/>
<Setter Property="Source" Value="/AvalonDock;component/resources/Images/Aero/AeroDockPaneBottom.PNG" TargetName="PART_btnDockPane"/>
</DataTrigger>
<DataTrigger Binding="{Binding Path=OverlayButtonHover, RelativeSource={RelativeSource Self}}" Value="None">
<Setter Property="Source" Value="/AvalonDock;component/resources/Images/Aero/AeroDockPane.PNG" TargetName="IMG_DockPane"/>
<Setter Property="Source" Value="/AvalonDock;component/resources/Images/Aero/AeroDockPane.PNG" TargetName="PART_btnDockPane"/>
</DataTrigger>
</ControlTemplate.Triggers>

29
src/Libraries/AvalonDock/AvalonDock/Themes/classic.xaml

@ -30,7 +30,7 @@ @@ -30,7 +30,7 @@
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Image x:Name="Icon" Margin="1" Width="16" UseLayoutRounding="True" Source="{TemplateBinding Icon}"/>
<ad:ImageEx x:Name="Icon" Margin="1" Width="16" Source="{TemplateBinding Icon}"/>
<TextBlock
x:Name="tabItemTitle"
Grid.Column="1"
@ -113,21 +113,21 @@ @@ -113,21 +113,21 @@
<DockPanel LastChildFill="True">
<Button DockPanel.Dock="Right" Style="{StaticResource PaneHeaderCommandStyle}" Command="ad:ManagedContentCommands.Close" CommandTarget="{TemplateBinding SelectedItem}"
Width="15" Height="15" Margin="2,0,2,0" VerticalAlignment="Center">
<ad:AlignedImage>
<Image x:Name="IMG_Close" Source="/AvalonDock;component/resources/Images/Classic/PinClose.png" Width="13" Height="13" Stretch="UniformToFill"/>
</ad:AlignedImage>
<!--<ad:AlignedImage>-->
<ad:ImageEx x:Name="IMG_Close" Source="/AvalonDock;component/resources/Images/Classic/PinClose.png" Width="13" />
<!--</ad:AlignedImage>-->
</Button>
<Button x:Name="btnPinAutoHide" DockPanel.Dock="Right" Style="{StaticResource PaneHeaderCommandStyle}" Command="ad:DockablePaneCommands.ToggleAutoHide"
Width="15" Height="15" VerticalAlignment="Center">
<ad:AlignedImage>
<Image x:Name="IMG_AutoHide" Source="/AvalonDock;component/resources/Images/Classic/PinAutoHide.png" Width="13" Height="13" Stretch="UniformToFill"/>
</ad:AlignedImage>
<!--<ad:AlignedImage>-->
<ad:ImageEx x:Name="IMG_AutoHide" Source="/AvalonDock;component/resources/Images/Classic/PinAutoHide.png" Width="13"/>
<!--</ad:AlignedImage>-->
</Button>
<Border x:Name="PART_ShowContextMenuButton" DockPanel.Dock="Right" Style="{StaticResource PaneHeaderContextMenuCommandStyle}"
Width="15" Height="15" VerticalAlignment="Center">
<ad:AlignedImage>
<Image x:Name="IMG_ShowContextMenu" Source="/AvalonDock;component/resources/Images/Classic/PinMenu.png" Width="13" Height="13" Stretch="UniformToFill"/>
</ad:AlignedImage>
<!--<ad:AlignedImage>-->
<ad:ImageEx x:Name="IMG_ShowContextMenu" Source="/AvalonDock;component/resources/Images/Classic/PinMenu.png" Width="13"/>
<!--</ad:AlignedImage>-->
</Border>
<TextBlock
Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=SelectedItem.Title}"
@ -214,7 +214,6 @@ @@ -214,7 +214,6 @@
BorderBrush="{StaticResource ManagedContentTabControlNormalBorderBrush}"
Margin="0,0,-10,0"
SnapsToDevicePixels="True"
ContextMenu="{DynamicResource {ComponentResourceKey {x:Type ad:DockingManager}, {x:Static ad:ContextMenuElement.DocumentPane}}}"
>
<Grid Margin="0,0,0,0" >
<Grid.ColumnDefinitions>
@ -248,9 +247,7 @@ @@ -248,9 +247,7 @@
TextWrapping="NoWrap"
Text="{TemplateBinding Title}"
Foreground="{DynamicResource {ComponentResourceKey {x:Type ad:DockingManager}, {x:Static ad:AvalonDockBrushes.DocumentHeaderForeground}}}"/>
<ad:AlignedImage x:Name="PART_LockedIcon" Margin="2,0,0,0" Visibility="Collapsed" VerticalAlignment="Center" HorizontalAlignment="Center">
<Image Source="/AvalonDock;component/resources/Images/Locked.png" Width="6" Height="8" Stretch="Uniform"/>
</ad:AlignedImage>
<ad:ImageEx Source="/AvalonDock;component/resources/Images/Locked.png" Width="6" x:Name="PART_LockedIcon" Margin="2,0,0,0" Visibility="Collapsed" />
</StackPanel>
</Border>
</Grid>
@ -303,7 +300,7 @@ @@ -303,7 +300,7 @@
<Setter.Value>
<ControlTemplate TargetType="{x:Type ad:DocumentPane}" >
<ControlTemplate.Resources>
<ContextMenu x:Key="DocumentsListMenu" StaysOpen="True" ItemContainerStyle="{StaticResource ResourceKey=DocumentPaneMenuItemStyle}" />
<ContextMenu x:Key="DocumentsListMenu" StaysOpen="True" />
</ControlTemplate.Resources>
<Border
Focusable="False"
@ -414,7 +411,7 @@ @@ -414,7 +411,7 @@
<VisualBrush Stretch="None" Visual="{Binding Path=Icon, RelativeSource={RelativeSource TemplatedParent}}"/>
</Border.Background>
</Border>-->
<Image x:Name="borderIcon" Width="16" Source="{TemplateBinding Icon}" UseLayoutRounding="True"/>
<ad:ImageEx x:Name="borderIcon" Width="16" Source="{TemplateBinding Icon}" />
<TextBlock
Grid.Column="1"

Loading…
Cancel
Save