HomeContent.xaml 8.2 KB

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