MainWindow.xaml 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465
  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
  117. Width="12"
  118. Height="12"
  119. HorizontalAlignment="Center"
  120. VerticalAlignment="Center"
  121. Data="M6.5 7.06066L9.96967 10.5303L11.0303 9.46967L7.56066 6L11.0303 2.53033L9.96967 1.46967L6.5 4.93934L3.03033 1.46967L1.96967 2.53033L5.43934 6L1.96967 9.46967L3.03033 10.5303L6.5 7.06066Z"
  122. Fill="{StaticResource color.icon.base.neutral.norm.lv2}" />
  123. </Button>
  124. <TextBox
  125. x:Name="TxtRename"
  126. MaxWidth="145"
  127. Margin="8,0,10,0"
  128. VerticalContentAlignment="Center"
  129. FontFamily="Segoe UI,Microsoft YaHei"
  130. Foreground="{TemplateBinding Foreground}"
  131. PreviewKeyDown="TxtRename_PreviewKeyDown"
  132. Text="{Binding DataContext.FileName, Mode=TwoWay, UpdateSourceTrigger=LostFocus}"
  133. Visibility="{Binding DataContext.IsReNameTextShow}"
  134. WindowChrome.IsHitTestVisibleInChrome="True" />
  135. </Grid>
  136. </Border>
  137. <Grid.ContextMenu>
  138. <ContextMenu>
  139. <MenuItem
  140. Command="{Binding DataContext.RenameCommand}"
  141. Header="{Binding DataContext.T_Rename}"
  142. IsEnabled="{Binding DataContext.IsReNameEnable}"
  143. Visibility="Collapsed" />
  144. <MenuItem
  145. Command="{Binding DataContext.ShowInFolderCommand}"
  146. Header="{Binding DataContext.T_Floder}"
  147. IsEnabled="{Binding DataContext.IsShowInFolderEnable}" />
  148. <MenuItem
  149. Command="{Binding DataContext.CloseTab}"
  150. CommandParameter="{Binding}"
  151. Header="{Binding DataContext.T_Close}" />
  152. <MenuItem
  153. Command="{Binding DataContext.mainWindowViewModel.CloseAllTabCommand}"
  154. Header="{Binding DataContext.T_CloseAll}"
  155. IsEnabled="{Binding DataContext.mainWindowViewModel.IsCloseAllEnable}" />
  156. <MenuItem Header="Open In New Window" Visibility="Collapsed" />
  157. </ContextMenu>
  158. </Grid.ContextMenu>
  159. </Grid>
  160. <ControlTemplate.Triggers>
  161. <Trigger Property="IsSelected" Value="True">
  162. <Setter TargetName="Title" Property="Background" Value="{StaticResource color.sys.layout.mg}" />
  163. <Setter Property="Foreground" Value="{StaticResource color.sys.text.neutral.lv1}" />
  164. <Setter TargetName="Title" Property="BorderThickness" Value="0,0,0,1" />
  165. </Trigger>
  166. <Trigger Property="IsSelected" Value="False">
  167. <Setter TargetName="Title" Property="Background" Value="TransParent" />
  168. </Trigger>
  169. <Trigger Property="IsMouseOver" Value="True">
  170. <Setter TargetName="Title" Property="Background" Value="{StaticResource color.item-state.hov.bg}" />
  171. </Trigger>
  172. <Trigger SourceName="TextTitle" Property="Text" Value="Home">
  173. <Setter TargetName="Ico_Home" Property="Visibility" Value="Visible" />
  174. </Trigger>
  175. <MultiDataTrigger>
  176. <MultiDataTrigger.Conditions>
  177. <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="false" />
  178. <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true" />
  179. </MultiDataTrigger.Conditions>
  180. <Setter TargetName="Title" Property="Background" Value="#0D000000" />
  181. <Setter Property="Foreground" Value="{StaticResource color.sys.text.neutral.lv1}" />
  182. <!--<Setter TargetName="btnPath" Property="Path.Fill" Value="Black"/>-->
  183. </MultiDataTrigger>
  184. </ControlTemplate.Triggers>
  185. </ControlTemplate>
  186. </Setter.Value>
  187. </Setter>
  188. </Style>
  189. <convert:UnVisivleConvert x:Key="UnvisibleConvert" />
  190. </ResourceDictionary>
  191. </Window.Resources>
  192. <Grid Background="{StaticResource color.sys.layout.bg.tabbar}">
  193. <Grid.RowDefinitions>
  194. <RowDefinition Height="40" />
  195. <RowDefinition Height="*" />
  196. </Grid.RowDefinitions>
  197. <dragablz:TabablzControl
  198. Name="TabablzControl"
  199. Grid.RowSpan="3"
  200. BorderThickness="0"
  201. FocusVisualStyle="{x:Null}"
  202. ItemContainerStyle="{StaticResource DragablzItemStyle}"
  203. ScrollViewer.HorizontalScrollBarVisibility="Auto"
  204. SelectedItem="{Binding SelectedItem, Mode=TwoWay}"
  205. WindowChrome.IsHitTestVisibleInChrome="True">
  206. <dragablz:TabablzControl.InterTabController>
  207. <dragablz:InterTabController InterTabClient="{Binding InterTabClient}" />
  208. </dragablz:TabablzControl.InterTabController>
  209. <dragablz:TabablzControl.HeaderSuffixContent>
  210. <Button
  211. x:Name="BtnAdd"
  212. Width="20"
  213. Height="20"
  214. Margin="8,13,200,7"
  215. Padding="0"
  216. HorizontalAlignment="Left"
  217. BorderThickness="0"
  218. Command="{Binding AddTab}"
  219. Style="{StaticResource btn.selector}"
  220. WindowChrome.IsHitTestVisibleInChrome="True">
  221. <Path
  222. Width="20"
  223. Height="20"
  224. Data="M9 11V16H11V11H16V9H11V4H9V9H4L4 11H9Z"
  225. Fill="{StaticResource color.icon.base.neutral.norm.lv1}" />
  226. </Button>
  227. </dragablz:TabablzControl.HeaderSuffixContent>
  228. <dragablz:TabablzControl.HeaderPrefixContent>
  229. <Grid
  230. Name="GridRoot"
  231. Width="16"
  232. Height="38"
  233. Margin="0,0,0,0"
  234. Background="Transparent"
  235. WindowChrome.IsHitTestVisibleInChrome="False" />
  236. </dragablz:TabablzControl.HeaderPrefixContent>
  237. </dragablz:TabablzControl>
  238. <!-- 标题栏右侧栏,关闭按钮,会员,试用等 -->
  239. <StackPanel
  240. Name="StkPnlRight"
  241. HorizontalAlignment="Right"
  242. Orientation="Horizontal"
  243. WindowChrome.IsHitTestVisibleInChrome="True">
  244. <Grid
  245. x:Name="Grid_Openhight"
  246. IsVisibleChanged="Grid_Openhight_IsVisibleChanged"
  247. Visibility="{Binding OphVis, Mode=OneWay}">
  248. <WrapPanel VerticalAlignment="Center">
  249. <Border
  250. Width="35"
  251. Height="28"
  252. Margin="0,0,-4,0"
  253. HorizontalAlignment="Left"
  254. VerticalAlignment="Center"
  255. Background=" #FFCF52"
  256. CornerRadius="4" />
  257. <Border VerticalAlignment="Center">
  258. <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" />
  259. </Border>
  260. </WrapPanel>
  261. <TextBlock
  262. HorizontalAlignment="Center"
  263. VerticalAlignment="Center"
  264. FontFamily="PingFang SC"
  265. FontSize="14"
  266. LineHeight="19.6"
  267. Text="{Binding Msgtologin}" />
  268. </Grid>
  269. <Button
  270. x:Name="Btn_Register"
  271. Width="40"
  272. Height="40"
  273. Background="Transparent"
  274. Command="{Binding OpenRegisterCommand}"
  275. Style="{StaticResource subToolBar}"
  276. Visibility="{Binding RegisterVis, Mode=TwoWay}">
  277. <Grid>
  278. <Border
  279. x:Name="myBorder1"
  280. Width="24"
  281. Height="24"
  282. Background="White"
  283. CornerRadius="12" />
  284. <Border
  285. Width="24"
  286. Height="24"
  287. Background="{StaticResource color.icon.base.neutral.norm.lv1}"
  288. BorderBrush="{StaticResource color.icon.base.neutral.norm.lv1}">
  289. <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" />
  290. <Border.OpacityMask>
  291. <VisualBrush Visual="{Binding ElementName=myBorder1}" />
  292. </Border.OpacityMask>
  293. </Border>
  294. <Border
  295. Width="24"
  296. Height="24"
  297. BorderBrush="{StaticResource color.icon.base.neutral.norm.lv1}"
  298. BorderThickness="2"
  299. CornerRadius="100" />
  300. </Grid>
  301. </Button>
  302. <Button
  303. x:Name="Btn_Login"
  304. Width="40"
  305. Height="40"
  306. Background="Transparent"
  307. Command="{Binding OpenLoginCommand}"
  308. Style="{StaticResource subToolBar}"
  309. Visibility="{Binding LoginVis, Mode=TwoWay}">
  310. <Grid>
  311. <Border
  312. x:Name="myBorder2"
  313. Width="24"
  314. Height="24"
  315. Background="White"
  316. CornerRadius="12" />
  317. <Border
  318. Width="24"
  319. Height="24"
  320. Background="{StaticResource color.icon.base.neutral.norm.lv1}"
  321. BorderBrush="{StaticResource color.icon.base.neutral.norm.lv1}">
  322. <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" />
  323. <Border.OpacityMask>
  324. <VisualBrush Visual="{Binding ElementName=myBorder2}" />
  325. </Border.OpacityMask>
  326. </Border>
  327. <Border
  328. Width="24"
  329. Height="24"
  330. BorderBrush="{StaticResource color.icon.base.neutral.norm.lv1}"
  331. BorderThickness="2"
  332. CornerRadius="100" />
  333. </Grid>
  334. </Button>
  335. <Button
  336. x:Name="Btn_User"
  337. Width="40"
  338. Height="40"
  339. Background="Transparent"
  340. Command="{Binding OpenUserCommand}"
  341. Style="{StaticResource subToolBar}"
  342. Visibility="{Binding UserVis, Mode=TwoWay}">
  343. <Grid>
  344. <Border
  345. Width="24"
  346. Height="24"
  347. Background="#1770F4"
  348. BorderBrush="#1770F4"
  349. CornerRadius="100">
  350. <TextBlock
  351. HorizontalAlignment="Center"
  352. VerticalAlignment="Center"
  353. FontSize="14"
  354. FontFamily="SF Pro Text"
  355. FontWeight="SemiBold"
  356. Foreground="White"
  357. Text="{Binding Useremailchar}" />
  358. </Border>
  359. </Grid>
  360. </Button>
  361. <Separator BorderBrush="#94989C" BorderThickness="1">
  362. <Separator.LayoutTransform>
  363. <RotateTransform Angle="90" />
  364. </Separator.LayoutTransform>
  365. </Separator>
  366. <Button
  367. Name="BtnMiniSize"
  368. Width="40"
  369. Height="40"
  370. Background="Transparent"
  371. BorderThickness="0"
  372. Click="BtnMiniSize_Click"
  373. Style="{StaticResource TitleBarBtn}">
  374. <Polygon Fill="{StaticResource color.btn.sec.text.def}" Points="14 7 14 8 2 8 2 7">
  375. <Polygon.RenderTransform>
  376. <TransformGroup>
  377. <TranslateTransform Y="-3" />
  378. </TransformGroup>
  379. </Polygon.RenderTransform>
  380. </Polygon>
  381. </Button>
  382. <Button
  383. Name="BtnReStore"
  384. Width="40"
  385. Height="40"
  386. Background="Transparent"
  387. BorderThickness="0"
  388. Click="BtnReStore_Click"
  389. Style="{StaticResource TitleBarBtn}">
  390. <Grid>
  391. <Path
  392. x:Name="ico_max"
  393. Data="M14,2 L14,14 L2,14 L2,2 L14,2 Z M13,3 L3,3 L3,13 L13,13 L13,3 Z"
  394. Fill="{StaticResource color.btn.sec.text.def}"
  395. Visibility="Collapsed" />
  396. <Grid x:Name="ico_mini" Visibility="{Binding ElementName=ico_max, Path=Visibility, Converter={StaticResource UnvisibleConvert}}">
  397. <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}" />
  398. <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" />
  399. </Grid>
  400. </Grid>
  401. </Button>
  402. <Button
  403. Name="BtnClose"
  404. Width="40"
  405. Height="40"
  406. Background="Transparent"
  407. BorderThickness="0"
  408. Click="BtnClose_Click"
  409. Style="{StaticResource CloseBtn}">
  410. <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" />
  411. </Button>
  412. </StackPanel>
  413. <!-- OCR Progress Control -->
  414. <Grid Grid.RowSpan="2" Visibility="{Binding IsProcessVisible}">
  415. <Grid.Background>
  416. <SolidColorBrush Opacity="0.05" Color="Black" />
  417. </Grid.Background>
  418. <Border
  419. Width="226"
  420. Height="58"
  421. Background="{StaticResource color.sys.layout.dark.bg}"
  422. BorderThickness="0"
  423. CornerRadius="{StaticResource border-radius.8}"
  424. Effect="{StaticResource shadow.neutral.m}">
  425. <Grid Margin="16,13" Background="Transparent">
  426. <StackPanel Orientation="Horizontal">
  427. <TextBlock Foreground="{StaticResource color.sys.text.anti.norm}" Text="{Binding ProgressTitle}" />
  428. <TextBlock Foreground="{StaticResource color.sys.text.anti.norm}" Text="{Binding Value, StringFormat={}({0})}" />
  429. </StackPanel>
  430. <Button
  431. Width="12"
  432. Height="12"
  433. Padding="0,0,1,1"
  434. HorizontalAlignment="Right"
  435. VerticalAlignment="Top"
  436. Background="{StaticResource color.sys.layout.dark.bg}"
  437. BorderThickness="0"
  438. Command="{Binding CloseOCRCommand}"
  439. Visibility="{Binding ProcessCloseBtnVisible}">
  440. <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" />
  441. </Button>
  442. <ProgressBar
  443. Height="4"
  444. Margin="0,0,0,4"
  445. VerticalAlignment="Bottom"
  446. BorderThickness="0"
  447. Foreground="{StaticResource color.slider.track-filled.norm}"
  448. Maximum="{Binding MaxValue}"
  449. Value="{Binding Value}" />
  450. </Grid>
  451. </Border>
  452. </Grid>
  453. </Grid>
  454. </Window>