/
DocumentControl.xaml
107 lines (107 loc) · 7.83 KB
/
DocumentControl.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<Styles xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:id="clr-namespace:Dock.Avalonia;assembly=Dock.Avalonia"
xmlns:idc="clr-namespace:Dock.Avalonia.Controls;assembly=Dock.Avalonia"
xmlns:Dock="clr-namespace:Dock.Model;assembly=Dock.Model"
xmlns:Controls="clr-namespace:Dock.Model.Controls;assembly=Dock.Model">
<Style Selector="idc|DocumentControl">
<Setter Property="Template">
<ControlTemplate>
<DockPanel Name="DropDocumentDock" id:DockProperties.IsDropArea="True" id:DockProperties.IsDockTarget="True" Background="Transparent" Grid.Row="1" ZIndex="1" x:DataType="Controls:IDocumentDock" x:CompileBindings="True">
<DockPanel.Styles>
<Style Selector="TextBlock.drag">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="VerticalAlignment" Value="Stretch"/>
<Setter Property="HorizontalAlignment" Value="Stretch"/>
</Style>
<Style Selector="Border.panel">
<Setter Property="Margin" Value="0"/>
<Setter Property="Padding" Value="4"/>
<Setter Property="BorderBrush" Value="{DynamicResource ThemeBorderLowBrush}"/>
<Setter Property="BorderThickness" Value="1"/>
</Style>
<Style Selector="Button.chromeButton">
<Setter Property="Margin" Value="2 0 0 0"/>
<Setter Property="Padding" Value="0"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Background" Value="Transparent" />
</Style>
<Style Selector="Grid.grip:floating">
<Setter Property="IsVisible" Value="False" />
</Style>
<Style Selector="Button.documentTabButton">
<Setter Property="Background" Value="Transparent" />
</Style>
<Style Selector="Button.documentTabButton:pointerover">
<Setter Property="Background" Value="{DynamicResource ApplicationAccentBrushHigh}" />
</Style>
<Style Selector="TabStripItem:selected Button.documentTabButton Path">
<Setter Property="Fill" Value="{DynamicResource ApplicationAccentForegroundBrush}" />
</Style>
<Style Selector="TabStripItem:pointerover Button.documentTabButton Path">
<Setter Property="Fill" Value="{DynamicResource ApplicationAccentForegroundBrush}" />
</Style>
</DockPanel.Styles>
<TabStrip Name="PART_TabStrip" id:DockProperties.IsDropArea="True" Background="Transparent" Items="{Binding VisibleDockables}" SelectedItem="{Binding ActiveDockable, Mode=TwoWay}" Focusable="false" ClipToBounds="False" ZIndex="1" DockPanel.Dock="Top">
<TabStrip.Styles>
<Style Selector="TabStrip">
<Setter Property="ItemsPanel">
<ItemsPanelTemplate>
<WrapPanel ClipToBounds="False" />
</ItemsPanelTemplate>
</Setter>
</Style>
<Style Selector="TabStrip:empty">
<Setter Property="IsVisible" Value="False" />
</Style>
<Style Selector="TabStripItem">
<Setter Property="Height" Value="20" />
<Setter Property="Background" Value="{DynamicResource ThemeBackgroundBrush}" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Margin" Value="0" />
<Setter Property="Padding" Value="4 0 4 0" />
<Setter Property="Foreground" Value="{DynamicResource ThemeForegroundBrush}" />
</Style>
<Style Selector="TabStripItem:pointerover">
<Setter Property="Background" Value="{DynamicResource ApplicationAccentBrushMed}"/>
<Setter Property="Foreground" Value="{DynamicResource ApplicationAccentForegroundBrush}" />
</Style>
<Style Selector="TabStripItem:selected">
<Setter Property="Background" Value="{DynamicResource ApplicationAccentBrushLow}"/>
<Setter Property="Foreground" Value="{DynamicResource ApplicationAccentForegroundBrush}" />
</Style>
<Style Selector="TabStripItem:selected:pointerover">
<Setter Property="Background" Value="{DynamicResource ApplicationAccentBrushLow}"/>
<Setter Property="Foreground" Value="{DynamicResource ApplicationAccentForegroundBrush}" />
</Style>
</TabStrip.Styles>
<TabStrip.DataTemplates>
<DataTemplate DataType="Dock:IDockable">
<StackPanel Name="DragDocument" id:DockProperties.IsDragArea="True" id:DockProperties.IsDropArea="True" Background="Transparent" Orientation="Horizontal" Spacing="2">
<StackPanel Orientation="Horizontal" Margin="2" TextBlock.FontSize="12">
<TextBlock Text="{Binding Title}" />
<TextBlock Text="*" IsVisible="{Binding IsDirty, FallbackValue=False}" x:CompileBindings="False"/>
</StackPanel>
<Button Height="14" Width="14" Command="{Binding Owner.Factory.CloseDockable}" CommandParameter="{Binding}" Classes="documentTabButton" x:CompileBindings="False">
<Button.Styles>
<Style Selector="Button">
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Padding" Value="0"/>
<Setter Property="Margin" Value="0"/>
</Style>
</Button.Styles>
<Path Margin="2" Stretch="Uniform" UseLayoutRounding="False" Data="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z" />
</Button>
</StackPanel>
</DataTemplate>
</TabStrip.DataTemplates>
</TabStrip>
<Grid Background="{DynamicResource ApplicationAccentBrushLow}" Height="2" DockPanel.Dock="Top" IsVisible="{Binding #PART_TabStrip.IsVisible}" x:CompileBindings="False" />
<Border BorderThickness="1" BorderBrush="{DynamicResource ThemeBorderLowBrush}">
<ContentControl Content="{Binding ActiveDockable}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
</Border>
</DockPanel>
</ControlTemplate>
</Setter>
</Style>
</Styles>