MainWindow.xaml 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458
  1. <Window
  2. x:Class="PDF_Master.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_Master.DataConvert"
  6. xmlns:cus="clr-namespace:PDF_Master.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_Master"
  11. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  12. xmlns:prism="http://prismlibrary.com/"
  13. xmlns:viewmodels="clr-namespace:PDF_Master.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. BorderBrush="{StaticResource color.sys.layout.bg.tabbar}"
  22. BorderThickness="2"
  23. Closed="Window_Closed"
  24. Closing="Window_Closing"
  25. PreviewMouseLeftButtonDown="Window_PreviewMouseLeftButtonDown"
  26. SizeChanged="Window_SizeChanged"
  27. Style="{StaticResource WindowStyle}"
  28. UseLayoutRounding="True"
  29. WindowStartupLocation="CenterScreen"
  30. mc:Ignorable="d">
  31. <Window.Resources>
  32. <ResourceDictionary>
  33. <Style x:Key="DragablzItemStyle" TargetType="{x:Type dragablz:DragablzItem}">
  34. <Setter Property="WindowChrome.IsHitTestVisibleInChrome" Value="False" />
  35. <Setter Property="Foreground" Value="{StaticResource color.sys.text.neutral.lv2}" />
  36. <Setter Property="Template">
  37. <Setter.Value>
  38. <ControlTemplate TargetType="dragablz:DragablzItem">
  39. <Grid x:Name="templateRoot" Background="Transparent">
  40. <Grid.ColumnDefinitions>
  41. <ColumnDefinition Width="*" />
  42. <ColumnDefinition Width="auto" />
  43. </Grid.ColumnDefinitions>
  44. <Border
  45. x:Name="Title"
  46. Width="200"
  47. Height="34"
  48. Margin="4,6,0,2"
  49. BorderBrush="{StaticResource color.sys.border.neutral.lv3}"
  50. BorderThickness="0"
  51. CornerRadius="4,4,0,0"
  52. WindowChrome.IsHitTestVisibleInChrome="True">
  53. <Grid
  54. Name="GridRoot"
  55. Focusable="True"
  56. WindowChrome.IsHitTestVisibleInChrome="True">
  57. <Grid.ColumnDefinitions>
  58. <ColumnDefinition Width="auto" />
  59. <ColumnDefinition Width="*" MinWidth="10" />
  60. <ColumnDefinition Width="auto" />
  61. </Grid.ColumnDefinitions>
  62. <StackPanel Orientation="Horizontal">
  63. <Path
  64. Name="Ico_Home"
  65. Width="20"
  66. Height="20"
  67. Margin="8,7,0,7"
  68. 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"
  69. Fill="{TemplateBinding Foreground}"
  70. Visibility="Collapsed" />
  71. <TextBlock
  72. x:Name="TextTitle"
  73. MaxWidth="164"
  74. Margin="8,7,0,7"
  75. VerticalAlignment="Center"
  76. FontFamily="Segoe UI,Microsoft YaHei"
  77. Foreground="{TemplateBinding Foreground}"
  78. Text="{Binding DataContext.FileName}"
  79. TextTrimming="WordEllipsis" />
  80. </StackPanel>
  81. <Thumb
  82. x:Name="PART_Thumb"
  83. Grid.ColumnSpan="2"
  84. HorizontalAlignment="Stretch"
  85. VerticalContentAlignment="Stretch"
  86. Background="Transparent"
  87. FontFamily="Segoe UI,Microsoft YaHei"
  88. ToolTip="{Binding DataContext.FileName}">
  89. <Thumb.Template>
  90. <ControlTemplate>
  91. <Grid Background="Transparent" />
  92. </ControlTemplate>
  93. </Thumb.Template>
  94. </Thumb>
  95. <TextBlock
  96. x:Name="ChangeIcon"
  97. Grid.Column="1"
  98. Width="5"
  99. Margin="3,4,2,0"
  100. HorizontalAlignment="Left"
  101. VerticalAlignment="Top"
  102. Foreground="{TemplateBinding Foreground}"
  103. IsHitTestVisible="False"
  104. Text="*"
  105. Visibility="{Binding DataContext.FileChanged}" />
  106. <Button
  107. Grid.Column="2"
  108. Width="12"
  109. Height="12"
  110. Margin="0,0,8,0"
  111. Background="Transparent"
  112. BorderThickness="0"
  113. Command="{Binding DataContext.CloseTab}"
  114. CommandParameter="{Binding}"
  115. Style="{StaticResource btn.selector}">
  116. <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}" />
  117. </Button>
  118. <TextBox
  119. x:Name="TxtRename"
  120. MaxWidth="145"
  121. Margin="8,0,10,0"
  122. VerticalContentAlignment="Center"
  123. FontFamily="Segoe UI,Microsoft YaHei"
  124. Foreground="{TemplateBinding Foreground}"
  125. PreviewKeyDown="TxtRename_PreviewKeyDown"
  126. Text="{Binding DataContext.FileName, Mode=TwoWay, UpdateSourceTrigger=LostFocus}"
  127. Visibility="{Binding DataContext.IsReNameTextShow}"
  128. WindowChrome.IsHitTestVisibleInChrome="True" />
  129. </Grid>
  130. </Border>
  131. <Grid.ContextMenu>
  132. <ContextMenu>
  133. <MenuItem
  134. Command="{Binding DataContext.RenameCommand}"
  135. Header="{Binding DataContext.T_Rename}"
  136. IsEnabled="{Binding DataContext.IsReNameEnable}"
  137. Visibility="Collapsed" />
  138. <MenuItem
  139. Command="{Binding DataContext.ShowInFolderCommand}"
  140. Header="{Binding DataContext.T_Floder}"
  141. IsEnabled="{Binding DataContext.IsShowInFolderEnable}" />
  142. <MenuItem
  143. Command="{Binding DataContext.CloseTab}"
  144. CommandParameter="{Binding}"
  145. Header="{Binding DataContext.T_Close}" />
  146. <MenuItem
  147. Command="{Binding DataContext.mainWindowViewModel.CloseAllTabCommand}"
  148. Header="{Binding DataContext.T_CloseAll}"
  149. IsEnabled="{Binding DataContext.mainWindowViewModel.IsCloseAllEnable}" />
  150. <MenuItem Header="Open In New Window" Visibility="Collapsed" />
  151. </ContextMenu>
  152. </Grid.ContextMenu>
  153. </Grid>
  154. <ControlTemplate.Triggers>
  155. <Trigger Property="IsSelected" Value="True">
  156. <Setter TargetName="Title" Property="Background" Value="{StaticResource color.sys.layout.mg}" />
  157. <Setter Property="Foreground" Value="{StaticResource color.sys.text.neutral.lv1}" />
  158. <Setter TargetName="Title" Property="BorderThickness" Value="0,0,0,1" />
  159. </Trigger>
  160. <Trigger Property="IsSelected" Value="False">
  161. <Setter TargetName="Title" Property="Background" Value="TransParent" />
  162. </Trigger>
  163. <Trigger Property="IsMouseOver" Value="True">
  164. <Setter TargetName="Title" Property="Background" Value="{StaticResource color.item-state.hov.bg}" />
  165. </Trigger>
  166. <Trigger SourceName="TextTitle" Property="Text" Value="Home">
  167. <Setter TargetName="Ico_Home" Property="Visibility" Value="Visible" />
  168. </Trigger>
  169. <MultiDataTrigger>
  170. <MultiDataTrigger.Conditions>
  171. <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="false" />
  172. <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true" />
  173. </MultiDataTrigger.Conditions>
  174. <Setter TargetName="Title" Property="Background" Value="#0D000000" />
  175. <Setter Property="Foreground" Value="{StaticResource color.sys.text.neutral.lv1}" />
  176. <!--<Setter TargetName="btnPath" Property="Path.Fill" Value="Black"/>-->
  177. </MultiDataTrigger>
  178. </ControlTemplate.Triggers>
  179. </ControlTemplate>
  180. </Setter.Value>
  181. </Setter>
  182. </Style>
  183. <convert:UnVisivleConvert x:Key="UnvisibleConvert" />
  184. </ResourceDictionary>
  185. </Window.Resources>
  186. <Grid Background="{StaticResource color.sys.layout.bg.tabbar}">
  187. <Grid.RowDefinitions>
  188. <RowDefinition Height="40" />
  189. <RowDefinition Height="*" />
  190. </Grid.RowDefinitions>
  191. <dragablz:TabablzControl
  192. Name="TabablzControl"
  193. Grid.RowSpan="3"
  194. BorderThickness="0"
  195. FocusVisualStyle="{x:Null}"
  196. ItemContainerStyle="{StaticResource DragablzItemStyle}"
  197. ScrollViewer.HorizontalScrollBarVisibility="Auto"
  198. SelectedItem="{Binding SelectedItem, Mode=TwoWay}"
  199. WindowChrome.IsHitTestVisibleInChrome="True">
  200. <dragablz:TabablzControl.InterTabController>
  201. <dragablz:InterTabController InterTabClient="{Binding InterTabClient}" />
  202. </dragablz:TabablzControl.InterTabController>
  203. <dragablz:TabablzControl.HeaderSuffixContent>
  204. <Button
  205. x:Name="BtnAdd"
  206. Width="20"
  207. Height="20"
  208. Margin="8,13,200,7"
  209. Padding="0"
  210. HorizontalAlignment="Left"
  211. BorderThickness="0"
  212. Command="{Binding AddTab}"
  213. Style="{StaticResource btn.selector}"
  214. WindowChrome.IsHitTestVisibleInChrome="True">
  215. <Path
  216. Width="20"
  217. Height="20"
  218. Data="M9 11V16H11V11H16V9H11V4H9V9H4L4 11H9Z"
  219. Fill="{StaticResource color.icon.base.neutral.norm.lv1}" />
  220. </Button>
  221. </dragablz:TabablzControl.HeaderSuffixContent>
  222. <dragablz:TabablzControl.HeaderPrefixContent>
  223. <Grid
  224. Name="GridRoot"
  225. Width="16"
  226. Height="38"
  227. Margin="0,0,0,0"
  228. Background="Transparent"
  229. WindowChrome.IsHitTestVisibleInChrome="False" />
  230. </dragablz:TabablzControl.HeaderPrefixContent>
  231. </dragablz:TabablzControl>
  232. <!-- 标题栏右侧栏,关闭按钮,会员,试用等 -->
  233. <StackPanel
  234. Name="StkPnlRight"
  235. HorizontalAlignment="Right"
  236. Orientation="Horizontal"
  237. WindowChrome.IsHitTestVisibleInChrome="True">
  238. <Grid
  239. x:Name="Grid_Openhight"
  240. IsVisibleChanged="Grid_Openhight_IsVisibleChanged"
  241. Visibility="{Binding OphVis, Mode=OneWay}">
  242. <WrapPanel VerticalAlignment="Center">
  243. <Border
  244. Width="35"
  245. Height="28"
  246. Margin="0,0,-4,0"
  247. HorizontalAlignment="Left"
  248. VerticalAlignment="Center"
  249. Background=" #FFCF52"
  250. CornerRadius="4" />
  251. <Border VerticalAlignment="Center">
  252. <Path Data="M0 4C0 1.79086 1.79086 0 4 0H132C134.209 0 136 1.79086 136 4V10.323C136 10.7319 136.249 11.0996 136.629 11.2514L141.179 13.0715C142.017 13.4068 142.017 14.5932 141.179 14.9285L136.629 16.7486C136.249 16.9004 136 17.2681 136 17.677V24C136 26.2091 134.209 28 132 28H4C1.79086 28 0 26.2091 0 24V4Z" Fill="#FFCF52" />
  253. </Border>
  254. </WrapPanel>
  255. <TextBlock
  256. HorizontalAlignment="Center"
  257. VerticalAlignment="Center"
  258. FontFamily="PingFang SC"
  259. FontSize="14"
  260. LineHeight="19.6"
  261. Text="{Binding Msgtologin}" />
  262. </Grid>
  263. <Button
  264. x:Name="Btn_Register"
  265. Width="40"
  266. Height="40"
  267. Background="Transparent"
  268. Command="{Binding OpenRegisterCommand}"
  269. Style="{StaticResource subToolBar}"
  270. Visibility="{Binding RegisterVis, Mode=TwoWay}">
  271. <Grid>
  272. <Border
  273. x:Name="myBorder1"
  274. Width="24"
  275. Height="24"
  276. Background="White"
  277. CornerRadius="12" />
  278. <Border
  279. Width="24"
  280. Height="24"
  281. Background="{StaticResource color.icon.base.neutral.norm.lv1}"
  282. BorderBrush="{StaticResource color.icon.base.neutral.norm.lv1}">
  283. <Path Data="M12 13C14.2091 13 16 11.2091 16 9C16 6.79086 14.2091 5 12 5C9.79086 5 8 6.79086 8 9C8 11.2091 9.79086 13 12 13ZM12 31C17.5228 31 22 27.4183 22 23C22 18.5817 17.5228 15 12 15C6.47715 15 2 18.5817 2 23C2 27.4183 6.47715 31 12 31Z" Fill="White" />
  284. <Border.OpacityMask>
  285. <VisualBrush Visual="{Binding ElementName=myBorder1}" />
  286. </Border.OpacityMask>
  287. </Border>
  288. <Border
  289. Width="24"
  290. Height="24"
  291. BorderBrush="{StaticResource color.icon.base.neutral.norm.lv1}"
  292. BorderThickness="2"
  293. CornerRadius="100" />
  294. </Grid>
  295. </Button>
  296. <Button
  297. x:Name="Btn_Login"
  298. Width="40"
  299. Height="40"
  300. Background="Transparent"
  301. Command="{Binding OpenLoginCommand}"
  302. Style="{StaticResource subToolBar}"
  303. Visibility="{Binding LoginVis, Mode=TwoWay}">
  304. <Grid>
  305. <Border
  306. x:Name="myBorder2"
  307. Width="24"
  308. Height="24"
  309. Background="White"
  310. CornerRadius="12" />
  311. <Border
  312. Width="24"
  313. Height="24"
  314. Background="{StaticResource color.icon.base.neutral.norm.lv1}"
  315. BorderBrush="{StaticResource color.icon.base.neutral.norm.lv1}">
  316. <Path Data="M12 13C14.2091 13 16 11.2091 16 9C16 6.79086 14.2091 5 12 5C9.79086 5 8 6.79086 8 9C8 11.2091 9.79086 13 12 13ZM12 31C17.5228 31 22 27.4183 22 23C22 18.5817 17.5228 15 12 15C6.47715 15 2 18.5817 2 23C2 27.4183 6.47715 31 12 31Z" Fill="White" />
  317. <Border.OpacityMask>
  318. <VisualBrush Visual="{Binding ElementName=myBorder2}" />
  319. </Border.OpacityMask>
  320. </Border>
  321. <Border
  322. Width="24"
  323. Height="24"
  324. BorderBrush="{StaticResource color.icon.base.neutral.norm.lv1}"
  325. BorderThickness="2"
  326. CornerRadius="100" />
  327. </Grid>
  328. </Button>
  329. <Button
  330. x:Name="Btn_User"
  331. Width="40"
  332. Height="40"
  333. Background="Transparent"
  334. Command="{Binding OpenUserCommand}"
  335. Style="{StaticResource subToolBar}"
  336. Visibility="{Binding UserVis, Mode=TwoWay}">
  337. <Grid>
  338. <Border
  339. Width="24"
  340. Height="24"
  341. Background="#1770F4"
  342. BorderBrush="#1770F4"
  343. CornerRadius="100" >
  344. <TextBlock
  345. VerticalAlignment="Center"
  346. HorizontalAlignment="Center"
  347. FontFamily="SF Pro Text"
  348. FontSize="20"
  349. FontWeight="SemiBold"
  350. Foreground="White"
  351. Text="{Binding Useremailchar}" />
  352. </Border>
  353. </Grid>
  354. </Button>
  355. <Separator BorderBrush="#94989C" BorderThickness="1">
  356. <Separator.LayoutTransform>
  357. <RotateTransform Angle="90" />
  358. </Separator.LayoutTransform>
  359. </Separator>
  360. <Button
  361. Name="BtnMiniSize"
  362. Width="40"
  363. Height="40"
  364. Background="Transparent"
  365. BorderThickness="0"
  366. Click="BtnMiniSize_Click"
  367. Style="{StaticResource TitleBarBtn}">
  368. <Polygon Fill="{StaticResource color.btn.sec.text.def}" Points="14 7 14 8 2 8 2 7">
  369. <Polygon.RenderTransform>
  370. <TransformGroup>
  371. <TranslateTransform Y="-3" />
  372. </TransformGroup>
  373. </Polygon.RenderTransform>
  374. </Polygon>
  375. </Button>
  376. <Button
  377. Name="BtnReStore"
  378. Width="40"
  379. Height="40"
  380. Background="Transparent"
  381. BorderThickness="0"
  382. Click="BtnReStore_Click"
  383. Style="{StaticResource TitleBarBtn}">
  384. <Grid>
  385. <Path
  386. x:Name="ico_max"
  387. Data="M14,2 L14,14 L2,14 L2,2 L14,2 Z M13,3 L3,3 L3,13 L13,13 L13,3 Z"
  388. Fill="{StaticResource color.btn.sec.text.def}"
  389. Visibility="Collapsed" />
  390. <Grid x:Name="ico_mini" Visibility="{Binding ElementName=ico_max, Path=Visibility, Converter={StaticResource UnvisibleConvert}}">
  391. <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}" />
  392. <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" />
  393. </Grid>
  394. </Grid>
  395. </Button>
  396. <Button
  397. Name="BtnClose"
  398. Width="40"
  399. Height="40"
  400. Background="Transparent"
  401. BorderThickness="0"
  402. Click="BtnClose_Click"
  403. Style="{StaticResource CloseBtn}">
  404. <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" />
  405. </Button>
  406. </StackPanel>
  407. <!-- OCR Progress Control -->
  408. <Grid Grid.RowSpan="2" Visibility="{Binding IsProcessVisible}">
  409. <Grid.Background>
  410. <SolidColorBrush Opacity="0.05" Color="Black" />
  411. </Grid.Background>
  412. <Border
  413. Width="226"
  414. Height="58"
  415. Background="{StaticResource color.sys.layout.dark.bg}"
  416. BorderThickness="0"
  417. CornerRadius="{StaticResource border-radius.8}"
  418. Effect="{StaticResource shadow.neutral.m}">
  419. <Grid Margin="16,13" Background="Transparent">
  420. <StackPanel Orientation="Horizontal">
  421. <TextBlock Foreground="{StaticResource color.sys.text.anti.norm}" Text="{Binding ProgressTitle}" />
  422. <TextBlock Foreground="{StaticResource color.sys.text.anti.norm}" Text="{Binding Value, StringFormat={}({0})}" />
  423. </StackPanel>
  424. <Button
  425. Width="12"
  426. Height="12"
  427. Padding="0,0,1,1"
  428. HorizontalAlignment="Right"
  429. VerticalAlignment="Top"
  430. Background="{StaticResource color.sys.layout.dark.bg}"
  431. BorderThickness="0"
  432. Command="{Binding CloseOCRCommand}">
  433. <Path Data="M6.00006 7.06072L9.46973 10.5304L10.5304 9.46973L7.06072 6.00006L10.5304 2.53039L9.46973 1.46973L6.00006 4.9394L2.53039 1.46973L1.46973 2.53039L4.9394 6.00006L1.46973 9.46973L2.53039 10.5304L6.00006 7.06072Z" Fill="#CED0D4" />
  434. </Button>
  435. <ProgressBar
  436. Height="4"
  437. Margin="0,0,0,4"
  438. VerticalAlignment="Bottom"
  439. BorderThickness="0"
  440. Foreground="{StaticResource color.slider.track-filled.norm}"
  441. Maximum="{Binding MaxValue}"
  442. Value="{Binding Value}" />
  443. </Grid>
  444. </Border>
  445. </Grid>
  446. </Grid>
  447. </Window>