HomeContent.xaml 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. <UserControl
  2. x:Class="PDF_Office.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_Office.CustomControl"
  6. xmlns:customControl="clr-namespace:PDF_Office.CustomControl"
  7. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  8. xmlns:homePanel="clr-namespace:PDF_Office.Views.HomePanel"
  9. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  10. xmlns:prism="http://prismlibrary.com/"
  11. xmlns:viewmodels="clr-namespace:PDF_Office.ViewModels"
  12. d:DataContext="{d:DesignInstance Type=viewmodels:HomeContentViewModel}"
  13. d:DesignHeight="450"
  14. d:DesignWidth="800"
  15. prism:ViewModelLocator.AutoWireViewModel="True"
  16. mc:Ignorable="d">
  17. <UserControl.InputBindings>
  18. <KeyBinding Command="{Binding OpenFileCommand}" Gesture="Ctrl+O" />
  19. <KeyBinding Command="{Binding CreateBlackPDFCommand}" Gesture="Ctrl+N" />
  20. </UserControl.InputBindings>
  21. <UserControl.Resources>
  22. <ResourceDictionary>
  23. <ResourceDictionary.MergedDictionaries>
  24. <ResourceDictionary Source="../Styles/CustomBtnStyle.xaml" />
  25. </ResourceDictionary.MergedDictionaries>
  26. <DataTemplate x:Key="PromotionDataTemplate">
  27. <StackPanel
  28. Margin="0,10,0,10"
  29. Background="White"
  30. Cursor="Hand"
  31. Orientation="Horizontal">
  32. <Image
  33. Width="16"
  34. Height="16"
  35. Margin="0,0,10,0"
  36. Source="{Binding ImagePath}" />
  37. <TextBlock
  38. FontSize="14"
  39. Foreground="#6B6F7D"
  40. Text="{Binding Content}" />
  41. </StackPanel>
  42. </DataTemplate>
  43. </ResourceDictionary>
  44. </UserControl.Resources>
  45. <Grid>
  46. <Grid.RowDefinitions>
  47. <RowDefinition Height="Auto" />
  48. <RowDefinition />
  49. </Grid.RowDefinitions>
  50. <Grid.ColumnDefinitions>
  51. <ColumnDefinition Width="270" />
  52. <ColumnDefinition Width="*" />
  53. </Grid.ColumnDefinitions>
  54. <!-- 左侧菜单栏 -->
  55. <StackPanel Background="{StaticResource color.sys.layout.mg}">
  56. <Button
  57. x:Name="BtnOpenPDF"
  58. Height="40"
  59. Margin="41,54,41,0"
  60. Command="{Binding OpenFileCommand}"
  61. Foreground="#FFFFFF"
  62. Style="{StaticResource btn.brand}">
  63. <StackPanel Orientation="Horizontal">
  64. <TextBlock
  65. x:Name="TxbOpenPDF"
  66. VerticalAlignment="Center"
  67. FontFamily="Segoe UI"
  68. FontSize="16"
  69. Text="{Binding T_OpenFiles}" />
  70. </StackPanel>
  71. </Button>
  72. <Grid Margin="41,8,41,0">
  73. <Button
  74. x:Name="BtnCreatPDF"
  75. Width="188"
  76. Height="40"
  77. Command="{Binding CreateFromOtherFile}"
  78. Content="{Binding T_CreatePDF}"
  79. FontSize="16"
  80. Initialized="BtnCreatPDF_Initialized"
  81. Style="{StaticResource btn.sec}">
  82. <Button.ContextMenu>
  83. <ContextMenu Name="ContextCreatePDF" Closed="ContextCreatePDF_Closed">
  84. <MenuItem Command="{Binding CreateBlackPDFCommand}" Header="{Binding T_CreatePDFToNew}" />
  85. <MenuItem
  86. Command="{Binding CreateFromHtmlCommnd}"
  87. Header="New From Web Page"
  88. Visibility="Collapsed" />
  89. <MenuItem Command="{Binding CreateFromScanner}" Header="Import From Scanner" />
  90. </ContextMenu>
  91. </Button.ContextMenu>
  92. </Button>
  93. <Button
  94. Name="BtnExpand"
  95. Width="26"
  96. Height="32"
  97. Margin="4"
  98. HorizontalAlignment="Right"
  99. Click="BtnExpand_Click"
  100. Style="{StaticResource btn.icon-fill}">
  101. <Path
  102. Width="12"
  103. Height="12"
  104. 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"
  105. Fill="{StaticResource color.icon.arrow.gray.def}" />
  106. </Button>
  107. </Grid>
  108. <customControl:CustomIconToggleBtn
  109. x:Name="BtnGuid"
  110. Width="216"
  111. Height="40"
  112. Margin="0,24,0,0"
  113. HorizontalContentAlignment="Left"
  114. Click="ToggleBtnSelect_Click"
  115. Command="{Binding ShowToolCommand}"
  116. CommandParameter="Guid"
  117. Style="{StaticResource ToggleBtnSelectStyle}"
  118. Tag="GridMode"
  119. Visibility="Collapsed">
  120. <StackPanel Margin="8,0,8,0" Orientation="Horizontal">
  121. <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}" />
  122. <TextBlock
  123. x:Name="TxbHome"
  124. Margin="8,0,0,0"
  125. VerticalAlignment="Center"
  126. FontFamily="SF Pro Text"
  127. FontSize="14"
  128. Text="Home" />
  129. </StackPanel>
  130. </customControl:CustomIconToggleBtn>
  131. <customControl:CustomIconToggleBtn
  132. x:Name="BtnTool"
  133. Width="216"
  134. Height="40"
  135. HorizontalContentAlignment="Left"
  136. Click="ToggleBtnSelect_Click"
  137. Command="{Binding ShowToolCommand}"
  138. CommandParameter="Tools"
  139. Style="{StaticResource ToggleBtnSelectStyle}"
  140. Tag="GridMode"
  141. Visibility="Collapsed">
  142. <StackPanel Margin="8,0,8,0" Orientation="Horizontal">
  143. <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}" />
  144. <TextBlock
  145. x:Name="TxbTool"
  146. Margin="8,0,0,0"
  147. VerticalAlignment="Center"
  148. FontFamily="SF Pro Text"
  149. FontSize="14"
  150. Text="Tool" />
  151. </StackPanel>
  152. </customControl:CustomIconToggleBtn>
  153. <customControl:CustomIconToggleBtn
  154. x:Name="BtnCloud"
  155. Width="216"
  156. Height="40"
  157. HorizontalContentAlignment="Left"
  158. Click="ToggleBtnSelect_Click"
  159. Command="{Binding ShowToolCommand}"
  160. CommandParameter="Cloud"
  161. Style="{StaticResource ToggleBtnSelectStyle}"
  162. Tag="GridMode"
  163. Visibility="Collapsed">
  164. <StackPanel Margin="8,0,8,0" Orientation="Horizontal">
  165. <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}" />
  166. <TextBlock
  167. x:Name="TxbCloud"
  168. Margin="8,0,0,0"
  169. VerticalAlignment="Center"
  170. FontFamily="SF Pro Text"
  171. FontSize="14"
  172. Text="Cloud" />
  173. </StackPanel>
  174. </customControl:CustomIconToggleBtn>
  175. </StackPanel>
  176. <homePanel:PromotionContent Grid.Row="1" />
  177. <!-- 右侧内容区域 -->
  178. <ContentControl
  179. Grid.RowSpan="2"
  180. Grid.Column="1"
  181. prism:RegionManager.RegionName="{Binding ToolRegionName}" />
  182. <cus:LoadingControl
  183. Grid.RowSpan="2"
  184. Grid.ColumnSpan="2"
  185. Visibility="{Binding IsLoading}" />
  186. </Grid>
  187. </UserControl>