MainWindow.xaml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  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. d:DataContext="{d:DesignInstance Type=viewmodels:MainWindowViewModel}"
  19. prism:ViewModelLocator.AutoWireViewModel="True"
  20. Activated="Window_Activated"
  21. Closed="Window_Closed"
  22. SizeChanged="Window_SizeChanged"
  23. Style="{StaticResource WindowStyle}"
  24. UseLayoutRounding="True"
  25. WindowStartupLocation="CenterScreen"
  26. mc:Ignorable="d">
  27. <Window.Resources>
  28. <ResourceDictionary>
  29. <Style x:Key="DragablzItemStyle" TargetType="{x:Type dragablz:DragablzItem}">
  30. <Setter Property="WindowChrome.IsHitTestVisibleInChrome" Value="True" />
  31. <Setter Property="Foreground" Value="{StaticResource color.sys.text.neutral.lv2}" />
  32. <Setter Property="Template">
  33. <Setter.Value>
  34. <ControlTemplate TargetType="dragablz:DragablzItem">
  35. <Grid x:Name="templateRoot">
  36. <Grid.ColumnDefinitions>
  37. <ColumnDefinition Width="*" />
  38. <ColumnDefinition Width="auto" />
  39. </Grid.ColumnDefinitions>
  40. <Border
  41. x:Name="Title"
  42. Width="184"
  43. Height="34"
  44. Margin="4,6,0,2"
  45. BorderBrush="{StaticResource color.sys.border.neutral.lv3}"
  46. BorderThickness="0"
  47. CornerRadius="4,4,0,0"
  48. WindowChrome.IsHitTestVisibleInChrome="True">
  49. <Grid>
  50. <Grid.ColumnDefinitions>
  51. <ColumnDefinition Width="auto" />
  52. <ColumnDefinition Width="*" MinWidth="10" />
  53. <ColumnDefinition Width="auto" />
  54. </Grid.ColumnDefinitions>
  55. <StackPanel Orientation="Horizontal">
  56. <Path
  57. Name="Ico_Home"
  58. Width="20"
  59. Height="20"
  60. Margin="8,7,0,7"
  61. 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"
  62. Fill="{TemplateBinding Foreground}"
  63. Visibility="Collapsed" />
  64. <TextBlock
  65. x:Name="TextTitle"
  66. MaxWidth="145"
  67. Margin="8,7"
  68. VerticalAlignment="Center"
  69. FontFamily="Segoe UI,Microsoft YaHei"
  70. Foreground="{TemplateBinding Foreground}"
  71. Text="{Binding DataContext.FileName}"
  72. TextTrimming="WordEllipsis" />
  73. </StackPanel>
  74. <Thumb
  75. x:Name="PART_Thumb"
  76. Grid.ColumnSpan="2"
  77. HorizontalAlignment="Stretch"
  78. VerticalContentAlignment="Stretch"
  79. Background="Transparent"
  80. FontFamily="Segoe UI,Microsoft YaHei"
  81. ToolTip="{Binding DataContext.FileName}">
  82. <Thumb.Template>
  83. <ControlTemplate>
  84. <Grid Background="Transparent" />
  85. </ControlTemplate>
  86. </Thumb.Template>
  87. </Thumb>
  88. <TextBlock
  89. x:Name="ChangeIcon"
  90. Grid.Column="1"
  91. Width="5"
  92. Margin="3,4,2,0"
  93. HorizontalAlignment="Left"
  94. VerticalAlignment="Top"
  95. Foreground="{TemplateBinding Foreground}"
  96. IsHitTestVisible="False"
  97. Text="*"
  98. Visibility="{Binding DataContext.FileChanged}" />
  99. <Button
  100. Grid.Column="2"
  101. Width="16"
  102. Height="16"
  103. Margin="0,4,8,4"
  104. Background="Transparent"
  105. BorderThickness="0"
  106. Command="{Binding DataContext.CloseTab}"
  107. CommandParameter="{Binding}">
  108. <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}" />
  109. </Button>
  110. </Grid>
  111. </Border>
  112. </Grid>
  113. <ControlTemplate.Triggers>
  114. <Trigger Property="IsSelected" Value="True">
  115. <Setter TargetName="Title" Property="Background" Value="{StaticResource color.sys.layout.mg}" />
  116. <Setter Property="Foreground" Value="{StaticResource color.sys.text.neutral.lv1}" />
  117. <Setter TargetName="Title" Property="BorderThickness" Value="0,0,0,1" />
  118. </Trigger>
  119. <Trigger Property="IsSelected" Value="False">
  120. <Setter TargetName="Title" Property="Background" Value="TransParent" />
  121. </Trigger>
  122. <Trigger Property="IsMouseOver" Value="True">
  123. <Setter TargetName="Title" Property="Background" Value="{StaticResource color.item-state.hov.bg}" />
  124. </Trigger>
  125. <Trigger SourceName="TextTitle" Property="Text" Value="Home">
  126. <Setter TargetName="Ico_Home" Property="Visibility" Value="Visible" />
  127. </Trigger>
  128. <MultiDataTrigger>
  129. <MultiDataTrigger.Conditions>
  130. <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="false" />
  131. <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true" />
  132. </MultiDataTrigger.Conditions>
  133. <Setter TargetName="Title" Property="Background" Value="#0D000000" />
  134. <Setter Property="Foreground" Value="{StaticResource color.sys.text.neutral.lv1}" />
  135. <!--<Setter TargetName="btnPath" Property="Path.Fill" Value="Black"/>-->
  136. </MultiDataTrigger>
  137. </ControlTemplate.Triggers>
  138. </ControlTemplate>
  139. </Setter.Value>
  140. </Setter>
  141. </Style>
  142. <convert:UnVisivleConvert x:Key="UnvisibleConvert" />
  143. </ResourceDictionary>
  144. </Window.Resources>
  145. <Border>
  146. <Grid Background="{StaticResource color.sys.layout.bg.tabbar}">
  147. <Grid.RowDefinitions>
  148. <RowDefinition Height="40" />
  149. <RowDefinition Height="*" />
  150. </Grid.RowDefinitions>
  151. <dragablz:TabablzControl
  152. Name="TabablzControl"
  153. Grid.RowSpan="3"
  154. BorderThickness="0"
  155. ItemContainerStyle="{StaticResource DragablzItemStyle}"
  156. SelectedItem="{Binding SelectedItem, Mode=TwoWay}"
  157. WindowChrome.IsHitTestVisibleInChrome="True">
  158. <dragablz:TabablzControl.InterTabController>
  159. <dragablz:InterTabController InterTabClient="{Binding InterTabClient}" />
  160. </dragablz:TabablzControl.InterTabController>
  161. <dragablz:TabablzControl.HeaderSuffixContent>
  162. <Button
  163. x:Name="BtnAdd"
  164. Width="20"
  165. Height="20"
  166. Margin="8,13,200,7"
  167. Padding="0"
  168. HorizontalAlignment="Left"
  169. Background="Transparent"
  170. BorderThickness="0"
  171. Command="{Binding AddTab}"
  172. WindowChrome.IsHitTestVisibleInChrome="True">
  173. <Path
  174. Width="20"
  175. Height="20"
  176. Data="M9 11V16H11V11H16V9H11V4H9V9H4L4 11H9Z"
  177. Fill="{StaticResource color.icon.base.neutral.norm.lv1}" />
  178. </Button>
  179. </dragablz:TabablzControl.HeaderSuffixContent>
  180. <dragablz:TabablzControl.HeaderPrefixContent>
  181. <Grid
  182. Width="16"
  183. Height="38"
  184. Margin="0,0,0,0"
  185. Background="Transparent" />
  186. </dragablz:TabablzControl.HeaderPrefixContent>
  187. </dragablz:TabablzControl>
  188. <!-- 标题栏右侧栏,关闭按钮,会员,试用等 -->
  189. <StackPanel
  190. Name="StkPnlRight"
  191. HorizontalAlignment="Right"
  192. Orientation="Horizontal"
  193. WindowChrome.IsHitTestVisibleInChrome="True">
  194. <Button
  195. Name="BtnMiniSize"
  196. Width="40"
  197. Height="40"
  198. Background="Transparent"
  199. BorderThickness="0"
  200. Click="BtnMiniSize_Click"
  201. Style="{StaticResource TitleBarBtn}">
  202. <Polygon Fill="{StaticResource color.btn.sec.text.def}" Points="14 7 14 8 2 8 2 7">
  203. <Polygon.RenderTransform>
  204. <TransformGroup>
  205. <TranslateTransform Y="-3" />
  206. </TransformGroup>
  207. </Polygon.RenderTransform>
  208. </Polygon>
  209. </Button>
  210. <Button
  211. Name="BtnReStore"
  212. Width="40"
  213. Height="40"
  214. Background="Transparent"
  215. BorderThickness="0"
  216. Click="BtnReStore_Click"
  217. Style="{StaticResource TitleBarBtn}">
  218. <Grid>
  219. <Path
  220. x:Name="ico_max"
  221. Data="M14,2 L14,14 L2,14 L2,2 L14,2 Z M13,3 L3,3 L3,13 L13,13 L13,3 Z"
  222. Fill="{StaticResource color.btn.sec.text.def}"
  223. Visibility="Collapsed" />
  224. <Grid x:Name="ico_mini" Visibility="{Binding ElementName=ico_max, Path=Visibility, Converter={StaticResource UnvisibleConvert}}">
  225. <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}" />
  226. <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" />
  227. </Grid>
  228. </Grid>
  229. </Button>
  230. <Button
  231. Name="BtnClose"
  232. Width="40"
  233. Height="40"
  234. Background="Transparent"
  235. BorderThickness="0"
  236. Click="BtnClose_Click"
  237. Style="{StaticResource CloseBtn}">
  238. <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" />
  239. </Button>
  240. </StackPanel>
  241. </Grid>
  242. </Border>
  243. </Window>