generic.xaml 73 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059
  1. <!--***********************************************************************************
  2. Extended WPF Toolkit
  3. Copyright (C) 2007-2013 Xceed Software Inc.
  4. This program is provided to you under the terms of the Microsoft Public
  5. License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license
  6. For more features, controls, and fast professional support,
  7. pick up the Plus Edition at http://xceed.com/wpf_toolkit
  8. Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids
  9. **********************************************************************************-->
  10. <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  11. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  12. xmlns:shell="clr-namespace:Microsoft.Windows.Shell"
  13. xmlns:avalonDock="clr-namespace:Xceed.Wpf.AvalonDock"
  14. xmlns:avalonDockLayout="clr-namespace:Xceed.Wpf.AvalonDock.Layout"
  15. xmlns:avalonDockControls="clr-namespace:Xceed.Wpf.AvalonDock.Controls"
  16. xmlns:avalonDockConverters="clr-namespace:Xceed.Wpf.AvalonDock.Converters"
  17. xmlns:avalonDockProperties="clr-namespace:Xceed.Wpf.AvalonDock.Properties"
  18. >
  19. <avalonDockConverters:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter"/>
  20. <avalonDockConverters:InverseBoolToVisibilityConverter x:Key="InverseBoolToVisibilityConverter"/>
  21. <avalonDockConverters:AnchorSideToOrientationConverter x:Key="AnchorSideToOrientationConverter"/>
  22. <avalonDockConverters:AnchorSideToAngleConverter x:Key="AnchorSideToAngleConverter"/>
  23. <avalonDockConverters:NullToDoNothingConverter x:Key="NullToDoNothingConverter"/>
  24. <avalonDockConverters:LayoutItemFromLayoutModelConverter x:Key="LayoutItemFromLayoutModelConverter"/>
  25. <avalonDockConverters:ActivateCommandLayoutItemFromLayoutModelConverter x:Key="ActivateCommandLayoutItemFromLayoutModelConverter"/>
  26. <!--DocumentPaneControlStyle-->
  27. <Style x:Key="DocumentPaneControlStyle" TargetType="{x:Type avalonDockControls:LayoutDocumentPaneControl}">
  28. <Setter Property="Template">
  29. <Setter.Value>
  30. <ControlTemplate TargetType="{x:Type avalonDockControls:LayoutDocumentPaneControl}">
  31. <Grid ClipToBounds="true" SnapsToDevicePixels="true" KeyboardNavigation.TabNavigation="Local">
  32. <Grid.RowDefinitions>
  33. <RowDefinition Height="Auto"/>
  34. <RowDefinition Height="*"/>
  35. </Grid.RowDefinitions>
  36. <!--Following border is required to catch mouse events-->
  37. <Border Background="Transparent" Grid.RowSpan="2"/>
  38. <Grid Panel.ZIndex="1">
  39. <Grid.ColumnDefinitions>
  40. <ColumnDefinition/>
  41. <ColumnDefinition Width="Auto"/>
  42. </Grid.ColumnDefinitions>
  43. <avalonDockControls:DocumentPaneTabPanel x:Name="HeaderPanel" Grid.Column="0" IsItemsHost="true" Grid.Row="0" KeyboardNavigation.TabIndex="1"/>
  44. <avalonDockControls:DropDownButton
  45. x:Name="MenuDropDownButton"
  46. Style="{StaticResource {x:Static ToolBar.ToggleButtonStyleKey}}"
  47. Focusable="False"
  48. Grid.Column="1">
  49. <avalonDockControls:DropDownButton.DropDownContextMenu>
  50. <avalonDockControls:ContextMenuEx
  51. ItemsSource="{Binding Model.ChildrenSorted, RelativeSource={RelativeSource TemplatedParent}}">
  52. <avalonDockControls:ContextMenuEx.ItemContainerStyle>
  53. <Style TargetType="{x:Type avalonDockControls:MenuItemEx}" BasedOn="{StaticResource {x:Type MenuItem}}">
  54. <Setter Property="HeaderTemplate" Value="{Binding Path=Root.Manager.DocumentPaneMenuItemHeaderTemplate}"/>
  55. <Setter Property="HeaderTemplateSelector" Value="{Binding Path=Root.Manager.DocumentPaneMenuItemHeaderTemplateSelector}"/>
  56. <Setter Property="IconTemplate" Value="{Binding Path=Root.Manager.IconContentTemplate}"/>
  57. <Setter Property="IconTemplateSelector" Value="{Binding Path=Root.Manager.IconContentTemplateSelector}"/>
  58. <Setter Property="Command" Value="{Binding Path=., Converter={StaticResource ActivateCommandLayoutItemFromLayoutModelConverter}}"/>
  59. </Style>
  60. </avalonDockControls:ContextMenuEx.ItemContainerStyle>
  61. </avalonDockControls:ContextMenuEx>
  62. </avalonDockControls:DropDownButton.DropDownContextMenu>
  63. <Image Source="/Xceed.Wpf.AvalonDock;component/Themes/Generic/Images/PinDocMenu.png"/>
  64. </avalonDockControls:DropDownButton>
  65. </Grid>
  66. <Border x:Name="ContentPanel"
  67. VerticalAlignment="Stretch"
  68. HorizontalAlignment="Stretch"
  69. BorderBrush="{TemplateBinding BorderBrush}"
  70. BorderThickness="{TemplateBinding BorderThickness}"
  71. Background="{TemplateBinding Background}"
  72. Grid.Column="0"
  73. KeyboardNavigation.DirectionalNavigation="Contained"
  74. Grid.Row="1"
  75. KeyboardNavigation.TabIndex="2"
  76. KeyboardNavigation.TabNavigation="Cycle">
  77. <ContentPresenter x:Name="PART_SelectedContentHost"
  78. ContentSource="SelectedContent"
  79. Margin="{TemplateBinding Padding}"
  80. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
  81. </Border>
  82. </Grid>
  83. <ControlTemplate.Triggers>
  84. <Trigger Property="IsEnabled" Value="false">
  85. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
  86. </Trigger>
  87. <DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Model.ChildrenCount}" Value="0">
  88. <Setter Property="Visibility" Value="Collapsed" TargetName="MenuDropDownButton" />
  89. </DataTrigger>
  90. </ControlTemplate.Triggers>
  91. </ControlTemplate>
  92. </Setter.Value>
  93. </Setter>
  94. <Setter Property="ItemContainerStyle">
  95. <Setter.Value>
  96. <Style TargetType="{x:Type TabItem}">
  97. <Setter Property="Visibility" Value="{Binding IsVisible, Converter={StaticResource BoolToVisibilityConverter}}"/>
  98. <Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}"/>
  99. <Setter Property="ToolTip" Value="{Binding ToolTip}"/>
  100. <Setter Property="Padding" Value="2,0,2,0"/>
  101. <Setter Property="Margin" Value="0,2,0,0"/>
  102. <Setter Property="Template">
  103. <Setter.Value>
  104. <ControlTemplate TargetType="{x:Type TabItem}">
  105. <Grid SnapsToDevicePixels="true">
  106. <Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}"
  107. Background="{TemplateBinding Background}"
  108. Padding="{TemplateBinding Padding}"
  109. BorderThickness="1,1,1,0" >
  110. <ContentPresenter
  111. x:Name="Content"
  112. ContentSource="Header"
  113. HorizontalAlignment="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"
  114. VerticalAlignment="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"
  115. RecognizesAccessKey="True"
  116. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
  117. </Border>
  118. </Grid>
  119. <ControlTemplate.Triggers>
  120. <Trigger Property="Selector.IsSelected" Value="true">
  121. <Setter Property="Background" Value="White" />
  122. <Setter Property="Panel.ZIndex" Value="1" />
  123. <Setter Property="Margin" Value="0,0,0,-2"/>
  124. <Setter Property="Margin" TargetName="Content" Value="0,0,0,3"/>
  125. </Trigger>
  126. <MultiTrigger>
  127. <MultiTrigger.Conditions>
  128. <Condition Property="IsMouseOver" Value="true"/>
  129. <Condition Property="Selector.IsSelected" Value="false"/>
  130. </MultiTrigger.Conditions>
  131. <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.GradientInactiveCaptionBrushKey}}" />
  132. <Setter Property="BorderBrush" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}" />
  133. <Setter Property="Panel.ZIndex" Value="0" />
  134. </MultiTrigger>
  135. <Trigger Property="IsEnabled" Value="false">
  136. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
  137. </Trigger>
  138. </ControlTemplate.Triggers>
  139. </ControlTemplate>
  140. </Setter.Value>
  141. </Setter>
  142. </Style>
  143. </Setter.Value>
  144. </Setter>
  145. <Setter Property="ItemTemplate">
  146. <Setter.Value>
  147. <DataTemplate>
  148. <avalonDockControls:LayoutDocumentTabItem Model="{Binding}"/>
  149. </DataTemplate>
  150. </Setter.Value>
  151. </Setter>
  152. <Setter Property="ContentTemplate">
  153. <Setter.Value>
  154. <DataTemplate>
  155. <avalonDockControls:LayoutDocumentControl Model="{Binding}"/>
  156. </DataTemplate>
  157. </Setter.Value>
  158. </Setter>
  159. </Style>
  160. <!--AnchorablePaneControlStyle-->
  161. <Style x:Key="AnchorablePaneControlStyle" TargetType="{x:Type avalonDockControls:LayoutAnchorablePaneControl}">
  162. <Setter Property="TabStripPlacement" Value="Bottom"/>
  163. <Setter Property="Template">
  164. <Setter.Value>
  165. <ControlTemplate TargetType="{x:Type avalonDockControls:LayoutAnchorablePaneControl}">
  166. <Grid ClipToBounds="true"
  167. SnapsToDevicePixels="true"
  168. KeyboardNavigation.TabNavigation="Local"
  169. >
  170. <Grid.RowDefinitions>
  171. <RowDefinition Height="*"/>
  172. <RowDefinition Height="Auto"/>
  173. </Grid.RowDefinitions>
  174. <!--Following border is required to catch mouse events-->
  175. <Border Background="Transparent" Grid.RowSpan="2"/>
  176. <Border x:Name="ContentPanel"
  177. BorderBrush="{TemplateBinding BorderBrush}"
  178. BorderThickness="{TemplateBinding BorderThickness}"
  179. Background="{TemplateBinding Background}"
  180. Grid.Column="0"
  181. KeyboardNavigation.DirectionalNavigation="Contained"
  182. Grid.Row="0"
  183. KeyboardNavigation.TabIndex="2"
  184. KeyboardNavigation.TabNavigation="Cycle">
  185. <ContentPresenter x:Name="PART_SelectedContentHost"
  186. ContentSource="SelectedContent"
  187. Margin="{TemplateBinding Padding}"
  188. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
  189. </Border>
  190. <avalonDockControls:AnchorablePaneTabPanel x:Name="HeaderPanel" Margin="2,0,2,2" IsItemsHost="true" Grid.Row="1" KeyboardNavigation.TabIndex="1" Panel.ZIndex="1"/>
  191. </Grid>
  192. <ControlTemplate.Triggers>
  193. <Trigger Property="IsEnabled" Value="false">
  194. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
  195. </Trigger>
  196. </ControlTemplate.Triggers>
  197. </ControlTemplate>
  198. </Setter.Value>
  199. </Setter>
  200. <Setter Property="ItemContainerStyle">
  201. <Setter.Value>
  202. <Style TargetType="{x:Type TabItem}">
  203. <Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}"/>
  204. <Setter Property="ToolTip" Value="{Binding ToolTip}"/>
  205. <Setter Property="Template">
  206. <Setter.Value>
  207. <ControlTemplate TargetType="{x:Type TabItem}">
  208. <Grid SnapsToDevicePixels="true">
  209. <Border x:Name="Bd"
  210. BorderBrush="{TemplateBinding BorderBrush}"
  211. BorderThickness="1,0,1,1"
  212. Background="{TemplateBinding Background}"
  213. Padding="{TemplateBinding Padding}">
  214. <ContentPresenter
  215. x:Name="Content"
  216. ContentSource="Header"
  217. HorizontalAlignment="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"
  218. VerticalAlignment="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"
  219. RecognizesAccessKey="True"
  220. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
  221. </Border>
  222. </Grid>
  223. <ControlTemplate.Triggers>
  224. <Trigger Property="Selector.IsSelected"
  225. Value="true">
  226. <Setter Property="Background"
  227. Value="White" />
  228. <Setter Property="Panel.ZIndex"
  229. Value="1" />
  230. <Setter Property="Margin" Value="0,-1,-1,-2"/>
  231. </Trigger>
  232. <MultiTrigger>
  233. <MultiTrigger.Conditions>
  234. <Condition Property="IsMouseOver" Value="true"/>
  235. <Condition Property="Selector.IsSelected" Value="false"/>
  236. </MultiTrigger.Conditions>
  237. <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.GradientInactiveCaptionBrushKey}}" />
  238. <Setter Property="BorderBrush" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}" />
  239. <Setter Property="Panel.ZIndex" Value="0" />
  240. </MultiTrigger>
  241. <Trigger Property="IsEnabled" Value="false">
  242. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
  243. </Trigger>
  244. </ControlTemplate.Triggers>
  245. </ControlTemplate>
  246. </Setter.Value>
  247. </Setter>
  248. <Style.Triggers>
  249. <DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type TabControl}}, Path=Items.Count, FallbackValue=1}" Value="1">
  250. <Setter Property="Visibility" Value="Collapsed"/>
  251. </DataTrigger>
  252. </Style.Triggers>
  253. </Style>
  254. </Setter.Value>
  255. </Setter>
  256. <Setter Property="ItemTemplate">
  257. <Setter.Value>
  258. <DataTemplate>
  259. <avalonDockControls:LayoutAnchorableTabItem Model="{Binding}"/>
  260. </DataTemplate>
  261. </Setter.Value>
  262. </Setter>
  263. <Setter Property="ContentTemplate">
  264. <Setter.Value>
  265. <DataTemplate>
  266. <avalonDockControls:LayoutAnchorableControl Model="{Binding}"/>
  267. </DataTemplate>
  268. </Setter.Value>
  269. </Setter>
  270. </Style>
  271. <Style TargetType="avalonDockControls:AnchorablePaneTitle">
  272. <Setter Property="Template">
  273. <Setter.Value>
  274. <ControlTemplate>
  275. <Border Background="{TemplateBinding Background}"
  276. BorderBrush="{TemplateBinding BorderBrush}"
  277. BorderThickness="{TemplateBinding BorderThickness}">
  278. <Grid>
  279. <Grid.ColumnDefinitions>
  280. <ColumnDefinition Width="*"/>
  281. <ColumnDefinition Width="Auto"/>
  282. <ColumnDefinition Width="Auto"/>
  283. <ColumnDefinition Width="Auto"/>
  284. </Grid.ColumnDefinitions>
  285. <avalonDockControls:DropDownControlArea
  286. DropDownContextMenu="{Binding Model.Root.Manager.AnchorableContextMenu, RelativeSource={RelativeSource TemplatedParent}}"
  287. DropDownContextMenuDataContext="{Binding Path=LayoutItem, RelativeSource={RelativeSource TemplatedParent}}"
  288. >
  289. <ContentPresenter Content="{Binding Model, RelativeSource={RelativeSource TemplatedParent}}"
  290. ContentTemplate="{Binding Model.Root.Manager.AnchorableTitleTemplate, RelativeSource={RelativeSource TemplatedParent}}"
  291. ContentTemplateSelector="{Binding Model.Root.Manager.AnchorableTitleTemplateSelector, RelativeSource={RelativeSource TemplatedParent}}"/>
  292. </avalonDockControls:DropDownControlArea>
  293. <avalonDockControls:DropDownButton
  294. Style="{StaticResource {x:Static ToolBar.ToggleButtonStyleKey}}"
  295. Focusable="False"
  296. Grid.Column="1"
  297. DropDownContextMenu="{Binding Model.Root.Manager.AnchorableContextMenu, RelativeSource={RelativeSource TemplatedParent}}"
  298. DropDownContextMenuDataContext="{Binding Path=LayoutItem, RelativeSource={RelativeSource TemplatedParent}}"
  299. ToolTip="{x:Static avalonDockProperties:Resources.Anchorable_CxMenu_Hint}"
  300. >
  301. <Image Source="/Xceed.Wpf.AvalonDock;component/Themes/Generic/Images/PinMenu.png"/>
  302. </avalonDockControls:DropDownButton>
  303. <Button x:Name="PART_AutoHidePin"
  304. Grid.Column="2"
  305. Focusable="False"
  306. Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
  307. Visibility="{Binding Path=IsEnabled, RelativeSource={RelativeSource Self}, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}"
  308. Command="{Binding Path=LayoutItem.AutoHideCommand, RelativeSource={RelativeSource TemplatedParent}}"
  309. ToolTip="{x:Static avalonDockProperties:Resources.Anchorable_BtnAutoHide_Hint}">
  310. <Image Source="/Xceed.Wpf.AvalonDock;component/Themes/Generic/Images/PinAutoHide.png"/>
  311. </Button>
  312. <Button x:Name="PART_HidePin"
  313. Grid.Column="3"
  314. Focusable="False"
  315. Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
  316. Visibility="{Binding Path=IsEnabled, RelativeSource={RelativeSource Self}, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}"
  317. Command="{Binding Path=LayoutItem.HideCommand, RelativeSource={RelativeSource TemplatedParent}}"
  318. ToolTip="{x:Static avalonDockProperties:Resources.Anchorable_BtnClose_Hint}">
  319. <Image Source="/Xceed.Wpf.AvalonDock;component/Themes/Generic/Images/PinClose.png"/>
  320. </Button>
  321. </Grid>
  322. </Border>
  323. <ControlTemplate.Triggers>
  324. <DataTrigger Binding="{Binding Model.IsAutoHidden, RelativeSource={RelativeSource Mode=Self}}" Value="True">
  325. <Setter Property="LayoutTransform" TargetName="PART_AutoHidePin">
  326. <Setter.Value>
  327. <RotateTransform Angle="90"/>
  328. </Setter.Value>
  329. </Setter>
  330. </DataTrigger>
  331. </ControlTemplate.Triggers>
  332. </ControlTemplate>
  333. </Setter.Value>
  334. </Setter>
  335. </Style>
  336. <ControlTemplate x:Key="AnchorSideTemplate" TargetType="{x:Type avalonDockControls:LayoutAnchorSideControl}">
  337. <ItemsControl ItemsSource="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Children}">
  338. <ItemsControl.ItemsPanel>
  339. <ItemsPanelTemplate>
  340. <StackPanel Orientation="{Binding Path=Model.Side, RelativeSource={RelativeSource AncestorType={x:Type avalonDockControls:LayoutAnchorSideControl}, Mode=FindAncestor}, Converter={StaticResource AnchorSideToOrientationConverter}}"/>
  341. </ItemsPanelTemplate>
  342. </ItemsControl.ItemsPanel>
  343. </ItemsControl>
  344. </ControlTemplate>
  345. <ControlTemplate x:Key="AnchorGroupTemplate" TargetType="{x:Type avalonDockControls:LayoutAnchorGroupControl}">
  346. <ItemsControl
  347. ItemsSource="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Children}"
  348. >
  349. <ItemsControl.LayoutTransform>
  350. <RotateTransform Angle="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Model.Parent.Side, Converter={StaticResource AnchorSideToAngleConverter}}"/>
  351. </ItemsControl.LayoutTransform>
  352. <ItemsControl.ItemsPanel>
  353. <ItemsPanelTemplate>
  354. <StackPanel Orientation="Horizontal"/>
  355. </ItemsPanelTemplate>
  356. </ItemsControl.ItemsPanel>
  357. </ItemsControl>
  358. </ControlTemplate>
  359. <ControlTemplate x:Key="AnchorTemplate" TargetType="{x:Type avalonDockControls:LayoutAnchorControl}">
  360. <Border BorderThickness="1"
  361. BorderBrush="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}"
  362. Margin="2"
  363. Padding="2">
  364. <ContentPresenter Content="{Binding Model, RelativeSource={RelativeSource TemplatedParent}}"
  365. ContentTemplate="{Binding AnchorableHeaderTemplate, Mode=OneWay, RelativeSource={RelativeSource AncestorType={x:Type avalonDock:DockingManager}, Mode=FindAncestor}}"
  366. ContentTemplateSelector="{Binding AnchorableHeaderTemplateSelector, Mode=OneWay, RelativeSource={RelativeSource AncestorType={x:Type avalonDock:DockingManager}, Mode=FindAncestor}}"/>
  367. </Border>
  368. </ControlTemplate>
  369. <Style x:Key="{x:Type avalonDockControls:OverlayWindow}" TargetType="{x:Type avalonDockControls:OverlayWindow}">
  370. <Setter Property="Background" Value="Transparent"/>
  371. <Setter Property="Template">
  372. <Setter.Value>
  373. <ControlTemplate TargetType="{x:Type avalonDockControls:OverlayWindow}">
  374. <Canvas x:Name="PART_DropTargetsContainer" Opacity="0.9">
  375. <Path x:Name="PART_PreviewBox" Fill="AliceBlue" StrokeThickness="2" Stroke="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
  376. <Grid x:Name="PART_DockingManagerDropTargets" >
  377. <Image x:Name="PART_DockingManagerDropTargetLeft" VerticalAlignment="Center" HorizontalAlignment="Left" Source="/Xceed.Wpf.AvalonDock;component/Themes/Generic/Images/DockLeft.PNG" Stretch="None" />
  378. <Image x:Name="PART_DockingManagerDropTargetRight" VerticalAlignment="Center" HorizontalAlignment="Right" Source="/Xceed.Wpf.AvalonDock;component/Themes/Generic/Images/DockRight.PNG" Stretch="None" />
  379. <Image x:Name="PART_DockingManagerDropTargetBottom" VerticalAlignment="Bottom" HorizontalAlignment="Center" Source="/Xceed.Wpf.AvalonDock;component/Themes/Generic/Images/DockBottom.PNG" Stretch="None" />
  380. <Image x:Name="PART_DockingManagerDropTargetTop" VerticalAlignment="Top" HorizontalAlignment="Center" Source="/Xceed.Wpf.AvalonDock;component/Themes/Generic/Images/DockTop.PNG" Stretch="None"/>
  381. </Grid>
  382. <Grid x:Name="PART_AnchorablePaneDropTargets">
  383. <Grid Width="88" Height="88" VerticalAlignment="Center" HorizontalAlignment="Center">
  384. <Grid.ColumnDefinitions>
  385. <ColumnDefinition/>
  386. <ColumnDefinition/>
  387. <ColumnDefinition/>
  388. </Grid.ColumnDefinitions>
  389. <Grid.RowDefinitions>
  390. <RowDefinition/>
  391. <RowDefinition/>
  392. <RowDefinition/>
  393. </Grid.RowDefinitions>
  394. <Image Grid.ColumnSpan="3" Grid.RowSpan="3" Source="/Xceed.Wpf.AvalonDock;component/Themes/Generic/Images/DockPaneEmpty.PNG" Stretch="Uniform"/>
  395. <Border Name="PART_AnchorablePaneDropTargetTop" Grid.Column="1" Grid.Row="0">
  396. <Image Source="/Xceed.Wpf.AvalonDock;component/Themes/Generic/Images/InnerDockPaneTop.png" Stretch="None"/>
  397. </Border>
  398. <Border Name="PART_AnchorablePaneDropTargetRight" Grid.Column="2" Grid.Row="1">
  399. <Image Source="/Xceed.Wpf.AvalonDock;component/Themes/Generic/Images/InnerDockPaneRight.png" Stretch="None"/>
  400. </Border>
  401. <Border Name="PART_AnchorablePaneDropTargetBottom" Grid.Column="1" Grid.Row="2">
  402. <Image Source="/Xceed.Wpf.AvalonDock;component/Themes/Generic/Images/InnerDockPaneBottom.png" Stretch="None"/>
  403. </Border>
  404. <Border Name="PART_AnchorablePaneDropTargetLeft" Grid.Column="0" Grid.Row="1">
  405. <Image Source="/Xceed.Wpf.AvalonDock;component/Themes/Generic/Images/InnerDockPaneLeft.png" Stretch="None"/>
  406. </Border>
  407. <Border Name="PART_AnchorablePaneDropTargetInto" Grid.Column="1" Grid.Row="1">
  408. <Image Source="/Xceed.Wpf.AvalonDock;component/Themes/Generic/Images/InnerDockPaneInside.png" Stretch="None"/>
  409. </Border>
  410. </Grid>
  411. </Grid>
  412. <Grid x:Name="PART_DocumentPaneDropTargets">
  413. <Grid Width="88" Height="88" VerticalAlignment="Center" HorizontalAlignment="Center">
  414. <Grid.ColumnDefinitions>
  415. <ColumnDefinition/>
  416. <ColumnDefinition/>
  417. <ColumnDefinition/>
  418. </Grid.ColumnDefinitions>
  419. <Grid.RowDefinitions>
  420. <RowDefinition/>
  421. <RowDefinition/>
  422. <RowDefinition/>
  423. </Grid.RowDefinitions>
  424. <Image Grid.ColumnSpan="3" Grid.RowSpan="3" Source="/Xceed.Wpf.AvalonDock;component/Themes/Generic/Images/DockPaneEmpty.PNG" Stretch="Uniform"/>
  425. <Border Name="PART_DocumentPaneDropTargetTop" Grid.Column="1" Grid.Row="0">
  426. <Image Source="/Xceed.Wpf.AvalonDock;component/Themes/Generic/Images/InnerDockDocPaneTop.png" Stretch="None"/>
  427. </Border>
  428. <Border Name="PART_DocumentPaneDropTargetRight" Grid.Column="2" Grid.Row="1">
  429. <Image Source="/Xceed.Wpf.AvalonDock;component/Themes/Generic/Images/InnerDockDocPaneRight.png" Stretch="None"/>
  430. </Border>
  431. <Border Name="PART_DocumentPaneDropTargetBottom" Grid.Column="1" Grid.Row="2">
  432. <Image Source="/Xceed.Wpf.AvalonDock;component/Themes/Generic/Images/InnerDockDocPaneBottom.png" Stretch="None"/>
  433. </Border>
  434. <Border Name="PART_DocumentPaneDropTargetLeft" Grid.Column="0" Grid.Row="1">
  435. <Image Source="/Xceed.Wpf.AvalonDock;component/Themes/Generic/Images/InnerDockDocPaneLeft.png" Stretch="None"/>
  436. </Border>
  437. <Border Name="PART_DocumentPaneDropTargetInto" Grid.Column="1" Grid.Row="1">
  438. <Image Source="/Xceed.Wpf.AvalonDock;component/Themes/Generic/Images/InnerDockPaneInside.png" Stretch="None"/>
  439. </Border>
  440. </Grid>
  441. </Grid>
  442. </Canvas>
  443. </ControlTemplate>
  444. </Setter.Value>
  445. </Setter>
  446. </Style>
  447. <DataTemplate x:Key="DocumentHeaderTemplate">
  448. <TextBlock Text="{Binding Title}" TextTrimming="CharacterEllipsis"/>
  449. </DataTemplate>
  450. <DataTemplate x:Key="AnchorableHeaderTemplate">
  451. <Grid>
  452. <Grid.ColumnDefinitions>
  453. <ColumnDefinition Width="Auto"/>
  454. <ColumnDefinition/>
  455. </Grid.ColumnDefinitions>
  456. <Image x:Name="icon" Source="{Binding IconSource, Converter={StaticResource NullToDoNothingConverter}}" Stretch="Uniform"/>
  457. <TextBlock x:Name="title" Margin="4,0,0,0" Text="{Binding Title}" TextTrimming="CharacterEllipsis" Grid.Column="1"/>
  458. </Grid>
  459. <DataTemplate.Triggers>
  460. <DataTrigger Binding="{Binding IconSource}" Value="{x:Null}">
  461. <Setter Property="Margin" Value="0" TargetName="title"/>
  462. </DataTrigger>
  463. </DataTemplate.Triggers>
  464. </DataTemplate>
  465. <DataTemplate x:Key="DocumentTitleTemplate">
  466. <TextBlock Text="{Binding Title}" TextTrimming="CharacterEllipsis"/>
  467. </DataTemplate>
  468. <DataTemplate x:Key="AnchorableTitleTemplate">
  469. <TextBlock Text="{Binding Title}" TextTrimming="CharacterEllipsis"/>
  470. </DataTemplate>
  471. <DataTemplate x:Key="IconContentTemplate">
  472. <Image Source="{Binding IconSource, Converter={StaticResource NullToDoNothingConverter}}" Stretch="Uniform"/>
  473. </DataTemplate>
  474. <ContextMenu x:Key="AnchorableContextMenu">
  475. <MenuItem Header="{x:Static avalonDockProperties:Resources.Anchorable_Float}"
  476. Command="{Binding Path=FloatCommand}"/>
  477. <MenuItem Header="{x:Static avalonDockProperties:Resources.Anchorable_Dock}"
  478. Command="{Binding Path=DockCommand}"/>
  479. <MenuItem Header="{x:Static avalonDockProperties:Resources.Anchorable_DockAsDocument}"
  480. Command="{Binding Path=DockAsDocumentCommand}"/>
  481. <MenuItem Header="{x:Static avalonDockProperties:Resources.Anchorable_AutoHide}"
  482. Command="{Binding Path=AutoHideCommand}"/>
  483. <MenuItem Header="{x:Static avalonDockProperties:Resources.Anchorable_Hide}"
  484. Command="{Binding Path=HideCommand}"
  485. Visibility="{Binding Path=IsEnabled, RelativeSource={RelativeSource Self}, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}"/>
  486. </ContextMenu>
  487. <ContextMenu x:Key="DocumentContextMenu">
  488. <MenuItem Header="{x:Static avalonDockProperties:Resources.Document_Close}"
  489. Command="{Binding Path=CloseCommand}"
  490. Visibility="{Binding Path=IsEnabled, RelativeSource={RelativeSource Self}, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}"/>
  491. <MenuItem Header="{x:Static avalonDockProperties:Resources.Document_CloseAllButThis}"
  492. Command="{Binding Path=CloseAllButThisCommand}"/>
  493. <MenuItem Header="{x:Static avalonDockProperties:Resources.Document_Float}"
  494. Command="{Binding Path=FloatCommand}"/>
  495. <MenuItem Header="{x:Static avalonDockProperties:Resources.Document_DockAsDocument}"
  496. Command="{Binding Path=DockAsDocumentCommand}"/>
  497. <MenuItem Header="{x:Static avalonDockProperties:Resources.Document_NewHorizontalTabGroup}"
  498. Command="{Binding Path=NewHorizontalTabGroupCommand}"
  499. Visibility="{Binding Path=IsEnabled, RelativeSource={RelativeSource Self}, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}"/>
  500. <MenuItem Header="{x:Static avalonDockProperties:Resources.Document_NewVerticalTabGroup}"
  501. Command="{Binding Path=NewVerticalTabGroupCommand}"
  502. Visibility="{Binding Path=IsEnabled, RelativeSource={RelativeSource Self}, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}"/>
  503. <MenuItem Header="{x:Static avalonDockProperties:Resources.Document_MoveToNextTabGroup}"
  504. Command="{Binding Path=MoveToNextTabGroupCommand}"
  505. Visibility="{Binding Path=IsEnabled, RelativeSource={RelativeSource Self}, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}"/>
  506. <MenuItem Header="{x:Static avalonDockProperties:Resources.Document_MoveToPreviousTabGroup}"
  507. Command="{Binding Path=MoveToPreviousTabGroupCommand}"
  508. Visibility="{Binding Path=IsEnabled, RelativeSource={RelativeSource Self}, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}"/>
  509. </ContextMenu>
  510. <!--DockingManager-->
  511. <Style x:Key="{x:Type avalonDock:DockingManager}" TargetType="{x:Type avalonDock:DockingManager}">
  512. <Setter Property="DocumentPaneControlStyle" Value="{StaticResource DocumentPaneControlStyle}"/>
  513. <Setter Property="AnchorablePaneControlStyle" Value="{StaticResource AnchorablePaneControlStyle}"/>
  514. <Setter Property="AnchorSideTemplate" Value="{StaticResource AnchorSideTemplate}"/>
  515. <Setter Property="AnchorGroupTemplate" Value="{StaticResource AnchorGroupTemplate}"/>
  516. <Setter Property="AnchorTemplate" Value="{StaticResource AnchorTemplate}"/>
  517. <Setter Property="DocumentHeaderTemplate" Value="{StaticResource DocumentHeaderTemplate}"/>
  518. <Setter Property="AnchorableHeaderTemplate" Value="{StaticResource AnchorableHeaderTemplate}"/>
  519. <Setter Property="DocumentTitleTemplate" Value="{StaticResource DocumentTitleTemplate}"/>
  520. <Setter Property="AnchorableTitleTemplate" Value="{StaticResource AnchorableTitleTemplate}"/>
  521. <Setter Property="AnchorableContextMenu" Value="{StaticResource AnchorableContextMenu}"/>
  522. <Setter Property="DocumentContextMenu" Value="{StaticResource DocumentContextMenu}"/>
  523. <Setter Property="DocumentPaneMenuItemHeaderTemplate" Value="{StaticResource DocumentHeaderTemplate}"/>
  524. <Setter Property="IconContentTemplate" Value="{StaticResource IconContentTemplate}"/>
  525. <Setter Property="Template">
  526. <Setter.Value>
  527. <ControlTemplate TargetType="{x:Type avalonDock:DockingManager}">
  528. <Border Background="{TemplateBinding Background}"
  529. BorderBrush="{TemplateBinding BorderBrush}"
  530. BorderThickness="{TemplateBinding BorderThickness}">
  531. <Grid FlowDirection="LeftToRight">
  532. <Grid.RowDefinitions>
  533. <RowDefinition Height="Auto"/>
  534. <RowDefinition Height="*"/>
  535. <RowDefinition Height="Auto"/>
  536. </Grid.RowDefinitions>
  537. <Grid.ColumnDefinitions>
  538. <ColumnDefinition Width="Auto"/>
  539. <ColumnDefinition Width="*"/>
  540. <ColumnDefinition Width="Auto"/>
  541. </Grid.ColumnDefinitions>
  542. <ContentPresenter Content="{TemplateBinding LayoutRootPanel}" Grid.Column="1" Grid.Row="1"/>
  543. <ContentPresenter Content="{TemplateBinding RightSidePanel}" Grid.Column="2" Grid.Row="1"/>
  544. <ContentPresenter Content="{TemplateBinding LeftSidePanel}" Grid.Column="0" Grid.Row="1"/>
  545. <ContentPresenter Content="{TemplateBinding TopSidePanel}" Grid.Column="1" Grid.Row="0"/>
  546. <ContentPresenter Content="{TemplateBinding BottomSidePanel}" Grid.Column="1" Grid.Row="2"/>
  547. <ContentPresenter
  548. x:Name="PART_AutoHideArea"
  549. Content="{TemplateBinding AutoHideWindow}"
  550. VerticalAlignment="{TemplateBinding VerticalAlignment}"
  551. HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
  552. Grid.Column="1" Grid.Row="1"/> <!---->
  553. </Grid>
  554. </Border>
  555. </ControlTemplate>
  556. </Setter.Value>
  557. </Setter>
  558. </Style>
  559. <!--LayoutGridResizerControl-->
  560. <Style x:Key="{x:Type avalonDockControls:LayoutGridResizerControl}" TargetType="{x:Type avalonDockControls:LayoutGridResizerControl}">
  561. <Setter Property="Background" Value="Transparent"/>
  562. <Setter Property="Template">
  563. <Setter.Value>
  564. <ControlTemplate TargetType="{x:Type avalonDockControls:LayoutGridResizerControl}">
  565. <Border Background="{TemplateBinding Background}"/>
  566. </ControlTemplate>
  567. </Setter.Value>
  568. </Setter>
  569. </Style>
  570. <Style TargetType="{x:Type avalonDockControls:LayoutDocumentControl}">
  571. <Setter Property="Template">
  572. <Setter.Value>
  573. <ControlTemplate TargetType="{x:Type avalonDockControls:LayoutDocumentControl}">
  574. <Border Background="{TemplateBinding Background}"
  575. BorderBrush="{TemplateBinding BorderBrush}"
  576. BorderThickness="{TemplateBinding BorderThickness}">
  577. <ContentPresenter Content="{Binding LayoutItem.View, RelativeSource={RelativeSource TemplatedParent}}"/>
  578. <!--<ContentPresenter Content="{Binding Model.Content, RelativeSource={RelativeSource TemplatedParent}}"
  579. ContentTemplate="{Binding LayoutItemTemplate, Mode=OneWay, RelativeSource={RelativeSource AncestorType={x:Type avalonDock:DockingManager}, Mode=FindAncestor}}"
  580. ContentTemplateSelector="{Binding LayoutItemTemplateSelector, Mode=OneWay, RelativeSource={RelativeSource AncestorType={x:Type avalonDock:DockingManager}, Mode=FindAncestor}}"/>-->
  581. </Border>
  582. </ControlTemplate>
  583. </Setter.Value>
  584. </Setter>
  585. </Style>
  586. <Style TargetType="{x:Type avalonDockControls:LayoutDocumentTabItem}">
  587. <Setter Property="Template">
  588. <Setter.Value>
  589. <ControlTemplate TargetType="{x:Type avalonDockControls:LayoutDocumentTabItem}">
  590. <avalonDockControls:DropDownControlArea
  591. DropDownContextMenu="{Binding Root.Manager.DocumentContextMenu}"
  592. DropDownContextMenuDataContext="{Binding LayoutItem, RelativeSource={RelativeSource TemplatedParent}}" >
  593. <Border Background="{TemplateBinding Background}"
  594. BorderBrush="{TemplateBinding BorderBrush}"
  595. BorderThickness="{TemplateBinding BorderThickness}">
  596. <Grid>
  597. <Grid.ColumnDefinitions>
  598. <ColumnDefinition Width="*"/>
  599. <ColumnDefinition Width="Auto"/>
  600. </Grid.ColumnDefinitions>
  601. <Border Grid.ColumnSpan="2" Background="Transparent"/>
  602. <ContentPresenter Content="{Binding Model, RelativeSource={RelativeSource TemplatedParent}}"
  603. ContentTemplate="{Binding DocumentHeaderTemplate, Mode=OneWay, RelativeSource={RelativeSource AncestorType={x:Type avalonDock:DockingManager}, Mode=FindAncestor}}"
  604. ContentTemplateSelector="{Binding DocumentHeaderTemplateSelector, Mode=OneWay, RelativeSource={RelativeSource AncestorType={x:Type avalonDock:DockingManager}, Mode=FindAncestor}}"/>
  605. <!-- Close button should be moved out to the container style -->
  606. <Button x:Name="DocumentCloseButton" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Grid.Column="1" Margin="5,0,0,0" Visibility="Hidden"
  607. Command="{Binding Path=LayoutItem.CloseCommand, RelativeSource={RelativeSource TemplatedParent}}"
  608. ToolTip="{x:Static avalonDockProperties:Resources.Document_Close}">
  609. <Image Source="/Xceed.Wpf.AvalonDock;component/Themes/Generic/Images/PinClose.png"/>
  610. </Button>
  611. </Grid>
  612. </Border>
  613. </avalonDockControls:DropDownControlArea>
  614. <ControlTemplate.Triggers>
  615. <DataTrigger Binding="{Binding Path=IsSelected}" Value="true">
  616. <Setter Property="Visibility" Value="Visible" TargetName="DocumentCloseButton" />
  617. </DataTrigger>
  618. <Trigger Property="IsMouseOver" Value="True">
  619. <Setter Property="Visibility" Value="Visible" TargetName="DocumentCloseButton" />
  620. </Trigger>
  621. <DataTrigger Binding="{Binding Path=CanClose}" Value="false">
  622. <Setter Property="Visibility" Value="Collapsed" TargetName="DocumentCloseButton" />
  623. </DataTrigger>
  624. </ControlTemplate.Triggers>
  625. </ControlTemplate>
  626. </Setter.Value>
  627. </Setter>
  628. </Style>
  629. <Style TargetType="{x:Type avalonDockControls:LayoutAnchorableTabItem}">
  630. <Setter Property="Template">
  631. <Setter.Value>
  632. <ControlTemplate TargetType="{x:Type avalonDockControls:LayoutAnchorableTabItem}">
  633. <avalonDockControls:DropDownControlArea
  634. DropDownContextMenu="{Binding Root.Manager.AnchorableContextMenu}"
  635. DropDownContextMenuDataContext="{Binding LayoutItem, RelativeSource={RelativeSource TemplatedParent}}">
  636. <Border Background="{TemplateBinding Background}"
  637. BorderBrush="{TemplateBinding BorderBrush}"
  638. BorderThickness="{TemplateBinding BorderThickness}">
  639. <Grid>
  640. <ContentPresenter Content="{Binding Model, RelativeSource={RelativeSource TemplatedParent}}"
  641. ContentTemplate="{Binding AnchorableHeaderTemplate, Mode=OneWay, RelativeSource={RelativeSource AncestorType={x:Type avalonDock:DockingManager}, Mode=FindAncestor}}"
  642. ContentTemplateSelector="{Binding AnchorableHeaderTemplateSelector, Mode=OneWay, RelativeSource={RelativeSource AncestorType={x:Type avalonDock:DockingManager}, Mode=FindAncestor}}"/>
  643. <avalonDockControls:DropDownControlArea
  644. Grid.Column="0"
  645. DropDownContextMenu="{Binding Model.Root.Manager.AnchorableContextMenu, RelativeSource={RelativeSource TemplatedParent}}"
  646. DropDownContextMenuDataContext="{Binding Path=Model, RelativeSource={RelativeSource TemplatedParent}}"/>
  647. </Grid>
  648. </Border>
  649. </avalonDockControls:DropDownControlArea>
  650. </ControlTemplate>
  651. </Setter.Value>
  652. </Setter>
  653. </Style>
  654. <Style TargetType="{x:Type avalonDockControls:LayoutAnchorableControl}">
  655. <Setter Property="Template">
  656. <Setter.Value>
  657. <ControlTemplate TargetType="{x:Type avalonDockControls:LayoutAnchorableControl}">
  658. <Border Background="{TemplateBinding Background}"
  659. BorderBrush="{TemplateBinding BorderBrush}"
  660. BorderThickness="{TemplateBinding BorderThickness}"
  661. KeyboardNavigation.TabNavigation="Cycle">
  662. <Grid>
  663. <Grid.RowDefinitions>
  664. <RowDefinition Height="Auto"/>
  665. <RowDefinition Height="*"/>
  666. </Grid.RowDefinitions>
  667. <Border x:Name="Header">
  668. <avalonDockControls:AnchorablePaneTitle Model="{Binding Model, RelativeSource={RelativeSource TemplatedParent}}"/>
  669. </Border>
  670. <ContentPresenter
  671. Grid.Row="1"
  672. FlowDirection="{TemplateBinding FlowDirection}"
  673. Content="{Binding LayoutItem.View, RelativeSource={RelativeSource TemplatedParent}}"/>
  674. <!--<ContentPresenter
  675. FlowDirection="{TemplateBinding FlowDirection}"
  676. Content="{Binding Model.Content, RelativeSource={RelativeSource TemplatedParent}}"
  677. ContentTemplate="{Binding LayoutItemTemplate, Mode=OneWay, RelativeSource={RelativeSource AncestorType={x:Type avalonDock:DockingManager}, Mode=FindAncestor}}"
  678. ContentTemplateSelector="{Binding LayoutItemTemplateSelector, Mode=OneWay, RelativeSource={RelativeSource AncestorType={x:Type avalonDock:DockingManager}, Mode=FindAncestor}}"
  679. Grid.Row="1"/>-->
  680. </Grid>
  681. </Border>
  682. <ControlTemplate.Triggers>
  683. <MultiDataTrigger>
  684. <MultiDataTrigger.Conditions>
  685. <Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=Model.IsFloating}" Value="True"/>
  686. <Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=Model.Parent.IsDirectlyHostedInFloatingWindow}" Value="True"/>
  687. </MultiDataTrigger.Conditions>
  688. <Setter Property="Visibility" Value="Collapsed" TargetName="Header"/>
  689. </MultiDataTrigger>
  690. </ControlTemplate.Triggers>
  691. </ControlTemplate>
  692. </Setter.Value>
  693. </Setter>
  694. </Style>
  695. <Style x:Key="{x:Type avalonDockControls:LayoutDocumentFloatingWindowControl}" TargetType="{x:Type avalonDockControls:LayoutDocumentFloatingWindowControl}">
  696. <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
  697. <Setter Property="shell:WindowChrome.WindowChrome">
  698. <Setter.Value>
  699. <shell:WindowChrome
  700. ResizeBorderThickness="10"
  701. CaptionHeight="16"
  702. CornerRadius="3,3,3,3"
  703. GlassFrameThickness="0"
  704. ShowSystemMenu="False"/>
  705. </Setter.Value>
  706. </Setter>
  707. <Setter Property="Template">
  708. <Setter.Value>
  709. <ControlTemplate TargetType="{x:Type avalonDockControls:LayoutDocumentFloatingWindowControl}">
  710. <Grid>
  711. <Border x:Name="WindowBorder" BorderThickness="3" Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" BorderBrush="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}">
  712. <Grid Margin="3">
  713. <Grid.RowDefinitions>
  714. <RowDefinition Height="16"/>
  715. <RowDefinition Height="*"/>
  716. </Grid.RowDefinitions>
  717. <Grid>
  718. <Grid.ColumnDefinitions>
  719. <ColumnDefinition Width="*"/>
  720. <ColumnDefinition Width="Auto"/>
  721. <ColumnDefinition Width="Auto"/>
  722. <ColumnDefinition Width="Auto"/>
  723. </Grid.ColumnDefinitions>
  724. <ContentPresenter Content="{Binding Model.RootDocument, RelativeSource={RelativeSource TemplatedParent}}"
  725. ContentTemplate="{Binding Model.Root.Manager.DocumentTitleTemplate, RelativeSource={RelativeSource TemplatedParent}}"
  726. ContentTemplateSelector="{Binding Model.Root.Manager.DocumentTitleTemplateSelector, RelativeSource={RelativeSource TemplatedParent}}"/>
  727. <Button shell:WindowChrome.IsHitTestVisibleInChrome="True"
  728. Focusable="False"
  729. Visibility="{Binding IsMaximized, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource InverseBoolToVisibilityConverter}}"
  730. Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
  731. Command="{x:Static shell:SystemCommands.MaximizeWindowCommand}"
  732. CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}}"
  733. ToolTip="{x:Static avalonDockProperties:Resources.Window_Maximize}"
  734. Grid.Column="2">
  735. <Image Source="/Xceed.Wpf.AvalonDock;component/Themes/Generic/Images/PinMaximize.png"/>
  736. </Button>
  737. <Button shell:WindowChrome.IsHitTestVisibleInChrome="True"
  738. Focusable="False"
  739. Visibility="{Binding IsMaximized, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BoolToVisibilityConverter}}"
  740. Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
  741. Command="{x:Static shell:SystemCommands.RestoreWindowCommand}"
  742. CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}}"
  743. ToolTip="{x:Static avalonDockProperties:Resources.Window_Restore}"
  744. Grid.Column="2">
  745. <Image Source="/Xceed.Wpf.AvalonDock;component/Themes/Generic/Images/PinRestore.png"/>
  746. </Button>
  747. <Button shell:WindowChrome.IsHitTestVisibleInChrome="True"
  748. Focusable="False"
  749. Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
  750. Command="{Binding Path=RootDocumentLayoutItem.CloseCommand, RelativeSource={RelativeSource TemplatedParent}}"
  751. ToolTip="{x:Static avalonDockProperties:Resources.Document_Close}"
  752. Visibility="{Binding Path=IsEnabled, RelativeSource={RelativeSource Self}, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}"
  753. Grid.Column="3">
  754. <Image Source="/Xceed.Wpf.AvalonDock;component/Themes/Generic/Images/PinClose.png"/>
  755. </Button>
  756. </Grid>
  757. <ContentPresenter Content="{TemplateBinding Content}" Grid.Row="1"/>
  758. </Grid>
  759. </Border>
  760. </Grid>
  761. <ControlTemplate.Triggers>
  762. <Trigger Property="WindowState" Value="Maximized">
  763. <Setter Property="Padding" Value="3" TargetName="WindowBorder"/>
  764. </Trigger>
  765. </ControlTemplate.Triggers>
  766. </ControlTemplate>
  767. </Setter.Value>
  768. </Setter>
  769. </Style>
  770. <Style x:Key="{x:Type avalonDockControls:LayoutAnchorableFloatingWindowControl}" TargetType="{x:Type avalonDockControls:LayoutAnchorableFloatingWindowControl}">
  771. <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
  772. <Setter Property="shell:WindowChrome.WindowChrome">
  773. <Setter.Value>
  774. <shell:WindowChrome
  775. ResizeBorderThickness="10"
  776. CaptionHeight="16"
  777. CornerRadius="3,3,3,3"
  778. GlassFrameThickness="0"
  779. ShowSystemMenu="True"/>
  780. </Setter.Value>
  781. </Setter>
  782. <Setter Property="Template">
  783. <Setter.Value>
  784. <ControlTemplate TargetType="{x:Type avalonDockControls:LayoutAnchorableFloatingWindowControl}">
  785. <Grid>
  786. <Border x:Name="WindowBorder" BorderThickness="3" Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" BorderBrush="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}">
  787. <Grid Margin="3">
  788. <Grid.RowDefinitions>
  789. <RowDefinition Height="16"/>
  790. <RowDefinition Height="*"/>
  791. </Grid.RowDefinitions>
  792. <Grid>
  793. <Grid.ColumnDefinitions>
  794. <ColumnDefinition Width="*"/>
  795. <ColumnDefinition Width="Auto"/>
  796. <ColumnDefinition Width="Auto"/>
  797. <ColumnDefinition Width="Auto"/>
  798. </Grid.ColumnDefinitions>
  799. <Border
  800. Visibility="{Binding Path=Model.IsSinglePane, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BoolToVisibilityConverter}}">
  801. <avalonDockControls:DropDownControlArea
  802. DropDownContextMenu="{Binding Model.Root.Manager.AnchorableContextMenu, RelativeSource={RelativeSource TemplatedParent}}"
  803. DropDownContextMenuDataContext="{Binding Path=SingleContentLayoutItem, RelativeSource={RelativeSource TemplatedParent}}">
  804. <ContentPresenter Content="{Binding Model.SinglePane.SelectedContent, RelativeSource={RelativeSource TemplatedParent}}"
  805. ContentTemplate="{Binding Model.Root.Manager.AnchorableTitleTemplate, RelativeSource={RelativeSource TemplatedParent}}"
  806. ContentTemplateSelector="{Binding Model.Root.Manager.AnchorableTitleTemplateSelector, RelativeSource={RelativeSource TemplatedParent}}"/>
  807. </avalonDockControls:DropDownControlArea>
  808. </Border>
  809. <avalonDockControls:DropDownButton
  810. x:Name="SinglePaneContextMenu"
  811. shell:WindowChrome.IsHitTestVisibleInChrome="True"
  812. Visibility="{Binding Path=Model.IsSinglePane, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BoolToVisibilityConverter}}"
  813. Style="{StaticResource {x:Static ToolBar.ToggleButtonStyleKey}}"
  814. Focusable="False"
  815. Grid.Column="1"
  816. DropDownContextMenu="{Binding Model.Root.Manager.AnchorableContextMenu, RelativeSource={RelativeSource TemplatedParent}}"
  817. DropDownContextMenuDataContext="{Binding Path=SingleContentLayoutItem, RelativeSource={RelativeSource TemplatedParent}}"
  818. ToolTip="{x:Static avalonDockProperties:Resources.Anchorable_CxMenu_Hint}">
  819. <Image Source="/Xceed.Wpf.AvalonDock;component/Themes/Generic/Images/PinMenu.png"/>
  820. </avalonDockControls:DropDownButton>
  821. <Button
  822. shell:WindowChrome.IsHitTestVisibleInChrome="True"
  823. Focusable="False"
  824. Visibility="{Binding IsMaximized, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource InverseBoolToVisibilityConverter}}"
  825. Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
  826. Command="{x:Static shell:SystemCommands.MaximizeWindowCommand}"
  827. CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}}"
  828. ToolTip="{x:Static avalonDockProperties:Resources.Window_Maximize}"
  829. Grid.Column="2">
  830. <Image Source="/Xceed.Wpf.AvalonDock;component/Themes/Generic/Images/PinMaximize.png"/>
  831. </Button>
  832. <Button
  833. shell:WindowChrome.IsHitTestVisibleInChrome="True"
  834. Focusable="False"
  835. Visibility="{Binding IsMaximized, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BoolToVisibilityConverter}}"
  836. Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
  837. Command="{x:Static shell:SystemCommands.RestoreWindowCommand}"
  838. CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}}"
  839. ToolTip="{x:Static avalonDockProperties:Resources.Window_Restore}"
  840. Grid.Column="2">
  841. <Image Source="/Xceed.Wpf.AvalonDock;component/Themes/Generic/Images/PinRestore.png"/>
  842. </Button>
  843. <Button
  844. shell:WindowChrome.IsHitTestVisibleInChrome="True"
  845. Focusable="False"
  846. Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
  847. Command="{Binding HideWindowCommand, RelativeSource={RelativeSource TemplatedParent}}"
  848. ToolTip="{x:Static avalonDockProperties:Resources.Anchorable_BtnClose_Hint}"
  849. Visibility="{Binding Path=IsEnabled, RelativeSource={RelativeSource Self}, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}"
  850. Grid.Column="3">
  851. <Image Source="/Xceed.Wpf.AvalonDock;component/Themes/Generic/Images/PinClose.png"/>
  852. </Button>
  853. </Grid>
  854. <ContentPresenter
  855. Content="{TemplateBinding Content}" Grid.Row="1"/>
  856. </Grid>
  857. </Border>
  858. </Grid>
  859. <ControlTemplate.Triggers>
  860. <Trigger Property="WindowState" Value="Maximized">
  861. <Setter Property="Padding" Value="3" TargetName="WindowBorder"/>
  862. </Trigger>
  863. <Trigger Property="IsKeyboardFocused" Value="True">
  864. <Setter TargetName="WindowBorder" Property="BorderBrush" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
  865. </Trigger>
  866. </ControlTemplate.Triggers>
  867. </ControlTemplate>
  868. </Setter.Value>
  869. </Setter>
  870. </Style>
  871. <Style x:Key="{x:Type avalonDockControls:LayoutAutoHideWindowControl}" TargetType="{x:Type avalonDockControls:LayoutAutoHideWindowControl}">
  872. <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
  873. </Style>
  874. <Style x:Key="{x:Type avalonDockControls:NavigatorWindow}" TargetType="{x:Type avalonDockControls:NavigatorWindow}">
  875. <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
  876. <Setter Property="SizeToContent" Value="WidthAndHeight"/>
  877. <Setter Property="ResizeMode" Value="NoResize"/>
  878. <Setter Property="shell:WindowChrome.WindowChrome">
  879. <Setter.Value>
  880. <shell:WindowChrome
  881. ResizeBorderThickness="10"
  882. CaptionHeight="16"
  883. CornerRadius="3,3,3,3"
  884. GlassFrameThickness="4"/>
  885. </Setter.Value>
  886. </Setter>
  887. <Setter Property="Template">
  888. <Setter.Value>
  889. <ControlTemplate TargetType="{x:Type avalonDockControls:NavigatorWindow}">
  890. <Grid>
  891. <Border x:Name="WindowBorder" BorderThickness="3"
  892. Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"
  893. BorderBrush="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}">
  894. <Grid Margin="5">
  895. <Grid.RowDefinitions>
  896. <RowDefinition Height="54"/>
  897. <RowDefinition Height="*"/>
  898. <RowDefinition Height="42"/>
  899. </Grid.RowDefinitions>
  900. <Grid>
  901. <Grid.RowDefinitions>
  902. <RowDefinition/>
  903. <RowDefinition/>
  904. </Grid.RowDefinitions>
  905. <Grid>
  906. <Grid.ColumnDefinitions>
  907. <ColumnDefinition Width="Auto"/>
  908. <ColumnDefinition/>
  909. </Grid.ColumnDefinitions>
  910. <Image Source="{Binding SelectedDocument.LayoutElement.IconSource, Converter={StaticResource NullToDoNothingConverter}}" Stretch="None"/>
  911. <TextBlock Text="{Binding SelectedDocument.LayoutElement.Title}" TextTrimming="CharacterEllipsis" Grid.Column="1" VerticalAlignment="Center" FontWeight="Bold" Margin="4,0,0,0"/>
  912. </Grid>
  913. <TextBlock Text="{Binding SelectedDocument.LayoutElement.Description}" TextTrimming="CharacterEllipsis" VerticalAlignment="Center"/>
  914. </Grid>
  915. <Grid Grid.Row="1">
  916. <Grid.ColumnDefinitions>
  917. <ColumnDefinition Width="Auto"/>
  918. <ColumnDefinition/>
  919. </Grid.ColumnDefinitions>
  920. <Grid Margin="5">
  921. <Grid.RowDefinitions>
  922. <RowDefinition Height="Auto"/>
  923. <RowDefinition/>
  924. </Grid.RowDefinitions>
  925. <TextBlock Text="Active Tool Windows" FontWeight="Bold" Margin="0,3,0,4"/>
  926. <ListBox Grid.Row="1" ItemsSource="{Binding Anchorables}" SelectedItem="{Binding SelectedAnchorable, Mode=TwoWay}" Background="Transparent" BorderThickness="0" MaxHeight="400" FocusVisualStyle="{x:Null}">
  927. <ListBox.ItemContainerStyle>
  928. <Style TargetType="ListBoxItem">
  929. <Setter Property="Cursor" Value="Hand"/>
  930. <Style.Triggers>
  931. <Trigger Property="IsMouseOver" Value="True">
  932. <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
  933. <Setter Property="TextElement.Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}"/>
  934. </Trigger>
  935. </Style.Triggers>
  936. </Style>
  937. </ListBox.ItemContainerStyle>
  938. <ListBox.ItemTemplate>
  939. <DataTemplate>
  940. <Grid>
  941. <Grid.ColumnDefinitions>
  942. <ColumnDefinition Width="Auto"/>
  943. <ColumnDefinition/>
  944. </Grid.ColumnDefinitions>
  945. <Image Source="{Binding LayoutElement.IconSource, Converter={StaticResource NullToDoNothingConverter}}" Stretch="None"/>
  946. <TextBlock Text="{Binding LayoutElement.Title}" TextTrimming="CharacterEllipsis" Grid.Column="1" Margin="4,2,0,2"/>
  947. </Grid>
  948. </DataTemplate>
  949. </ListBox.ItemTemplate>
  950. </ListBox>
  951. </Grid>
  952. <Grid Grid.Column="1" Margin="5">
  953. <Grid.RowDefinitions>
  954. <RowDefinition Height="Auto"/>
  955. <RowDefinition/>
  956. </Grid.RowDefinitions>
  957. <TextBlock Text="Active Files" FontWeight="Bold" Margin="0,3,0,4"/>
  958. <ListBox Grid.Row="1" ItemsSource="{Binding Documents}" SelectedItem="{Binding SelectedDocument, Mode=TwoWay}" Background="Transparent" BorderThickness="0" MaxHeight="400" FocusVisualStyle="{x:Null}">
  959. <ListBox.ItemContainerStyle>
  960. <Style TargetType="ListBoxItem">
  961. <Setter Property="Cursor" Value="Hand"/>
  962. <Style.Triggers>
  963. <Trigger Property="IsMouseOver" Value="True">
  964. <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
  965. <Setter Property="TextElement.Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}"/>
  966. </Trigger>
  967. </Style.Triggers>
  968. </Style>
  969. </ListBox.ItemContainerStyle>
  970. <ListBox.ItemTemplate>
  971. <DataTemplate>
  972. <Grid>
  973. <Grid.ColumnDefinitions>
  974. <ColumnDefinition Width="Auto"/>
  975. <ColumnDefinition/>
  976. </Grid.ColumnDefinitions>
  977. <Image Source="{Binding LayoutElement.IconSource, Converter={StaticResource NullToDoNothingConverter}}" Stretch="None"/>
  978. <TextBlock Text="{Binding LayoutElement.Title}" TextTrimming="CharacterEllipsis" Grid.Column="1" Margin="4,2,0,2"/>
  979. </Grid>
  980. </DataTemplate>
  981. </ListBox.ItemTemplate>
  982. <ListBox.ItemsPanel>
  983. <ItemsPanelTemplate>
  984. <WrapPanel Orientation="Vertical"/>
  985. </ItemsPanelTemplate>
  986. </ListBox.ItemsPanel>
  987. </ListBox>
  988. </Grid>
  989. </Grid>
  990. <Grid Grid.Row="2">
  991. <TextBlock Text="{Binding SelectedDocument.LayoutElement.ToolTip}" VerticalAlignment="Center"/>
  992. </Grid>
  993. </Grid>
  994. </Border>
  995. </Grid>
  996. </ControlTemplate>
  997. </Setter.Value>
  998. </Setter>
  999. </Style>
  1000. </ResourceDictionary>