HomeContent.xaml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  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="270" />
  57. <ColumnDefinition Width="*" />
  58. </Grid.ColumnDefinitions>
  59. <!-- 左侧菜单栏 -->
  60. <StackPanel>
  61. <Button
  62. x:Name="Home"
  63. Height="64"
  64. Margin="32,32,32,0"
  65. Command="{Binding ShowToolCommand}"
  66. CommandParameter="Guid"
  67. Foreground="#FFFFFF"
  68. Style="{StaticResource NoColorBtn}">
  69. <StackPanel Orientation="Horizontal">
  70. <Image
  71. Margin="0,0,8,0"
  72. Width="28"
  73. Height="28"
  74. Source="pack://application:,,,/PDF Master;component/Resources/HomeIcon/home.png" />
  75. <TextBlock
  76. Width="156"
  77. Foreground="{StaticResource color.sys.text.neutral.lv1}"
  78. FontWeight="DemiBold"
  79. VerticalAlignment="Center"
  80. FontFamily="Segoe UI"
  81. FontSize="16"
  82. Text="Home" />
  83. </StackPanel>
  84. </Button>
  85. <Button
  86. Height="64"
  87. Margin="32,8,32,0"
  88. Command="{Binding ShowToolCommand}"
  89. CommandParameter="ChatGPTAITranslationContent"
  90. Foreground="#FFFFFF"
  91. Style="{StaticResource NoColorBtn}">
  92. <StackPanel Orientation="Horizontal">
  93. <Image
  94. Margin="0,0,8,0"
  95. Width="28"
  96. Height="28"
  97. Source="pack://application:,,,/PDF Master;component/Resources/HomeIcon/Translation.png" />
  98. <TextBlock
  99. Width="156"
  100. Foreground="{StaticResource color.sys.text.neutral.lv1}"
  101. FontWeight="DemiBold"
  102. VerticalAlignment="Center"
  103. FontFamily="Segoe UI"
  104. FontSize="16"
  105. Text="AI Translation" />
  106. </StackPanel>
  107. </Button>
  108. <Button
  109. Height="64"
  110. Margin="32,8,32,0"
  111. Command="{Binding ShowToolCommand}"
  112. CommandParameter="ChatGPTAIRewritingContent"
  113. Foreground="#FFFFFF"
  114. Style="{StaticResource NoColorBtn}">
  115. <StackPanel Orientation="Horizontal">
  116. <Image
  117. Margin="0,0,8,0"
  118. Width="28"
  119. Height="28"
  120. Source="pack://application:,,,/PDF Master;component/Resources/HomeIcon/Rewriting.png" />
  121. <TextBlock
  122. Width="156"
  123. Foreground="{StaticResource color.sys.text.neutral.lv1}"
  124. FontWeight="DemiBold"
  125. VerticalAlignment="Center"
  126. FontFamily="Segoe UI"
  127. FontSize="16"
  128. Text="AI Rewriting" />
  129. </StackPanel>
  130. </Button>
  131. <Button
  132. Height="64"
  133. Margin="32,8,32,0"
  134. Command="{Binding ShowToolCommand}"
  135. CommandParameter="ChatGPTAIErrorCorrectionContent"
  136. Foreground="#FFFFFF"
  137. Style="{StaticResource NoColorBtn}">
  138. <StackPanel Orientation="Horizontal">
  139. <Image
  140. Margin="0,0,8,0"
  141. Width="28"
  142. Height="28"
  143. Source="pack://application:,,,/PDF Master;component/Resources/HomeIcon/Error_Correction.png" />
  144. <TextBlock
  145. Width="156"
  146. Foreground="{StaticResource color.sys.text.neutral.lv1}"
  147. FontWeight="DemiBold"
  148. VerticalAlignment="Center"
  149. FontFamily="Segoe UI"
  150. FontSize="16"
  151. Text="AI Error Correction" />
  152. </StackPanel>
  153. </Button>
  154. <Button
  155. Visibility="Collapsed"
  156. x:Name="BtnOpenPDF"
  157. Height="40"
  158. Margin="32,8,32,0"
  159. Command="{Binding OpenFileCommand}"
  160. Foreground="#FFFFFF"
  161. Style="{StaticResource btn.brand}">
  162. <StackPanel Orientation="Horizontal">
  163. <TextBlock
  164. x:Name="TxbOpenPDF"
  165. VerticalAlignment="Center"
  166. FontFamily="Segoe UI"
  167. FontSize="16"
  168. Text="{Binding T_OpenFiles}" />
  169. </StackPanel>
  170. </Button>
  171. <Grid Margin="32,16,32,24" Visibility="Collapsed">
  172. <Button
  173. x:Name="BtnCreatPDF"
  174. Height="40"
  175. Command="{Binding CreateFromOtherFile}"
  176. Content="{Binding T_CreatePDF}"
  177. FontSize="16"
  178. Initialized="BtnCreatPDF_Initialized"
  179. Style="{StaticResource btn.sec}">
  180. <Button.ContextMenu>
  181. <ContextMenu Name="ContextCreatePDF" Closed="ContextCreatePDF_Closed">
  182. <MenuItem Command="{Binding CreateBlackPDFCommand}" Header="{Binding T_CreatePDFToNew}" />
  183. <MenuItem
  184. Command="{Binding CreateFromHtmlCommnd}"
  185. Header="New From Web Page"
  186. Visibility="Collapsed" />
  187. <MenuItem Command="{Binding CreateFromScanner}" Header="Import From Scanner" />
  188. </ContextMenu>
  189. </Button.ContextMenu>
  190. </Button>
  191. <Button
  192. Name="BtnExpand"
  193. Width="26"
  194. Height="32"
  195. Margin="4"
  196. HorizontalAlignment="Right"
  197. Click="BtnExpand_Click"
  198. Style="{StaticResource btn.icon-fill}">
  199. <Path
  200. Width="12"
  201. Height="12"
  202. 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"
  203. Fill="{StaticResource color.icon.arrow.gray.def}" />
  204. </Button>
  205. </Grid>
  206. <customControl:CustomIconToggleBtn
  207. x:Name="BtnGuid"
  208. Width="216"
  209. Height="40"
  210. Margin="0,24,0,0"
  211. HorizontalContentAlignment="Left"
  212. Click="ToggleBtnSelect_Click"
  213. Command="{Binding ShowToolCommand}"
  214. CommandParameter="Guid"
  215. Style="{StaticResource ToggleBtnSelectStyle}"
  216. Tag="GridMode"
  217. Visibility="Collapsed">
  218. <StackPanel Margin="8,0,8,0" Orientation="Horizontal">
  219. <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}" />
  220. <TextBlock
  221. x:Name="TxbHome"
  222. Margin="8,0,0,0"
  223. VerticalAlignment="Center"
  224. FontFamily="SF Pro Text"
  225. FontSize="14"
  226. Text="Home" />
  227. </StackPanel>
  228. </customControl:CustomIconToggleBtn>
  229. <customControl:CustomIconToggleBtn
  230. x:Name="BtnTool"
  231. Width="216"
  232. Height="40"
  233. HorizontalContentAlignment="Left"
  234. Click="ToggleBtnSelect_Click"
  235. Command="{Binding ShowToolCommand}"
  236. CommandParameter="Tools"
  237. Style="{StaticResource ToggleBtnSelectStyle}"
  238. Tag="GridMode"
  239. Visibility="Collapsed">
  240. <StackPanel Margin="8,0,8,0" Orientation="Horizontal">
  241. <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}" />
  242. <TextBlock
  243. x:Name="TxbTool"
  244. Margin="8,0,0,0"
  245. VerticalAlignment="Center"
  246. FontFamily="SF Pro Text"
  247. FontSize="14"
  248. Text="Tool" />
  249. </StackPanel>
  250. </customControl:CustomIconToggleBtn>
  251. <customControl:CustomIconToggleBtn
  252. x:Name="BtnCloud"
  253. Width="216"
  254. Height="40"
  255. HorizontalContentAlignment="Left"
  256. Click="ToggleBtnSelect_Click"
  257. Command="{Binding ShowToolCommand}"
  258. CommandParameter="Cloud"
  259. Style="{StaticResource ToggleBtnSelectStyle}"
  260. Tag="GridMode"
  261. Visibility="Collapsed">
  262. <StackPanel Margin="8,0,8,0" Orientation="Horizontal">
  263. <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}" />
  264. <TextBlock
  265. x:Name="TxbCloud"
  266. Margin="8,0,0,0"
  267. VerticalAlignment="Center"
  268. FontFamily="SF Pro Text"
  269. FontSize="14"
  270. Text="Cloud" />
  271. </StackPanel>
  272. </customControl:CustomIconToggleBtn>
  273. </StackPanel>
  274. <homePanel:PromotionContent Grid.Row="1" Visibility="Collapsed" />
  275. <!-- 右侧内容区域 -->
  276. <ContentControl
  277. Grid.RowSpan="2"
  278. Grid.Column="1"
  279. prism:RegionManager.RegionName="{Binding ToolRegionName}" />
  280. <cus:LoadingControl
  281. Grid.RowSpan="2"
  282. Grid.ColumnSpan="2"
  283. Visibility="{Binding IsLoading}" />
  284. </Grid>
  285. </UserControl>