Skip to content

Commit

Permalink
Merge pull request #1 from Dirkster99/master
Browse files Browse the repository at this point in the history
pull upstream
  • Loading branch information
Khaos66 authored Feb 9, 2023
2 parents d68b926 + 58ec136 commit 6396533
Show file tree
Hide file tree
Showing 47 changed files with 1,306 additions and 212 deletions.
58 changes: 58 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,64 @@ to also theme standard elements, such as, button and textblock etc.

# Mile Stone History

## Fixes Added in Version 4.71.2

- [#416 Fix Issue #226: Restore floating windows to maximized state](https://github.com/Dirkster99/AvalonDock/pull/416) (thanx to [Michael Möller](https://github.com/moellerm))

- [#417 Close and active selected item when NavigatorWindow is inactive](https://github.com/Dirkster99/AvalonDock/pull/417) (thanx to [EQOH Noisrev](https://github.com/Noisrev))

- [#418 Add active content handler to LayoutAnchorableFloatingWindow and improve the active content handlers](https://github.com/Dirkster99/AvalonDock/pull/418) (thanx to [EQOH Noisrev](https://github.com/Noisrev))

## Fixes Added in Version 4.71.1

- [#413 Fix the binding error in AnchorGroupTemplate](https://github.com/Dirkster99/AvalonDock/pull/413) (thanx to [EQOH Noisrev](https://github.com/Noisrev))

- [#414 When apply new template, add back collection change event handler](https://github.com/Dirkster99/AvalonDock/pull/414) (thanx to [EQOH Noisrev](https://github.com/Noisrev))

- [#415 Improved and fix floating window activation and activation pane](https://github.com/Dirkster99/AvalonDock/pull/415) (thanx to [EQOH Noisrev](https://github.com/Noisrev))

## Fixes Added in Version 4.71.0

- [#399 add open/close LayoutFlayoutingWindowsControl events](https://github.com/Dirkster99/AvalonDock/pull/399) (thanx to [Denis Smirnov](https://github.com/GonzRu))

- [#400 set ResizeOverlay's owner always null](https://github.com/Dirkster99/AvalonDock/pull/400) (thanx to [Denis Smirnov](https://github.com/GonzRu))

- [#401 remove unused variable from DocumentPaneTabPanel](https://github.com/Dirkster99/AvalonDock/pull/401) (thanx to [Denis Smirnov](https://github.com/GonzRu))

- [#403 Add XmlSerializer cache to fix memory leaks.](https://github.com/Dirkster99/AvalonDock/pull/403) (thanx to [Pavel Kindruk](https://github.com/pkindruk))

- [#404 Fix deserialized layout document close.](https://github.com/Dirkster99/AvalonDock/pull/404) (thanx to [Pavel Kindruk](https://github.com/pkindruk))

- [#409 Restore previously activated document after closing active document](https://github.com/Dirkster99/AvalonDock/pull/409) (thanx to [L45eMy](https://github.com/L45eMy))

- [#410 Improved activation of floating Windows](https://github.com/Dirkster99/AvalonDock/pull/410) (thanx to [EQOH Noisrev](https://github.com/Noisrev))

- [#411 Add anchorable hide and close notifications to DockingManager](https://github.com/Dirkster99/AvalonDock/pull/411) (thanx to [John Stewien](https://github.com/stewienj))

- [#412 Fix a issue where the dragged window still appeared above the overlay window](https://github.com/Dirkster99/AvalonDock/pull/412) (thanx to [EQOH Noisrev](https://github.com/Noisrev))

## Fixes Added in Version 4.70.3

- [#394 Fix the get owner DockingManagerWindow and Update drag and drop](https://github.com/Dirkster99/AvalonDock/pull/394) (thanx to [EQOH Noisrev](https://github.com/Noisrev))

- [#393 Add Null check for GetWindowChrome](https://github.com/Dirkster99/AvalonDock/pull/393) (thanx to [EQOH Noisrev](https://github.com/Noisrev))

- [#376 Prevents a known bug in WPF](https://github.com/Dirkster99/AvalonDock/pull/376) (thanx to [Ben Buerger](https://github.com/bbuerger))

## Fixes Added in Version 4.70.2

- [#338 Fixes #309 Anchorable Header not visible in generic theme](https://github.com/Dirkster99/AvalonDock/pull/338) (thanx to [Darren Gosbell](https://github.com/dgosbell))
- [#346 fix crash if some assembly not allow GetTypes()](https://github.com/Dirkster99/AvalonDock/pull/346) (thanx to [Trivalik](https://github.com/trivalik))
- [#347 #345 fix refresh when moving floating windows](https://github.com/Dirkster99/AvalonDock/pull/347) (thanx to [Norberto Magni](https://github.com/nmagni))
- [#357 LayoutAutoHideWindowControl: UI automation name](https://github.com/Dirkster99/AvalonDock/pull/357) (thanx to [Ben](https://github.com/bbuerger))
- [#363 Fixes #362 DockingManager with a Viewbox ancestor does not properly render auto-hidden LayoutAnchorables](https://github.com/Dirkster99/AvalonDock/pull/363) (thanx to [Tim Cooke](https://github.com/timothylcooke))
- [#367 Fix for #306 StartDraggingFloatingWindow](https://github.com/Dirkster99/AvalonDock/pull/367) (thanx to [Muhahe](https://github.com/Muhahe))

## Fixes Added in Version 4.70.1

- [#336 Keep ActiveContent when switching RootPanel](https://github.com/Dirkster99/AvalonDock/pull/336) (thanx to [Khaos66](https://github.com/Khaos66))
- [#334 fix #333 x64-issue: x86-specific functions are used when project is compiled for x64-architecture](https://github.com/Dirkster99/AvalonDock/pull/334) (thanx to [Jan cuellius](https://github.com/cuellius))

## Features and Fixes Added in Version 4.70.0

- [#331 FixDockAsDocument fix bug with CanExecute and Execute for DockAsDocument](https://github.com/Dirkster99/AvalonDock/pull/331) (thanx to [askgthb](https://github.com/askgthb))
Expand Down
201 changes: 200 additions & 1 deletion source/AutomationTest/AvalonDockTest/AnchorablePaneTest.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
namespace AvalonDockTest
namespace AvalonDockTest
{
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Microsoft.VisualStudio.TestTools.UnitTesting.STAExtensions;
using System.Threading.Tasks;
using AvalonDock.Layout;
using AvalonDockTest.TestHelpers;
using AvalonDockTest.views;
using AvalonDock;
using System.Collections.Generic;
using System.Linq;
using AvalonDock.Controls;

[STATestClass]
public class AnchorablePaneTest : AutomationTestBase
Expand All @@ -30,5 +34,200 @@ public void AnchorablePaneHideCloseTest()
ILayoutContainer actualContainer = windows.Screen3.Parent;
Assert.AreEqual(expectedContainer, actualContainer);
}

[STATestMethod]
public void AnchorablePaneHideCloseEventsFiredTest()
{
// Create the window with 2 LayoutAnchorable items

TestHost.SwitchToAppThread();

Task<AnchorablePaneTestWindow> taskResult = WindowHelpers.CreateInvisibleWindowAsync<AnchorablePaneTestWindow>();

taskResult.Wait();

AnchorablePaneTestWindow windows = taskResult.Result;
DockingManager dockingManager = windows.dockingManager;

// These lists hold a record of the anchorable hide and close events

List<LayoutAnchorable> isHidingRaised = new List<LayoutAnchorable>();
List<LayoutAnchorable> isHiddenRaised = new List<LayoutAnchorable>();
List<LayoutAnchorable> isClosingRaised = new List<LayoutAnchorable>();
List<LayoutAnchorable> isClosedRaised = new List<LayoutAnchorable>();

// Event handlers for the hide and close events

dockingManager.AnchorableClosing += (s, e) => isClosingRaised.Add(e.Anchorable);
dockingManager.AnchorableClosed += (s, e) => isClosedRaised.Add(e.Anchorable);
dockingManager.AnchorableHiding += (s, e) => isHidingRaised.Add(e.Anchorable);
dockingManager.AnchorableHidden += (s, e) => isHiddenRaised.Add(e.Anchorable);

// Ensure the items can be hidden and closed
windows.Screen2.CanHide = true;
windows.Screen3.CanHide = true;
windows.Screen2.CanClose = true;
windows.Screen3.CanClose = true;

// Hide item3

windows.Screen3.Hide();

// Ensure only item3 is hidden, and check the correct events were fired

Assert.IsFalse(windows.Screen2.IsHidden);
Assert.IsTrue(windows.Screen3.IsHidden);
Assert.AreEqual(1, isHidingRaised.Count);
Assert.AreEqual(1, isHiddenRaised.Count);
Assert.AreEqual(0, isClosingRaised.Count);
Assert.AreEqual(0, isClosedRaised.Count);

Assert.AreEqual(windows.Screen3, isHidingRaised.First());
Assert.AreEqual(windows.Screen3, isHiddenRaised.First());

isHidingRaised.Clear();
isHiddenRaised.Clear();

// Close item2

windows.Screen2.Close();

// Check the correct events were fired

Assert.AreEqual(0, isHidingRaised.Count);
Assert.AreEqual(0, isHiddenRaised.Count);
Assert.AreEqual(1, isClosingRaised.Count);
Assert.AreEqual(1, isClosedRaised.Count);

Assert.AreEqual(windows.Screen2, isClosingRaised.First());
Assert.AreEqual(windows.Screen2, isClosedRaised.First());
}

[STATestMethod]
public void AnchorablePaneHideCloseEventsCancelledTest()
{
// Create the window with 2 LayoutAnchorable items

TestHost.SwitchToAppThread();

Task<AnchorablePaneTestWindow> taskResult = WindowHelpers.CreateInvisibleWindowAsync<AnchorablePaneTestWindow>();

taskResult.Wait();

AnchorablePaneTestWindow windows = taskResult.Result;
DockingManager dockingManager = windows.dockingManager;

// These lists hold a record of the anchorable hide and close events

List<LayoutAnchorable> isHidingRaised = new List<LayoutAnchorable>();
List<LayoutAnchorable> isHiddenRaised = new List<LayoutAnchorable>();
List<LayoutAnchorable> isClosingRaised = new List<LayoutAnchorable>();
List<LayoutAnchorable> isClosedRaised = new List<LayoutAnchorable>();

// Event handlers for the hide and close events

dockingManager.AnchorableClosing += (s, e) =>
{
e.Cancel = true;
isClosingRaised.Add(e.Anchorable);
};
dockingManager.AnchorableClosed += (s, e) => isClosedRaised.Add(e.Anchorable);
dockingManager.AnchorableHiding += (s, e) =>
{
e.Cancel = true;
isHidingRaised.Add(e.Anchorable);
};
dockingManager.AnchorableHidden += (s, e) => isHiddenRaised.Add(e.Anchorable);

// Ensure the items can be hidden and closed
windows.Screen2.CanHide = true;
windows.Screen3.CanHide = true;
windows.Screen2.CanClose = true;
windows.Screen3.CanClose = true;

// Hide Screen3

windows.Screen3.Hide();

// Ensure nothing was hidden but cancelled instead, and check the correct events were fired

Assert.IsFalse(windows.Screen2.IsHidden);
Assert.IsFalse(windows.Screen3.IsHidden);
Assert.AreEqual(1, isHidingRaised.Count);
Assert.AreEqual(0, isHiddenRaised.Count);
Assert.AreEqual(0, isClosingRaised.Count);
Assert.AreEqual(0, isClosedRaised.Count);

Assert.AreEqual(windows.Screen3, isHidingRaised.First());

isHidingRaised.Clear();

// Close Screen2

windows.Screen2.Close();

// Ensure nothing was closed, and check the correct events were fired

Assert.AreEqual(0, isHidingRaised.Count);
Assert.AreEqual(0, isHiddenRaised.Count);
Assert.AreEqual(1, isClosingRaised.Count);
Assert.AreEqual(0, isClosedRaised.Count);

Assert.AreEqual(windows.Screen2, isClosingRaised.First());
}

[STATestMethod]
public void AnchorablePaneHideEventRedirectTest()
{
// Create the window with 2 LayoutAnchorable items

TestHost.SwitchToAppThread();

Task<AnchorablePaneTestWindow> taskResult = WindowHelpers.CreateInvisibleWindowAsync<AnchorablePaneTestWindow>();

taskResult.Wait();

AnchorablePaneTestWindow windows = taskResult.Result;
DockingManager dockingManager = windows.dockingManager;

// These lists hold a record of the anchorable hide and close events

List<LayoutAnchorable> isHidingRaised = new List<LayoutAnchorable>();
List<LayoutAnchorable> isHiddenRaised = new List<LayoutAnchorable>();
List<LayoutAnchorable> isClosingRaised = new List<LayoutAnchorable>();
List<LayoutAnchorable> isClosedRaised = new List<LayoutAnchorable>();

// Event handlers for the hide and close events

dockingManager.AnchorableClosing += (s, e) => isClosingRaised.Add(e.Anchorable);
dockingManager.AnchorableClosed += (s, e) => isClosedRaised.Add(e.Anchorable);
dockingManager.AnchorableHiding += (s, e) =>
{
e.CloseInsteadOfHide = true;
isHidingRaised.Add(e.Anchorable);
};
dockingManager.AnchorableHidden += (s, e) => isHiddenRaised.Add(e.Anchorable);

// Ensure the Screen3 can be hidden and closed
windows.Screen3.CanHide = true;
windows.Screen3.CanClose = true;

// Hide Screen3

windows.Screen3.Hide();

// Ensure nothing was hidden but cancelled instead, and check the correct events were fired

Assert.IsFalse(windows.Screen2.IsHidden);
Assert.IsFalse(windows.Screen3.IsHidden);
Assert.AreEqual(1, isHidingRaised.Count);
Assert.AreEqual(0, isHiddenRaised.Count);
Assert.AreEqual(1, isClosingRaised.Count);
Assert.AreEqual(1, isClosedRaised.Count);

Assert.AreEqual(windows.Screen3, isHidingRaised.First());
Assert.AreEqual(windows.Screen3, isClosingRaised.First());
Assert.AreEqual(windows.Screen3, isClosedRaised.First());
}
}
}
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup>
<RootNamespace>AvalonDock.Themes</RootNamespace>
<TargetFrameworks>netcoreapp3.0;net5.0-windows;net40</TargetFrameworks>
<UseWPF>true</UseWPF>
<AssemblyOriginatorKeyFile>sn.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>4.70.0</Version>
<AssemblyVersion>4.70.0</AssemblyVersion>
<FileVersion>4.70.0</FileVersion>
<PackageVersion>4.70.0</PackageVersion>
<Version>4.71.2</Version>
<AssemblyVersion>4.71.2</AssemblyVersion>
<FileVersion>4.71.2</FileVersion>
<PackageVersion>4.71.2</PackageVersion>
<Company>Open Source</Company>
<Product>Dirkster.AvalonDock</Product>
<Copyright>2017-2022</Copyright>
<Copyright>2017-2023</Copyright>
<Description>This assembly implements a docking layout system for WPF.</Description>
<PackageProjectUrl>https://github.com/Dirkster99/AvalonDock</PackageProjectUrl>
<RepositoryUrl>https://github.com/Dirkster99/AvalonDock</RepositoryUrl>
Expand Down
30 changes: 21 additions & 9 deletions source/Components/AvalonDock.Themes.Aero/Theme.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -481,15 +481,27 @@

<ControlTemplate x:Key="AvalonDock_ThemeAero_AnchorGroupTemplate" TargetType="{x:Type avalonDockControls:LayoutAnchorGroupControl}">
<ItemsControl ItemsSource="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Children}">
<ItemsControl.LayoutTransform>
<RotateTransform Angle="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Model.Parent.Side, Converter={avalonDockConverters:AnchorSideToAngleConverter}}" />
</ItemsControl.LayoutTransform>
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl>
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.Style>
<Style TargetType="{x:Type ItemsControl}">
<Style.Resources>
<RotateTransform x:Key="LeftRightAnchorSideRotateTransform" Angle="90" />
</Style.Resources>
<Style.Triggers>
<DataTrigger Binding="{Binding Path=Model.Parent.Side, RelativeSource={RelativeSource TemplatedParent}}" Value="Left">
<Setter Property="LayoutTransform" Value="{StaticResource LeftRightAnchorSideRotateTransform}" />
</DataTrigger>
<DataTrigger Binding="{Binding Path=Model.Parent.Side, RelativeSource={RelativeSource TemplatedParent}}" Value="Right">
<Setter Property="LayoutTransform" Value="{StaticResource LeftRightAnchorSideRotateTransform}" />
</DataTrigger>
</Style.Triggers>
</Style>
</ItemsControl.Style>
</ItemsControl>
</ControlTemplate>

<ControlTemplate x:Key="AvalonDock_ThemeAero_AnchorTemplate" TargetType="{x:Type avalonDockControls:LayoutAnchorControl}">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup>
<RootNamespace>AvalonDock.Themes</RootNamespace>
<TargetFrameworks>netcoreapp3.0;net5.0-windows;net40</TargetFrameworks>
<UseWPF>true</UseWPF>
<AssemblyOriginatorKeyFile>sn.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>4.70.0</Version>
<AssemblyVersion>4.70.0</AssemblyVersion>
<FileVersion>4.70.0</FileVersion>
<PackageVersion>4.70.0</PackageVersion>
<Version>4.71.2</Version>
<AssemblyVersion>4.71.2</AssemblyVersion>
<FileVersion>4.71.2</FileVersion>
<PackageVersion>4.71.2</PackageVersion>
<Company>Open Source</Company>
<Product>Dirkster.AvalonDock</Product>
<Copyright>2017-2022</Copyright>
<Copyright>2017-2023</Copyright>
<Description>This assembly implements a docking layout system for WPF.</Description>
<PackageProjectUrl>https://github.com/Dirkster99/AvalonDock</PackageProjectUrl>
<RepositoryUrl>https://github.com/Dirkster99/AvalonDock</RepositoryUrl>
Expand Down
18 changes: 15 additions & 3 deletions source/Components/AvalonDock.Themes.Expression/Theme.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -485,14 +485,26 @@

<ControlTemplate x:Key="AvalonDock_Expression_AnchorGroupTemplate" TargetType="{x:Type avalonDockControls:LayoutAnchorGroupControl}">
<ItemsControl ItemsSource="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Children}">
<ItemsControl.LayoutTransform>
<RotateTransform Angle="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Model.Parent.Side, Converter={avalonDockConverters:AnchorSideToAngleConverter}}" />
</ItemsControl.LayoutTransform>
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.Style>
<Style TargetType="{x:Type ItemsControl}">
<Style.Resources>
<RotateTransform x:Key="LeftRightAnchorSideRotateTransform" Angle="90" />
</Style.Resources>
<Style.Triggers>
<DataTrigger Binding="{Binding Path=Model.Parent.Side, RelativeSource={RelativeSource TemplatedParent}}" Value="Left">
<Setter Property="LayoutTransform" Value="{StaticResource LeftRightAnchorSideRotateTransform}" />
</DataTrigger>
<DataTrigger Binding="{Binding Path=Model.Parent.Side, RelativeSource={RelativeSource TemplatedParent}}" Value="Right">
<Setter Property="LayoutTransform" Value="{StaticResource LeftRightAnchorSideRotateTransform}" />
</DataTrigger>
</Style.Triggers>
</Style>
</ItemsControl.Style>
</ItemsControl>
</ControlTemplate>

Expand Down
Loading

0 comments on commit 6396533

Please sign in to comment.