Skip to content
This repository has been archived by the owner on May 1, 2023. It is now read-only.

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
Wenveo committed Jan 9, 2023
1 parent 49e3fd0 commit 3791acd
Showing 1 changed file with 13 additions and 20 deletions.
33 changes: 13 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,24 +59,20 @@

*So you can use **BasedOn** in **Style**, And change the properties of the control's style.* (See [App.xaml](https://github.com/Noisrev/Aak.Shell.UI.Themes.AvalonDock/blob/main/DockingDemo/App.xaml))

Before doing this, you need to merge a theme **ResourceDictionary** (Any Theme).
``` xml
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/Aak.Shell.UI.Themes.AvalonDock;component/Themes/VisualStudio2022/DarkTheme.xaml" />
</ResourceDictionary.MergedDictionaries>
```
Then we change the properties of the **Document Floating Window** to allow minimization and show in **TaskBar** and separate from the **MainWindow**.
``` xml
<!-- xmlns:avalonDockControls="https://github.com/Dirkster99/AvalonDock" -->
<!-- Styles can be dynamically based using DynamicResourceStyle. -->

<Style
x:Key="{x:Type avalonDockControls:LayoutDocumentFloatingWindowControl}"
BasedOn="{StaticResource DocumentWellWindowBaseStyle}"
TargetType="{x:Type avalonDockControls:LayoutDocumentFloatingWindowControl}">
<Style x:Key="CustomizeDocumentFloatingWindowStyle" TargetType="{x:Type LayoutDocumentFloatingWindowControl}">
<Setter Property="AllowMinimize" Value="True" />
<Setter Property="ShowInTaskbar" Value="True" />
<Setter Property="OwnedByDockingManagerWindow" Value="False" />
</Style>

<Style x:Key="{x:Type LayoutDocumentFloatingWindowControl}" TargetType="{x:Type LayoutDocumentFloatingWindowControl}">
<Setter Property="local:DynamicResourceStyle.BasedOn" Value="{DynamicResource DocumentWellWindowBaseStyle}" />
<Setter Property="local:DynamicResourceStyle.Derived" Value="{DynamicResource CustomizeDocumentFloatingWindowStyle}" />
</Style>
```

And we can change the **ItemTemplate** of **NavigatorWindow's List**.
Expand Down Expand Up @@ -114,15 +110,17 @@ And we can change the **ItemTemplate** of **NavigatorWindow's List**.
# 📢 Known Problems
Custom styles and templates don't work when using themes in **DockingManager**.
``` xml
<Style
x:Key="{x:Type avalonDockControls:LayoutDocumentFloatingWindowControl}"
BasedOn="{StaticResource DocumentWellWindowBaseStyle}"
TargetType="{x:Type avalonDockControls:LayoutDocumentFloatingWindowControl}">
<Style x:Key="CustomizeDocumentFloatingWindowStyle" TargetType="{x:Type LayoutDocumentFloatingWindowControl}">
<Setter Property="AllowMinimize" Value="True" />
<Setter Property="ShowInTaskbar" Value="True" />
<Setter Property="OwnedByDockingManagerWindow" Value="False" />
</Style>

<Style x:Key="{x:Type LayoutDocumentFloatingWindowControl}" TargetType="{x:Type LayoutDocumentFloatingWindowControl}">
<Setter Property="local:DynamicResourceStyle.BasedOn" Value="{DynamicResource DocumentWellWindowBaseStyle}" />
<Setter Property="local:DynamicResourceStyle.Derived" Value="{DynamicResource CustomizeDocumentFloatingWindowStyle}" />
</Style>

<!-- If you set the theme in DockingManager. Then the above style will not work -->
<DockingManager>
<DockingManager.Theme>
Expand All @@ -131,11 +129,6 @@ Custom styles and templates don't work when using themes in **DockingManager**.
</DockingManger>
```

Therefore, you must merge a theme **ResourceDictionary** before you customize the styles ([✨ Styles and Templates](#-styles-and-templates)).

And then, you can change the **DockingManager's** theme in code.

(See [App.xaml](https://github.com/Noisrev/Aak.Shell.UI.Themes.AvalonDock/blob/main/DockingDemo/App.xaml), [MainWindow.xaml.cs](https://github.com/Noisrev/Aak.Shell.UI.Themes.AvalonDock/blob/main/DockingDemo/MainWindow.xaml.cs))

# LICENSE
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
Expand Down

0 comments on commit 3791acd

Please sign in to comment.