This repository has been archived by the owner on Dec 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainWindow.xaml
65 lines (63 loc) · 3.89 KB
/
MainWindow.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
<Window x:Class="WpfApplication1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"
xmlns:dxd="http://schemas.devexpress.com/winfx/2008/xaml/docking"
xmlns:local="clr-namespace:WpfApplication1"
Width="525"
Height="350"
Title="MainWindow">
<Window.DataContext>
<local:MainWindowViewModel />
</Window.DataContext>
<Grid>
<dxb:BarManager>
<dxd:DockLayoutManager>
<dxd:LayoutGroup>
<dxd:DocumentGroup ClosePageButtonShowMode="InActiveTabPageHeader"
ItemsSource="{Binding Documents}"
TabHeaderLayoutType="Trim">
<dxd:DocumentGroup.ItemStyle>
<Style TargetType="dxd:DocumentPanel">
<Setter Property="AllowDrag" Value="False" />
<Setter Property="Caption" Value="{Binding DisplayName}" />
<Setter Property="CloseCommand" Value="{Binding Path=(dxd:DockLayoutManager.DockLayoutManager).DataContext.CloseCommand, RelativeSource={RelativeSource Self}}" />
<Setter Property="CloseCommandParameter" Value="{Binding}" />
<Setter Property="AllowActivate" Value="{Binding AllowActivate}" />
<Setter Property="FloatOnDoubleClick" Value="False" />
<Setter Property="ContentTemplate">
<Setter.Value>
<DataTemplate>
<Border Background="AntiqueWhite">
<TextBlock Text="{Binding Content}" />
</Border>
</DataTemplate>
</Setter.Value>
</Setter>
</Style>
</dxd:DocumentGroup.ItemStyle>
<dxd:DocumentGroup.TabItemContainerStyleSelector>
<local:CaptionStyleSelector>
<local:CaptionStyleSelector.AddNewTabStyle>
<Style TargetType="ContentControl">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ContentControl">
<dx:SimpleButton Margin="4"
Command="{Binding Path=(dxd:DockLayoutManager.DockLayoutManager).DataContext.AddNewCommand, RelativeSource={RelativeSource Self}}"
Focusable="False"
Glyph="{dx:DXImage Image=Add_16x16.png}" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</local:CaptionStyleSelector.AddNewTabStyle>
</local:CaptionStyleSelector>
</dxd:DocumentGroup.TabItemContainerStyleSelector>
</dxd:DocumentGroup>
</dxd:LayoutGroup>
</dxd:DockLayoutManager>
</dxb:BarManager>
</Grid>
</Window>