HostWindow.axaml 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <ResourceDictionary xmlns="https://github.com/avaloniaui"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  3. xmlns:core="using:Dock.Model.Core"
  4. xmlns:controls="clr-namespace:Dock.Model.Controls;assembly=Dock.Model">
  5. <Design.PreviewWith>
  6. <HostWindow IsToolWindow="False" Width="300" Height="400" />
  7. </Design.PreviewWith>
  8. <ControlTheme x:Key="{x:Type HostWindow}" TargetType="HostWindow">
  9. <Setter Property="Background" Value="Transparent" />
  10. <Setter Property="(TextElement.FontSize)" Value="{DynamicResource DockFontSizeNormal}" />
  11. <!-- <Setter Property="FontFamily" Value="{TemplateBinding FontFamily}" /> -->
  12. <Setter Property="TextBlock.Foreground" Value="{DynamicResource DockThemeForegroundBrush}" />
  13. <Setter Property="WindowState" Value="Normal" />
  14. <Setter Property="UseLayoutRounding" Value="True" />
  15. <Setter Property="Title" Value="{Binding ActiveDockable.Title}" />
  16. <Setter Property="Topmost" Value="{Binding Window.Topmost}" x:DataType="controls:IRootDock" />
  17. <Setter Property="SystemDecorations" Value="None" />
  18. <Setter Property="ExtendClientAreaToDecorationsHint" Value="True" />
  19. <Setter Property="ExtendClientAreaChromeHints" Value="NoChrome"/>
  20. <Setter Property="ExtendClientAreaTitleBarHeightHint" Value="-1"></Setter>
  21. <Setter Property="Template">
  22. <ControlTemplate>
  23. <Panel>
  24. <Border Name="SelectedBorder"
  25. Margin="10,10"
  26. Padding="0"
  27. BoxShadow="{DynamicResource SukiPopupShadow}"
  28. Background="{DynamicResource SukiCardBackground}"
  29. CornerRadius="20">
  30. <Border CornerRadius="20" ClipToBounds="True">
  31. <Panel>
  32. <Panel Margin="0">
  33. <Panel.Background>
  34. <LinearGradientBrush StartPoint="0%,0%" EndPoint="100%,100%">
  35. <GradientStop Color="{DynamicResource SukiAccentColor5}" Offset="0"></GradientStop>
  36. <GradientStop Color="{DynamicResource SukiPrimaryColor5}" Offset="1"></GradientStop>
  37. </LinearGradientBrush>
  38. </Panel.Background>
  39. </Panel>
  40. </Panel>
  41. </Border>
  42. </Border>
  43. <Border Name="PART_TransparencyFallback" IsHitTestVisible="False" />
  44. <Border Background="{TemplateBinding Background}" IsHitTestVisible="False" />
  45. <Panel Background="Transparent" Margin="{TemplateBinding WindowDecorationMargin}" />
  46. <VisualLayerManager>
  47. <VisualLayerManager.ChromeOverlayLayer>
  48. <HostWindowTitleBar Name="PART_TitleBar" />
  49. </VisualLayerManager.ChromeOverlayLayer>
  50. <ContentPresenter Name="PART_ContentPresenter"
  51. ContentTemplate="{TemplateBinding ContentTemplate}"
  52. Content="{TemplateBinding Content}"
  53. Margin="{TemplateBinding Padding}"
  54. HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
  55. VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" />
  56. </VisualLayerManager>
  57. </Panel>
  58. </ControlTemplate>
  59. </Setter>
  60. <Setter Property="Content">
  61. <Template>
  62. <Panel Margin="{Binding $parent[HostWindow].OffScreenMargin}">
  63. <Panel Margin="{Binding $parent[HostWindow].WindowDecorationMargin}">
  64. <DockControl Layout="{Binding}"
  65. x:DataType="core:IHostWindow"
  66. x:CompileBindings="True" />
  67. </Panel>
  68. </Panel>
  69. </Template>
  70. </Setter>
  71. </ControlTheme>
  72. </ResourceDictionary>