HomeContent.xaml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292
  1. <UserControl
  2. x:Class="PDF_Master.Views.HomeContent"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:cus="clr-namespace:PDF_Master.CustomControl"
  6. xmlns:customControl="clr-namespace:PDF_Master.CustomControl"
  7. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  8. xmlns:homePanel="clr-namespace:PDF_Master.Views.HomePanel"
  9. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  10. xmlns:prism="http://prismlibrary.com/"
  11. xmlns:viewmodels="clr-namespace:PDF_Master.ViewModels"
  12. d:DataContext="{d:DesignInstance Type=viewmodels:HomeContentViewModel}"
  13. d:DesignHeight="450"
  14. d:DesignWidth="800"
  15. prism:ViewModelLocator.AutoWireViewModel="True"
  16. AllowDrop="True"
  17. DragEnter="UserControl_DragEnter"
  18. DragLeave="UserControl_DragLeave"
  19. DragOver="UserControl_DragOver"
  20. Drop="UserControl_Drop"
  21. mc:Ignorable="d">
  22. <UserControl.InputBindings>
  23. <KeyBinding Command="{Binding OpenFileCommand}" Gesture="Ctrl+O" />
  24. <KeyBinding Command="{Binding CreateBlackPDFCommand}" Gesture="Ctrl+N" />
  25. </UserControl.InputBindings>
  26. <UserControl.Resources>
  27. <ResourceDictionary>
  28. <ResourceDictionary.MergedDictionaries>
  29. <ResourceDictionary Source="../Styles/CustomBtnStyle.xaml" />
  30. </ResourceDictionary.MergedDictionaries>
  31. <DataTemplate x:Key="PromotionDataTemplate">
  32. <StackPanel
  33. Margin="0,10,0,10"
  34. Background="White"
  35. Cursor="Hand"
  36. Orientation="Horizontal">
  37. <Image
  38. Width="16"
  39. Height="16"
  40. Margin="0,0,10,0"
  41. Source="{Binding ImagePath}" />
  42. <TextBlock
  43. FontSize="14"
  44. Foreground="#6B6F7D"
  45. Text="{Binding Content}" />
  46. </StackPanel>
  47. </DataTemplate>
  48. </ResourceDictionary>
  49. </UserControl.Resources>
  50. <Grid Background="{StaticResource color.sys.layout.mg}">
  51. <Grid.RowDefinitions>
  52. <RowDefinition Height="Auto" />
  53. <RowDefinition />
  54. </Grid.RowDefinitions>
  55. <Grid.ColumnDefinitions>
  56. <ColumnDefinition Width="248" />
  57. <ColumnDefinition Width="*" />
  58. </Grid.ColumnDefinitions>
  59. <!-- 左侧菜单栏 -->
  60. <StackPanel>
  61. <RadioButton
  62. IsChecked="True"
  63. x:Name="Home"
  64. Height="64"
  65. Margin="16,24,16,0"
  66. Command="{Binding ShowToolCommand}"
  67. CommandParameter="Guid"
  68. Foreground="#FFFFFF"
  69. Style="{StaticResource HomeContentLeftBtn}">
  70. <StackPanel Orientation="Horizontal">
  71. <Image
  72. Margin="0,0,8,0"
  73. Width="28"
  74. Height="28"
  75. Source="pack://application:,,,/PDF Master;component/Resources/HomeIcon/home.png" />
  76. <TextBlock
  77. Width="156"
  78. Foreground="{StaticResource color.sys.text.neutral.lv1}"
  79. FontWeight="DemiBold"
  80. VerticalAlignment="Center"
  81. FontFamily="Segoe UI"
  82. FontSize="16"
  83. Text="{Binding T_HomeBtn}" />
  84. </StackPanel>
  85. </RadioButton>
  86. <RadioButton
  87. Height="64"
  88. Margin="16,8,16,0"
  89. Command="{Binding ShowToolCommand}"
  90. CommandParameter="ChatGPTAITranslationContent"
  91. Foreground="#FFFFFF"
  92. Style="{StaticResource HomeContentLeftBtn}">
  93. <StackPanel Orientation="Horizontal">
  94. <Image
  95. Margin="0,0,8,0"
  96. Width="28"
  97. Height="28"
  98. Source="pack://application:,,,/PDF Master;component/Resources/HomeIcon/Translation.png" />
  99. <TextBlock
  100. Width="156"
  101. Foreground="{StaticResource color.sys.text.neutral.lv1}"
  102. FontWeight="DemiBold"
  103. VerticalAlignment="Center"
  104. FontFamily="Segoe UI"
  105. FontSize="16"
  106. Text="{Binding T_AITranslationBtn}" />
  107. </StackPanel>
  108. </RadioButton>
  109. <RadioButton
  110. Height="64"
  111. Margin="16,8,16,0"
  112. Command="{Binding ShowToolCommand}"
  113. CommandParameter="ChatGPTAIRewritingContent"
  114. Foreground="#FFFFFF"
  115. Style="{StaticResource HomeContentLeftBtn}">
  116. <StackPanel Orientation="Horizontal">
  117. <Image
  118. Margin="0,0,8,0"
  119. Width="28"
  120. Height="28"
  121. Source="pack://application:,,,/PDF Master;component/Resources/HomeIcon/Rewriting.png" />
  122. <TextBlock
  123. Width="156"
  124. Foreground="{StaticResource color.sys.text.neutral.lv1}"
  125. FontWeight="DemiBold"
  126. VerticalAlignment="Center"
  127. FontFamily="Segoe UI"
  128. FontSize="16"
  129. Text="{Binding T_AIRewritingBtn}" />
  130. </StackPanel>
  131. </RadioButton>
  132. <RadioButton
  133. Height="64"
  134. Margin="16,8,16,0"
  135. Command="{Binding ShowToolCommand}"
  136. CommandParameter="ChatGPTAIErrorCorrectionContent"
  137. Foreground="#FFFFFF"
  138. Style="{StaticResource HomeContentLeftBtn}">
  139. <StackPanel Orientation="Horizontal">
  140. <Image
  141. Margin="0,0,8,0"
  142. Width="28"
  143. Height="28"
  144. Source="pack://application:,,,/PDF Master;component/Resources/HomeIcon/Error_Correction.png" />
  145. <TextBlock
  146. Width="156"
  147. Foreground="{StaticResource color.sys.text.neutral.lv1}"
  148. FontWeight="DemiBold"
  149. VerticalAlignment="Center"
  150. FontFamily="Segoe UI"
  151. FontSize="16"
  152. Text="{Binding T_AIErrorCorrectionBtn}" />
  153. </StackPanel>
  154. </RadioButton>
  155. <Button
  156. Visibility="Collapsed"
  157. x:Name="BtnOpenPDF"
  158. Height="40"
  159. Margin="32,8,32,0"
  160. Command="{Binding OpenFileCommand}"
  161. Foreground="#FFFFFF"
  162. Style="{StaticResource btn.brand}">
  163. <StackPanel Orientation="Horizontal">
  164. <TextBlock
  165. x:Name="TxbOpenPDF"
  166. VerticalAlignment="Center"
  167. FontFamily="Segoe UI"
  168. FontSize="16"
  169. Text="{Binding T_OpenFiles}" />
  170. </StackPanel>
  171. </Button>
  172. <Grid Margin="32,16,32,24" Visibility="Collapsed">
  173. <Button
  174. x:Name="BtnCreatPDF"
  175. Height="40"
  176. Command="{Binding CreateFromOtherFile}"
  177. Content="{Binding T_CreatePDF}"
  178. FontSize="16"
  179. Initialized="BtnCreatPDF_Initialized"
  180. Style="{StaticResource btn.sec}">
  181. <Button.ContextMenu>
  182. <ContextMenu Name="ContextCreatePDF" Closed="ContextCreatePDF_Closed">
  183. <MenuItem Command="{Binding CreateBlackPDFCommand}" Header="{Binding T_CreatePDFToNew}" />
  184. <MenuItem
  185. Command="{Binding CreateFromHtmlCommnd}"
  186. Header="New From Web Page"
  187. Visibility="Collapsed" />
  188. <MenuItem Command="{Binding CreateFromScanner}" Header="Import From Scanner" />
  189. </ContextMenu>
  190. </Button.ContextMenu>
  191. </Button>
  192. <Button
  193. Name="BtnExpand"
  194. Width="26"
  195. Height="32"
  196. Margin="4"
  197. HorizontalAlignment="Right"
  198. Click="BtnExpand_Click"
  199. Style="{StaticResource btn.icon-fill}">
  200. <Path
  201. Width="12"
  202. Height="12"
  203. Data="M6 7.56434L2.03039 3.59473L0.969727 4.65539L5.46967 9.15533C5.76256 9.44822 6.23743 9.44822 6.53033 9.15533L11.0303 4.65539L9.9696 3.59473L6 7.56434Z"
  204. Fill="{StaticResource color.icon.arrow.gray.def}" />
  205. </Button>
  206. </Grid>
  207. <customControl:CustomIconToggleBtn
  208. x:Name="BtnGuid"
  209. Width="216"
  210. Height="40"
  211. Margin="0,24,0,0"
  212. HorizontalContentAlignment="Left"
  213. Click="ToggleBtnSelect_Click"
  214. Command="{Binding ShowToolCommand}"
  215. CommandParameter="Guid"
  216. Style="{StaticResource ToggleBtnSelectStyle}"
  217. Tag="GridMode"
  218. Visibility="Collapsed">
  219. <StackPanel Margin="8,0,8,0" Orientation="Horizontal">
  220. <Path Data="M3.8655 5.79653C3.32363 6.16977 3 6.78565 3 7.44363V15C3 16.1046 3.89543 17 5 17H9V13.1785C9 12.6262 9.44772 12.1785 10 12.1785C10.5523 12.1785 11 12.6262 11 13.1785V17H15C16.1046 17 17 16.1046 17 15V7.44363C17 6.78565 16.6764 6.16977 16.1345 5.79653L11.1345 2.3526C10.4514 1.88206 9.54865 1.88206 8.8655 2.3526L3.8655 5.79653Z" Fill="{Binding ElementName=BtnGuid, Path=Foreground}" />
  221. <TextBlock
  222. x:Name="TxbHome"
  223. Margin="8,0,0,0"
  224. VerticalAlignment="Center"
  225. FontFamily="SF Pro Text"
  226. FontSize="14"
  227. Text="Home" />
  228. </StackPanel>
  229. </customControl:CustomIconToggleBtn>
  230. <customControl:CustomIconToggleBtn
  231. x:Name="BtnTool"
  232. Width="216"
  233. Height="40"
  234. HorizontalContentAlignment="Left"
  235. Click="ToggleBtnSelect_Click"
  236. Command="{Binding ShowToolCommand}"
  237. CommandParameter="Tools"
  238. Style="{StaticResource ToggleBtnSelectStyle}"
  239. Tag="GridMode"
  240. Visibility="Collapsed">
  241. <StackPanel Margin="8,0,8,0" Orientation="Horizontal">
  242. <Path Data="M3.8655 5.79653C3.32363 6.16977 3 6.78565 3 7.44363V15C3 16.1046 3.89543 17 5 17H9V13.1785C9 12.6262 9.44772 12.1785 10 12.1785C10.5523 12.1785 11 12.6262 11 13.1785V17H15C16.1046 17 17 16.1046 17 15V7.44363C17 6.78565 16.6764 6.16977 16.1345 5.79653L11.1345 2.3526C10.4514 1.88206 9.54865 1.88206 8.8655 2.3526L3.8655 5.79653Z" Fill="{Binding ElementName=BtnTool, Path=Foreground}" />
  243. <TextBlock
  244. x:Name="TxbTool"
  245. Margin="8,0,0,0"
  246. VerticalAlignment="Center"
  247. FontFamily="SF Pro Text"
  248. FontSize="14"
  249. Text="Tool" />
  250. </StackPanel>
  251. </customControl:CustomIconToggleBtn>
  252. <customControl:CustomIconToggleBtn
  253. x:Name="BtnCloud"
  254. Width="216"
  255. Height="40"
  256. HorizontalContentAlignment="Left"
  257. Click="ToggleBtnSelect_Click"
  258. Command="{Binding ShowToolCommand}"
  259. CommandParameter="Cloud"
  260. Style="{StaticResource ToggleBtnSelectStyle}"
  261. Tag="GridMode"
  262. Visibility="Collapsed">
  263. <StackPanel Margin="8,0,8,0" Orientation="Horizontal">
  264. <Path Data="M14.95 16.5H5.5C3.01472 16.5 1 14.4853 1 12C1 9.51472 3.01472 7.5 5.5 7.5L5.52018 7.50004C5.74751 4.9771 7.86787 3 10.45 3C13.1838 3 15.4 5.21619 15.4 7.95C15.4 8.10931 15.3925 8.26686 15.3778 8.42232C17.4134 8.63601 19 10.3577 19 12.45C19 14.6701 17.2137 16.4729 15 16.4997V16.5H14.95Z" Fill="{Binding ElementName=BtnCloud, Path=Foreground}" />
  265. <TextBlock
  266. x:Name="TxbCloud"
  267. Margin="8,0,0,0"
  268. VerticalAlignment="Center"
  269. FontFamily="SF Pro Text"
  270. FontSize="14"
  271. Text="Cloud" />
  272. </StackPanel>
  273. </customControl:CustomIconToggleBtn>
  274. </StackPanel>
  275. <homePanel:PromotionContent Grid.Row="1" Visibility="Collapsed" />
  276. <!-- 右侧内容区域 -->
  277. <ContentControl
  278. Grid.RowSpan="2"
  279. Grid.Column="1"
  280. prism:RegionManager.RegionName="{Binding ToolRegionName}" />
  281. <cus:LoadingControl
  282. Grid.RowSpan="2"
  283. Grid.ColumnSpan="2"
  284. Visibility="{Binding IsLoading}" />
  285. </Grid>
  286. </UserControl>