Skip to content

Commit

Permalink
Fixing Issue #148 for non-Generic themes
Browse files Browse the repository at this point in the history
  • Loading branch information
Dirkster99 committed Apr 13, 2020
1 parent 9a18752 commit f8524f1
Show file tree
Hide file tree
Showing 6 changed files with 1,874 additions and 2,102 deletions.
29 changes: 23 additions & 6 deletions source/Components/AvalonDock.Themes.Aero/Theme.xaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<!--************************************************************************
<!--
************************************************************************
AvalonDock
Copyright (C) 2007-2013 Xceed Software Inc.
This program is provided to you under the terms of the Microsoft Public
License (Ms-PL) as published at https://opensource.org/licenses/MS-PL
************************************************************************-->
************************************************************************
-->

<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
Expand Down Expand Up @@ -1134,20 +1136,35 @@
FlowDirection="{TemplateBinding FlowDirection}" />

<!--<ContentPresenter
Content="{Binding Model.Content, RelativeSource={RelativeSource TemplatedParent}}"
ContentTemplate="{Binding LayoutItemTemplate, Mode=OneWay, RelativeSource={RelativeSource AncestorType={x:Type avalonDock:DockingManager}, Mode=FindAncestor}}"
ContentTemplateSelector="{Binding LayoutItemTemplateSelector, Mode=OneWay, RelativeSource={RelativeSource AncestorType={x:Type avalonDock:DockingManager}, Mode=FindAncestor}}"
Grid.Row="1"/>-->
Content="{Binding Model.Content, RelativeSource={RelativeSource TemplatedParent}}"
ContentTemplate="{Binding LayoutItemTemplate, Mode=OneWay, RelativeSource={RelativeSource AncestorType={x:Type avalonDock:DockingManager}, Mode=FindAncestor}}"
ContentTemplateSelector="{Binding LayoutItemTemplateSelector, Mode=OneWay, RelativeSource={RelativeSource AncestorType={x:Type avalonDock:DockingManager}, Mode=FindAncestor}}"
Grid.Row="1"/>-->
</Grid>
</Border>
<ControlTemplate.Triggers>
<MultiDataTrigger>
<!--
Hide the title if the control is directly hosted in floating window
The floating window control will show the title if there is only one control to host
without any other LayoutAnchorableControl
-->
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=Model.IsFloating}" Value="True" />
<Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=Model.Parent.IsDirectlyHostedInFloatingWindow}" Value="True" />
</MultiDataTrigger.Conditions>
<Setter TargetName="Header" Property="Visibility" Value="Collapsed" />
</MultiDataTrigger>
<MultiDataTrigger>
<!--
Also hide the title, if model cannot be bound which can happen when using virtualization
See Issue #148 Drop Down Menu for LayoutAnchorables is not correct with Virtualization
-->
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=Model}" Value="{x:Null}" />
</MultiDataTrigger.Conditions>
<Setter TargetName="Header" Property="Visibility" Value="Collapsed" />
</MultiDataTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
Expand Down
21 changes: 19 additions & 2 deletions source/Components/AvalonDock.Themes.Expression/Theme.xaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<!--************************************************************************
<!--
************************************************************************
AvalonDock
Copyright (C) 2007-2013 Xceed Software Inc.
This program is provided to you under the terms of the Microsoft Public
License (Ms-PL) as published at https://opensource.org/licenses/MS-PL
************************************************************************-->
************************************************************************
-->

<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
Expand Down Expand Up @@ -285,12 +287,27 @@
</Grid>
<ControlTemplate.Triggers>
<MultiDataTrigger>
<!--
Hide the title if the control is directly hosted in floating window
The floating window control will show the title if there is only one control to host
without any other LayoutAnchorableControl
-->
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=Model.IsFloating}" Value="True" />
<Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=Model.Parent.IsDirectlyHostedInFloatingWindow}" Value="True" />
</MultiDataTrigger.Conditions>
<Setter TargetName="Header" Property="Visibility" Value="Collapsed" />
</MultiDataTrigger>
<MultiDataTrigger>
<!--
Also hide the title, if model cannot be bound which can happen when using virtualization
See Issue #148 Drop Down Menu for LayoutAnchorables is not correct with Virtualization
-->
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=Model}" Value="{x:Null}" />
</MultiDataTrigger.Conditions>
<Setter TargetName="Header" Property="Visibility" Value="Collapsed" />
</MultiDataTrigger>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
</Trigger>
Expand Down
21 changes: 19 additions & 2 deletions source/Components/AvalonDock.Themes.Metro/Theme.xaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<!--************************************************************************
<!--
************************************************************************
AvalonDock
Copyright (C) 2007-2013 Xceed Software Inc.
This program is provided to you under the terms of the Microsoft Public
License (Ms-PL) as published at https://opensource.org/licenses/MS-PL
************************************************************************-->
************************************************************************
-->

<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
Expand Down Expand Up @@ -1172,12 +1174,27 @@
</Border>
<ControlTemplate.Triggers>
<MultiDataTrigger>
<!--
Hide the title if the control is directly hosted in floating window
The floating window control will show the title if there is only one control to host
without any other LayoutAnchorableControl
-->
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=Model.IsFloating}" Value="True" />
<Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=Model.Parent.IsDirectlyHostedInFloatingWindow}" Value="True" />
</MultiDataTrigger.Conditions>
<Setter TargetName="Header" Property="Visibility" Value="Collapsed" />
</MultiDataTrigger>
<MultiDataTrigger>
<!--
Also hide the title, if model cannot be bound which can happen when using virtualization
See Issue #148 Drop Down Menu for LayoutAnchorables is not correct with Virtualization
-->
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=Model}" Value="{x:Null}" />
</MultiDataTrigger.Conditions>
<Setter TargetName="Header" Property="Visibility" Value="Collapsed" />
</MultiDataTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
Expand Down
Loading

0 comments on commit f8524f1

Please sign in to comment.