HomeContent.xaml 8.7 KB

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