HomeContent.xaml 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  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.Resources>
  18. <ResourceDictionary>
  19. <ResourceDictionary.MergedDictionaries>
  20. <ResourceDictionary Source="../Styles/CustomBtnStyle.xaml" />
  21. </ResourceDictionary.MergedDictionaries>
  22. <DataTemplate x:Key="PromotionDataTemplate">
  23. <StackPanel
  24. Margin="0,10,0,10"
  25. Background="White"
  26. Cursor="Hand"
  27. Orientation="Horizontal">
  28. <Image
  29. Width="16"
  30. Height="16"
  31. Margin="0,0,10,0"
  32. Source="{Binding ImagePath}" />
  33. <TextBlock
  34. FontSize="14"
  35. Foreground="#6B6F7D"
  36. Text="{Binding Content}" />
  37. </StackPanel>
  38. </DataTemplate>
  39. </ResourceDictionary>
  40. </UserControl.Resources>
  41. <Grid>
  42. <Grid.RowDefinitions>
  43. <RowDefinition Height="Auto" />
  44. <RowDefinition />
  45. </Grid.RowDefinitions>
  46. <Grid.ColumnDefinitions>
  47. <ColumnDefinition Width="270" />
  48. <ColumnDefinition Width="*" />
  49. </Grid.ColumnDefinitions>
  50. <!-- 左侧菜单栏 -->
  51. <StackPanel>
  52. <Button
  53. x:Name="BtnOpenPDF"
  54. Height="48"
  55. Margin="41,54,41,0"
  56. Background="#19233B"
  57. BorderThickness="1"
  58. Command="{Binding OpenFileCommand}"
  59. Foreground="#FFFFFF"
  60. Style="{StaticResource BlueBtnStyle}">
  61. <StackPanel Orientation="Horizontal">
  62. <TextBlock
  63. x:Name="TxbOpenPDF"
  64. VerticalAlignment="Center"
  65. FontFamily="Segoe UI"
  66. FontSize="16"
  67. Text="Open File" />
  68. </StackPanel>
  69. </Button>
  70. <Border
  71. Margin="41,8,41,0"
  72. BorderBrush="#000000"
  73. BorderThickness="1"
  74. CornerRadius="4">
  75. <Grid Width="188" Height="48">
  76. <Menu HorizontalAlignment="Right">
  77. <MenuItem
  78. Width="168"
  79. Height="48"
  80. Padding="138,0,0,0"
  81. HorizontalContentAlignment="Right">
  82. <MenuItem.Header>
  83. <Path
  84. Width="32"
  85. HorizontalAlignment="Right"
  86. VerticalAlignment="Center"
  87. Data="M12.0001 6.00012L8 10.0002L3.99988 6.00012"
  88. Stroke="#6B869C" />
  89. </MenuItem.Header>
  90. <MenuItem
  91. Width="158"
  92. Command="{Binding CreateBlackPDFCommand}"
  93. Header="新建空白PDF" />
  94. <MenuItem Header="从网页创建PDF" />
  95. <MenuItem Header="从扫描仪导入" />
  96. </MenuItem>
  97. </Menu>
  98. <Button
  99. Width="156"
  100. HorizontalAlignment="Left"
  101. Background="White"
  102. BorderThickness="0">
  103. <StackPanel Orientation="Horizontal">
  104. <Image
  105. Width="30"
  106. Height="30"
  107. Margin="18,0,12,0"
  108. Source="../Resources/HomeIcon/file_addition.png" />
  109. <TextBlock
  110. x:Name="TxbCreatePDF"
  111. VerticalAlignment="Center"
  112. FontFamily="Segoe UI"
  113. FontSize="16"
  114. Foreground="{StaticResource Common.ForGround.Blue}"
  115. Text="Creat PDF" />
  116. </StackPanel>
  117. </Button>
  118. </Grid>
  119. </Border>
  120. <customControl:CustomIconToggleBtn
  121. x:Name="BtnGuid"
  122. Width="216"
  123. Height="40"
  124. Margin="0,24,0,0"
  125. HorizontalContentAlignment="Left"
  126. Click="ToggleBtnSelect_Click"
  127. Command="{Binding ShowToolCommand}"
  128. CommandParameter="Guid"
  129. Style="{StaticResource ToggleBtnSelectStyle}"
  130. Tag="GridMode">
  131. <StackPanel Margin="8,0,8,0" Orientation="Horizontal">
  132. <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}" />
  133. <TextBlock
  134. x:Name="TxbHome"
  135. Margin="8,0,0,0"
  136. VerticalAlignment="Center"
  137. FontFamily="SF Pro Text"
  138. FontSize="14"
  139. Text="Home" />
  140. </StackPanel>
  141. </customControl:CustomIconToggleBtn>
  142. <customControl:CustomIconToggleBtn
  143. x:Name="BtnTool"
  144. Width="216"
  145. Height="40"
  146. HorizontalContentAlignment="Left"
  147. Click="ToggleBtnSelect_Click"
  148. Command="{Binding ShowToolCommand}"
  149. CommandParameter="Tools"
  150. Style="{StaticResource ToggleBtnSelectStyle}"
  151. Tag="GridMode">
  152. <StackPanel Margin="8,0,8,0" Orientation="Horizontal">
  153. <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}" />
  154. <TextBlock
  155. x:Name="TxbTool"
  156. Margin="8,0,0,0"
  157. VerticalAlignment="Center"
  158. FontFamily="SF Pro Text"
  159. FontSize="14"
  160. Text="Tool" />
  161. </StackPanel>
  162. </customControl:CustomIconToggleBtn>
  163. <customControl:CustomIconToggleBtn
  164. x:Name="BtnCloud"
  165. Width="216"
  166. Height="40"
  167. HorizontalContentAlignment="Left"
  168. Click="ToggleBtnSelect_Click"
  169. Command="{Binding ShowToolCommand}"
  170. CommandParameter="Cloud"
  171. Style="{StaticResource ToggleBtnSelectStyle}"
  172. Tag="GridMode">
  173. <StackPanel Margin="8,0,8,0" Orientation="Horizontal">
  174. <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}" />
  175. <TextBlock
  176. x:Name="TxbCloud"
  177. Margin="8,0,0,0"
  178. VerticalAlignment="Center"
  179. FontFamily="SF Pro Text"
  180. FontSize="14"
  181. Text="Cloud" />
  182. </StackPanel>
  183. </customControl:CustomIconToggleBtn>
  184. </StackPanel>
  185. <homePanel:PromotionContent Grid.Row="1" />
  186. <!-- 右侧内容区域 -->
  187. <ContentControl
  188. Grid.RowSpan="2"
  189. Grid.Column="1"
  190. prism:RegionManager.RegionName="{Binding ToolRegionName}" />
  191. <cus:LoadingControl
  192. Grid.RowSpan="2"
  193. Grid.ColumnSpan="2"
  194. Visibility="{Binding IsLoading}" />
  195. </Grid>
  196. </UserControl>