HomeContent.xaml 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  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. AllowDrop="True"
  15. DragEnter="UserControl_DragEnter"
  16. DragOver="UserControl_DragOver"
  17. DragLeave="UserControl_DragLeave"
  18. Drop="UserControl_Drop"
  19. d:DesignWidth="800"
  20. prism:ViewModelLocator.AutoWireViewModel="True"
  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>
  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 Background="{StaticResource color.sys.layout.mg}">
  61. <Button
  62. x:Name="BtnOpenPDF"
  63. Height="40"
  64. Margin="41,54,41,0"
  65. Command="{Binding OpenFileCommand}"
  66. Foreground="#FFFFFF"
  67. Style="{StaticResource btn.brand}">
  68. <StackPanel Orientation="Horizontal">
  69. <TextBlock
  70. x:Name="TxbOpenPDF"
  71. VerticalAlignment="Center"
  72. FontFamily="Segoe UI"
  73. FontSize="16"
  74. Text="{Binding T_OpenFiles}" />
  75. </StackPanel>
  76. </Button>
  77. <Grid Margin="41,8,41,0">
  78. <Button
  79. x:Name="BtnCreatPDF"
  80. Width="188"
  81. Height="40"
  82. Command="{Binding CreateFromOtherFile}"
  83. Content="{Binding T_CreatePDF}"
  84. FontSize="16"
  85. Initialized="BtnCreatPDF_Initialized"
  86. Style="{StaticResource btn.sec}">
  87. <Button.ContextMenu>
  88. <ContextMenu Name="ContextCreatePDF" Closed="ContextCreatePDF_Closed">
  89. <MenuItem Command="{Binding CreateBlackPDFCommand}" Header="{Binding T_CreatePDFToNew}" />
  90. <MenuItem
  91. Command="{Binding CreateFromHtmlCommnd}"
  92. Header="New From Web Page"
  93. Visibility="Collapsed" />
  94. <MenuItem Command="{Binding CreateFromScanner}" Header="Import From Scanner" />
  95. </ContextMenu>
  96. </Button.ContextMenu>
  97. </Button>
  98. <Button
  99. Name="BtnExpand"
  100. Width="26"
  101. Height="32"
  102. Margin="4"
  103. HorizontalAlignment="Right"
  104. Click="BtnExpand_Click"
  105. Style="{StaticResource btn.icon-fill}">
  106. <Path
  107. Width="12"
  108. Height="12"
  109. 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"
  110. Fill="{StaticResource color.icon.arrow.gray.def}" />
  111. </Button>
  112. </Grid>
  113. <customControl:CustomIconToggleBtn
  114. x:Name="BtnGuid"
  115. Width="216"
  116. Height="40"
  117. Margin="0,24,0,0"
  118. HorizontalContentAlignment="Left"
  119. Click="ToggleBtnSelect_Click"
  120. Command="{Binding ShowToolCommand}"
  121. CommandParameter="Guid"
  122. Style="{StaticResource ToggleBtnSelectStyle}"
  123. Tag="GridMode"
  124. Visibility="Collapsed">
  125. <StackPanel Margin="8,0,8,0" Orientation="Horizontal">
  126. <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}" />
  127. <TextBlock
  128. x:Name="TxbHome"
  129. Margin="8,0,0,0"
  130. VerticalAlignment="Center"
  131. FontFamily="SF Pro Text"
  132. FontSize="14"
  133. Text="Home" />
  134. </StackPanel>
  135. </customControl:CustomIconToggleBtn>
  136. <customControl:CustomIconToggleBtn
  137. x:Name="BtnTool"
  138. Width="216"
  139. Height="40"
  140. HorizontalContentAlignment="Left"
  141. Click="ToggleBtnSelect_Click"
  142. Command="{Binding ShowToolCommand}"
  143. CommandParameter="Tools"
  144. Style="{StaticResource ToggleBtnSelectStyle}"
  145. Tag="GridMode"
  146. Visibility="Collapsed">
  147. <StackPanel Margin="8,0,8,0" Orientation="Horizontal">
  148. <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}" />
  149. <TextBlock
  150. x:Name="TxbTool"
  151. Margin="8,0,0,0"
  152. VerticalAlignment="Center"
  153. FontFamily="SF Pro Text"
  154. FontSize="14"
  155. Text="Tool" />
  156. </StackPanel>
  157. </customControl:CustomIconToggleBtn>
  158. <customControl:CustomIconToggleBtn
  159. x:Name="BtnCloud"
  160. Width="216"
  161. Height="40"
  162. HorizontalContentAlignment="Left"
  163. Click="ToggleBtnSelect_Click"
  164. Command="{Binding ShowToolCommand}"
  165. CommandParameter="Cloud"
  166. Style="{StaticResource ToggleBtnSelectStyle}"
  167. Tag="GridMode"
  168. Visibility="Collapsed">
  169. <StackPanel Margin="8,0,8,0" Orientation="Horizontal">
  170. <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}" />
  171. <TextBlock
  172. x:Name="TxbCloud"
  173. Margin="8,0,0,0"
  174. VerticalAlignment="Center"
  175. FontFamily="SF Pro Text"
  176. FontSize="14"
  177. Text="Cloud" />
  178. </StackPanel>
  179. </customControl:CustomIconToggleBtn>
  180. </StackPanel>
  181. <homePanel:PromotionContent Grid.Row="1" />
  182. <!-- 右侧内容区域 -->
  183. <ContentControl
  184. Grid.RowSpan="2"
  185. Grid.Column="1"
  186. prism:RegionManager.RegionName="{Binding ToolRegionName}" />
  187. <cus:LoadingControl
  188. Grid.RowSpan="2"
  189. Grid.ColumnSpan="2"
  190. Visibility="{Binding IsLoading}" />
  191. </Grid>
  192. </UserControl>