MainWindow.xaml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. <Window
  2. x:Class="PDF_Office.Views.MainWindow"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:convert="clr-namespace:PDF_Office.DataConvert"
  6. xmlns:cus="clr-namespace:PDF_Office.CustomControl"
  7. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  8. xmlns:dragablz="http://dragablz.net/winfx/xaml/dragablz"
  9. xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
  10. xmlns:local="clr-namespace:PDF_Office"
  11. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  12. xmlns:prism="http://prismlibrary.com/"
  13. xmlns:viewmodels="clr-namespace:PDF_Office.ViewModels"
  14. Width="1280"
  15. Height="800"
  16. MinWidth="540"
  17. MinHeight="460"
  18. prism:ViewModelLocator.AutoWireViewModel="True"
  19. Activated="Window_Activated"
  20. Closed="Window_Closed"
  21. Style="{StaticResource WindowStyle}"
  22. UseLayoutRounding="True"
  23. WindowStartupLocation="CenterScreen"
  24. mc:Ignorable="d">
  25. <Window.Resources>
  26. <ResourceDictionary>
  27. <Style x:Key="DragablzItemStyle" TargetType="{x:Type dragablz:DragablzItem}">
  28. <Setter Property="WindowChrome.IsHitTestVisibleInChrome" Value="True" />
  29. <Setter Property="Foreground" Value="{StaticResource color.sys.text.neutral.lv2}" />
  30. <Setter Property="Template">
  31. <Setter.Value>
  32. <ControlTemplate TargetType="dragablz:DragablzItem">
  33. <Grid x:Name="templateRoot">
  34. <Grid.ColumnDefinitions>
  35. <ColumnDefinition Width="*" />
  36. <ColumnDefinition Width="auto" />
  37. </Grid.ColumnDefinitions>
  38. <Border
  39. x:Name="Title"
  40. Width="184"
  41. Height="34"
  42. Margin="4,6,0,2"
  43. BorderBrush="{StaticResource color.sys.border.neutral.lv3}"
  44. BorderThickness="0,0,0,1"
  45. CornerRadius="4,4,0,0"
  46. WindowChrome.IsHitTestVisibleInChrome="True">
  47. <Grid>
  48. <Grid.ColumnDefinitions>
  49. <ColumnDefinition Width="auto" />
  50. <ColumnDefinition Width="*" MinWidth="10" />
  51. <ColumnDefinition Width="auto" />
  52. </Grid.ColumnDefinitions>
  53. <StackPanel Orientation="Horizontal">
  54. <Path
  55. Name="Ico_Home"
  56. Width="20"
  57. Height="20"
  58. Margin="8,7,0,7"
  59. Data="M3.8655 5.79659C3.32363 6.16983 3 6.78571 3 7.44369V15.0001C3 16.1046 3.89543 17.0001 5 17.0001H9V12.1786H11V17.0001H15C16.1046 17.0001 17 16.1046 17 15.0001V7.44369C17 6.78571 16.6764 6.16983 16.1345 5.79659L11.1345 2.35266C10.4514 1.88212 9.54865 1.88212 8.8655 2.35266L3.8655 5.79659Z"
  60. Fill="{TemplateBinding Foreground}"
  61. Visibility="Collapsed" />
  62. <TextBlock
  63. x:Name="TextTitle"
  64. MaxWidth="145"
  65. Margin="8,7"
  66. VerticalAlignment="Center"
  67. FontFamily="Segoe UI,Microsoft YaHei"
  68. Foreground="{TemplateBinding Foreground}"
  69. Text="{Binding DataContext.FileName}"
  70. TextTrimming="WordEllipsis" />
  71. </StackPanel>
  72. <Thumb
  73. x:Name="PART_Thumb"
  74. Grid.ColumnSpan="2"
  75. HorizontalAlignment="Stretch"
  76. VerticalContentAlignment="Stretch"
  77. Background="Transparent"
  78. FontFamily="Segoe UI,Microsoft YaHei"
  79. ToolTip="{Binding DataContext.FileName}">
  80. <Thumb.Template>
  81. <ControlTemplate>
  82. <Grid Background="Transparent" />
  83. </ControlTemplate>
  84. </Thumb.Template>
  85. </Thumb>
  86. <TextBlock
  87. x:Name="ChangeIcon"
  88. Grid.Column="1"
  89. Width="5"
  90. Margin="3,4,2,0"
  91. HorizontalAlignment="Left"
  92. VerticalAlignment="Top"
  93. Foreground="{TemplateBinding Foreground}"
  94. IsHitTestVisible="False"
  95. Text="*"
  96. Visibility="{Binding DataContext.FileChanged}" />
  97. <Button
  98. Grid.Column="2"
  99. Width="16"
  100. Height="16"
  101. Margin="0,4,8,4"
  102. Background="Transparent"
  103. BorderThickness="0"
  104. Command="{Binding DataContext.CloseTab}"
  105. CommandParameter="{Binding}">
  106. <Path Data="M6.50006 7.06072L9.96973 10.5304L11.0304 9.46973L7.56072 6.00006L11.0304 2.53039L9.96973 1.46973L6.50006 4.9394L3.03039 1.46973L1.96973 2.53039L5.4394 6.00006L1.96973 9.46973L3.03039 10.5304L6.50006 7.06072Z" Fill="{StaticResource color.icon.base.neutral.norm.lv2}" />
  107. </Button>
  108. </Grid>
  109. </Border>
  110. </Grid>
  111. <ControlTemplate.Triggers>
  112. <Trigger Property="IsSelected" Value="True">
  113. <Setter TargetName="Title" Property="Background" Value="{StaticResource color.sys.border.neutral.lv3}" />
  114. <Setter Property="Foreground" Value="{StaticResource color.sys.text.neutral.lv1}" />
  115. </Trigger>
  116. <Trigger Property="IsSelected" Value="False">
  117. <Setter TargetName="Title" Property="Background" Value="TransParent" />
  118. </Trigger>
  119. <Trigger Property="IsMouseOver" Value="True">
  120. <Setter TargetName="Title" Property="Background" Value="{StaticResource color.item-state.hov.bg}" />
  121. </Trigger>
  122. <Trigger SourceName="TextTitle" Property="Text" Value="Home">
  123. <Setter TargetName="Ico_Home" Property="Visibility" Value="Visible" />
  124. </Trigger>
  125. <MultiDataTrigger>
  126. <MultiDataTrigger.Conditions>
  127. <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="false" />
  128. <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true" />
  129. </MultiDataTrigger.Conditions>
  130. <Setter TargetName="Title" Property="Background" Value="#0D000000" />
  131. <Setter Property="Foreground" Value="{StaticResource color.sys.text.neutral.lv1}" />
  132. <!--<Setter TargetName="btnPath" Property="Path.Fill" Value="Black"/>-->
  133. </MultiDataTrigger>
  134. </ControlTemplate.Triggers>
  135. </ControlTemplate>
  136. </Setter.Value>
  137. </Setter>
  138. </Style>
  139. <convert:UnVisivleConvert x:Key="UnvisibleConvert" />
  140. </ResourceDictionary>
  141. </Window.Resources>
  142. <Border>
  143. <Grid Background="{StaticResource color.sys.layout.bg.tabbar}">
  144. <Grid.RowDefinitions>
  145. <RowDefinition Height="40" />
  146. <RowDefinition Height="*" />
  147. </Grid.RowDefinitions>
  148. <dragablz:TabablzControl
  149. Name="TabablzControl"
  150. Grid.RowSpan="3"
  151. BorderThickness="0"
  152. ItemContainerStyle="{StaticResource DragablzItemStyle}"
  153. SelectedItem="{Binding SelectedItem, Mode=TwoWay}">
  154. <dragablz:TabablzControl.InterTabController>
  155. <dragablz:InterTabController InterTabClient="{Binding InterTabClient}" />
  156. </dragablz:TabablzControl.InterTabController>
  157. <dragablz:TabablzControl.HeaderSuffixContent>
  158. <Button
  159. x:Name="BtnAdd"
  160. Width="20"
  161. Height="20"
  162. Margin="9,13,0,7"
  163. Padding="0"
  164. HorizontalAlignment="Left"
  165. Background="Transparent"
  166. BorderThickness="0"
  167. Command="{Binding AddTab}"
  168. WindowChrome.IsHitTestVisibleInChrome="True">
  169. <Path
  170. Width="20"
  171. Height="20"
  172. Data="M9 11V16H11V11H16V9H11V4H9V9H4L4 11H9Z"
  173. Fill="{StaticResource color.icon.base.neutral.norm.lv1}" />
  174. </Button>
  175. </dragablz:TabablzControl.HeaderSuffixContent>
  176. <dragablz:TabablzControl.HeaderPrefixContent>
  177. <Grid
  178. Width="16"
  179. Height="38"
  180. Margin="0,0,0,0"
  181. Background="Transparent" />
  182. </dragablz:TabablzControl.HeaderPrefixContent>
  183. </dragablz:TabablzControl>
  184. <!-- 标题栏右侧栏,关闭按钮,会员,试用等 -->
  185. <StackPanel
  186. HorizontalAlignment="Right"
  187. Orientation="Horizontal"
  188. WindowChrome.IsHitTestVisibleInChrome="True">
  189. <Button
  190. Name="BtnMiniSize"
  191. Width="40"
  192. Height="40"
  193. Background="Transparent"
  194. BorderThickness="0"
  195. Click="BtnMiniSize_Click"
  196. Style="{StaticResource TitleBarBtn}">
  197. <Polygon Fill="{StaticResource color.btn.sec.text.def}" Points="14 7 14 8 2 8 2 7">
  198. <Polygon.RenderTransform>
  199. <TransformGroup>
  200. <TranslateTransform Y="-3" />
  201. </TransformGroup>
  202. </Polygon.RenderTransform>
  203. </Polygon>
  204. </Button>
  205. <Button
  206. Name="BtnReStore"
  207. Width="40"
  208. Height="40"
  209. Background="Transparent"
  210. BorderThickness="0"
  211. Click="BtnReStore_Click"
  212. Style="{StaticResource TitleBarBtn}">
  213. <Grid>
  214. <Path
  215. x:Name="ico_max"
  216. Data="M14,2 L14,14 L2,14 L2,2 L14,2 Z M13,3 L3,3 L3,13 L13,13 L13,3 Z"
  217. Fill="{StaticResource color.btn.sec.text.def}"
  218. Visibility="Collapsed" />
  219. <Grid x:Name="ico_mini" Visibility="{Binding ElementName=ico_max, Path=Visibility, Converter={StaticResource UnvisibleConvert}}">
  220. <Path Data="M11,5 L11,14 L2,14 L2,5 L11,5 Z M10,6 L3,6 L3,13 L10,13 L10,6 Z" Fill="{StaticResource color.btn.sec.text.def}" />
  221. <Polygon Fill="{StaticResource color.btn.sec.text.def}" Points="14 2 14 11 11 11 11 10 13 10 13 3 6 3 6 5 5 5 5 2" />
  222. </Grid>
  223. </Grid>
  224. </Button>
  225. <Button
  226. Name="BtnClose"
  227. Width="40"
  228. Height="40"
  229. Background="Transparent"
  230. BorderThickness="0"
  231. Click="BtnClose_Click"
  232. Style="{StaticResource CloseBtn}">
  233. <Polygon Fill="{StaticResource color.btn.sec.text.def}" Points="11.2919922 12 12 11.2919922 6.70800781 6 12 0.708007813 11.2919922 0 6 5.29199219 0.708007812 9.76996262e-15 -2.27456942e-13 0.708007813 5.29199219 6 0 11.2919922 0.708007812 12 6 6.70800781" />
  234. </Button>
  235. </StackPanel>
  236. </Grid>
  237. </Border>
  238. </Window>