PageEditContent.xaml 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618
  1. <UserControl
  2. x:Class="PDF_Master.Views.PageEdit.PageEditContent"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:convert="clr-namespace:PDF_Master.DataConvert"
  6. xmlns:cus="clr-namespace:PDF_Master.CustomControl"
  7. xmlns:cussys="clr-namespace:PDF_Master.CustomControl.SystemControl"
  8. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  9. xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
  10. xmlns:local="clr-namespace:PDF_Master.Views.PageEdit"
  11. xmlns:mainpage="clr-namespace:PDF_Master.Strings.MainPage"
  12. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  13. xmlns:model="clr-namespace:PDF_Master.Model"
  14. xmlns:pageedit="clr-namespace:PDF_Master.Model.PageEdit"
  15. xmlns:pageedit1="clr-namespace:PDF_Master.ViewModels.PageEdit"
  16. xmlns:prism="http://prismlibrary.com/"
  17. xmlns:viewmodel="clr-namespace:PDF_Master.ViewModels.PageEdit"
  18. xmlns:wpftk="clr-namespace:WpfToolkit.Controls;assembly=VirtualizingWrapPanel"
  19. Name="PageEdit"
  20. d:DataContext="{d:DesignInstance Type=pageedit1:PageEditContentViewModel}"
  21. d:DesignHeight="450"
  22. d:DesignWidth="800"
  23. prism:ViewModelLocator.AutoWireViewModel="True"
  24. FocusVisualStyle="{x:Null}"
  25. IsVisibleChanged="PageEdit_IsVisibleChanged"
  26. Loaded="PageEdit_Loaded"
  27. SizeChanged="PageEdit_SizeChanged"
  28. Unloaded="PageEdit_Unloaded"
  29. mc:Ignorable="d">
  30. <UserControl.Resources>
  31. <ResourceDictionary>
  32. <convert:BoolToVisible x:Key="BoolToVisibleConvert" />
  33. <convert:UnVisivleConvert x:Key="UnVisibleConvert" />
  34. <convert:BoolToFontSizeConverter x:Key="BoolToFontSizeConverter" />
  35. <DataTemplate x:Key="PageEditListBoxItemTemplate" DataType="{x:Type pageedit:PageEditItem}">
  36. <Grid Name="BdRoot">
  37. <StackPanel AllowDrop="True">
  38. <Border
  39. Name="BdBorder"
  40. VerticalAlignment="Top"
  41. BorderBrush="Transparent"
  42. BorderThickness="2"
  43. CornerRadius="0">
  44. <Grid
  45. Name="GridRoot"
  46. Width="{Binding ItemSize.Width}"
  47. Height="{Binding ItemSize.Height}"
  48. Margin="1"
  49. Background="Transparent">
  50. <Image
  51. RenderOptions.BitmapScalingMode="HighQuality"
  52. Source="{Binding Image}"
  53. Stretch="Uniform"
  54. UseLayoutRounding="True" />
  55. <Border
  56. Width="18"
  57. Height="20"
  58. Margin="0,10,10,0"
  59. HorizontalAlignment="Right"
  60. VerticalAlignment="Top"
  61. Visibility="{Binding HaveBookMark, Converter={StaticResource BoolToVisibleConvert}}">
  62. <Path Data="M1.75 17.7778V0H0.25V19C0.25 19.2608 0.385462 19.5028 0.607729 19.6392C0.829997 19.7756 1.10716 19.7868 1.33966 19.6687L9 15.7775L16.6603 19.6687C16.8928 19.7868 17.17 19.7756 17.3923 19.6392C17.6145 19.5028 17.75 19.2608 17.75 19V0H16.25V17.7778L9.33966 14.2676C9.1262 14.1592 8.8738 14.1592 8.66034 14.2676L1.75 17.7778Z" Stroke="{StaticResource color.icon.base.accent}" />
  63. </Border>
  64. </Grid>
  65. </Border>
  66. <Border
  67. Name="BdPageNum"
  68. Margin="0,4,0,0"
  69. HorizontalAlignment="Center"
  70. VerticalAlignment="Bottom"
  71. Background="Transparent">
  72. <StackPanel
  73. Name="StkpnlButtom"
  74. Width="auto"
  75. MinWidth="10"
  76. HorizontalAlignment="Center"
  77. Background="Transparent">
  78. <TextBlock
  79. Width="auto"
  80. Height="22"
  81. Margin="0,4"
  82. HorizontalAlignment="Center"
  83. FontSize="14"
  84. Text="{Binding PageNumber}" />
  85. <TextBlock
  86. Width="auto"
  87. MinHeight="22"
  88. MaxWidth="{Binding ElementName=GridRoot, Path=ActualWidth}"
  89. HorizontalAlignment="Center"
  90. FontSize="{Binding FontSize}"
  91. Foreground="{StaticResource color.sys.text.neutral.lv2}"
  92. Text="{Binding PageSize}"
  93. TextWrapping="Wrap"
  94. Visibility="{Binding ShowPageSize, Converter={StaticResource BoolToVisibleConvert}}" />
  95. </StackPanel>
  96. </Border>
  97. </StackPanel>
  98. </Grid>
  99. </DataTemplate>
  100. <ContextMenu
  101. x:Key="ListBoxItemMenu"
  102. DataContext="{Binding Path=DataContext, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"
  103. Loaded="ContextMenu_Loaded">
  104. <MenuItem
  105. Header="{Binding T_InsertPage}"
  106. Tag="Insert"
  107. Visibility="Visible">
  108. <MenuItem
  109. Command="{Binding InsertCommand}"
  110. CommandParameter="{x:Static model:ParameterNames.InsertType_File}"
  111. Header="{Binding T_Insert}" />
  112. <MenuItem
  113. Command="{Binding InsertCommand}"
  114. CommandParameter="{x:Static model:ParameterNames.InsertType_Blank}"
  115. Header="{Binding T_InsertaBlankPage}" />
  116. <MenuItem
  117. Command="{Binding InsertCommand}"
  118. CommandParameter="{x:Static model:ParameterNames.InsertType_Custom}"
  119. Header="{Binding T_InsertaCustomPage}" />
  120. </MenuItem>
  121. <MenuItem
  122. Command="{Binding ExtractCommand}"
  123. Header="{Binding T_ExtractPage}"
  124. Tag="Extract"
  125. Visibility="Visible" />
  126. <MenuItem
  127. Command="{Binding ReplaceCommand}"
  128. Header="{Binding T_ReplacePage}"
  129. Tag="Replace"
  130. Visibility="{Binding IsBOTAThumb, Converter={StaticResource UnvisibleConvert}}" />
  131. <MenuItem
  132. Command="{Binding SplitCommand}"
  133. Header="{Binding T_Split}"
  134. Tag="Split"
  135. Visibility="Visible" />
  136. <MenuItem
  137. Command="{Binding ReverseCommand}"
  138. Header="{Binding T_Reverse}"
  139. Tag="Reverse"
  140. Visibility="Visible" />
  141. <MenuItem Command="{Binding DeleteCommand}" Header="{x:Static mainpage:MainPage.PageEdit_MenuDelete}" />
  142. <MenuItem
  143. Command="{Binding EnterPageEditCommand}"
  144. Header="Enter Page Edit"
  145. Visibility="{Binding IsBOTAThumb}" />
  146. <Separator Style="{StaticResource HorizontalSeparatorStyle}" />
  147. <MenuItem Command="{Binding RightRotateCommand}" Header="{x:Static mainpage:MainPage.PageEdit_MenuRotateClockwise}" />
  148. <MenuItem Command="{Binding LeftRotateCommand}" Header="{x:Static mainpage:MainPage.PageEdit_MenuRotateCounterclockwise}" />
  149. <Separator Style="{StaticResource HorizontalSeparatorStyle}" />
  150. <MenuItem Command="{Binding CopyCommand}" Header="{x:Static mainpage:MainPage.PageEdit_MenuCopy}" />
  151. <MenuItem Command="{Binding CutCommand}" Header="{x:Static mainpage:MainPage.PageEdit_MenuCut}" />
  152. <MenuItem Command="{Binding PasteCommand}" Header="{x:Static mainpage:MainPage.PageEdit_MenuPaste}" />
  153. <Separator Style="{StaticResource HorizontalSeparatorStyle}" />
  154. <MenuItem
  155. Command="{Binding ShowPageSizeCommand}"
  156. Header="{x:Static mainpage:MainPage.PageEdite_DisplayPageSize}"
  157. Visibility="{Binding ShowedPageSize}" />
  158. <MenuItem
  159. Name="MenuHidePageSize"
  160. Command="{Binding ShowPageSizeCommand}"
  161. Header="{x:Static mainpage:MainPage.PageEdite_HidePageSize}"
  162. Visibility="{Binding HidePageSize}" />
  163. <Separator Style="{StaticResource HorizontalSeparatorStyle}" Visibility="{Binding IsBOTAThumb, Converter={StaticResource UnVisibleConvert}}" />
  164. <MenuItem Click="MenuItem_Click" Header="{x:Static mainpage:MainPage.PageEdit_MenuPrint}" />
  165. </ContextMenu>
  166. <Style BasedOn="{StaticResource subToolBar}" TargetType="{x:Type Button}">
  167. <Setter Property="Width" Value="28" />
  168. <Setter Property="Height" Value="28" />
  169. </Style>
  170. <Style TargetType="{x:Type Path}">
  171. <Setter Property="Fill" Value="{StaticResource color.icon.base.brand}" />
  172. </Style>
  173. </ResourceDictionary>
  174. </UserControl.Resources>
  175. <UserControl.InputBindings>
  176. <KeyBinding Command="{Binding CopyCommand}" Gesture="Ctrl+C" />
  177. <KeyBinding Command="{Binding PasteCommand}" Gesture="Ctrl+V" />
  178. <KeyBinding Command="{Binding CutCommand}" Gesture="Ctrl+X" />
  179. <KeyBinding Command="{Binding RightRotateCommand}" Gesture="Ctrl+R" />
  180. <KeyBinding Command="{Binding LeftRotateCommand}" Gesture="Ctrl+L" />
  181. <KeyBinding Command="{Binding DeleteCommand}" Gesture="Delete" />
  182. <KeyBinding Key="Esc" Command="{Binding ClearSelectedCommand}" />
  183. <KeyBinding
  184. Key="Add"
  185. Command="{Binding ZoomInCommand}"
  186. Modifiers="Ctrl" />
  187. <KeyBinding
  188. Key="Subtract"
  189. Command="{Binding ZoomOutCommand}"
  190. Modifiers="Ctrl" />
  191. </UserControl.InputBindings>
  192. <Border
  193. AllowDrop="True"
  194. BorderBrush="#F2F2F2"
  195. BorderThickness="0,1,0,0"
  196. Drop="Border_Drop">
  197. <Grid
  198. DragLeave="Grid_DragLeave"
  199. DragOver="Grid_DragOver"
  200. Drop="Grid_Drop"
  201. PreviewDragEnter="Grid_PreviewDragEnter">
  202. <Grid.RowDefinitions>
  203. <RowDefinition Height="auto" />
  204. <RowDefinition />
  205. </Grid.RowDefinitions>
  206. <Grid
  207. Name="GridHeader"
  208. Height="40"
  209. Background="{StaticResource color.sys.layout.mg}"
  210. Focusable="True"
  211. PreviewMouseLeftButtonDown="Grid_PreviewMouseLeftButtonDown">
  212. <StackPanel
  213. Name="StkpnlCenter"
  214. HorizontalAlignment="Center"
  215. Orientation="Horizontal">
  216. <Grid>
  217. <ComboBox
  218. Name="CmbPageRange"
  219. Width="123"
  220. Height="23"
  221. InputMethod.IsInputMethodEnabled="False"
  222. IsEditable="True"
  223. ItemsSource="{Binding PageRangeItems}"
  224. LostFocus="TextBoxEx_LostFocus"
  225. PreviewTextInput="CmbPageRange_PreviewTextInput"
  226. SelectedIndex="{Binding ComboxSelectIndex, Mode=TwoWay}"
  227. Text="{Binding TbPageRange, Mode=TwoWay}">
  228. <i:Interaction.Triggers>
  229. <i:EventTrigger EventName="PreviewKeyDown">
  230. <i:InvokeCommandAction Command="{Binding PreviewKeyDown}" PassEventArgsToCommand="True" />
  231. </i:EventTrigger>
  232. </i:Interaction.Triggers>
  233. </ComboBox>
  234. </Grid>
  235. <Button
  236. Margin="5"
  237. Command="{Binding LeftRotateCommand}"
  238. ToolTip="{Binding T_RotateLeftToolTip}">
  239. <Path
  240. Width="29"
  241. Height="28"
  242. Data="M9.61772 12.8118C10.1691 10.0672 12.5932 8 15.5001 8C18.8138 8 21.5001 10.6863 21.5001 14C21.5001 17.3137 18.8138 20 15.5001 20C14.4056 20 13.3823 19.7078 12.5008 19.1979L11.4994 20.9291C12.6771 21.6104 14.0446 22 15.5001 22C19.9184 22 23.5001 18.4183 23.5001 14C23.5001 9.58172 19.9184 6 15.5001 6C11.6625 6 8.45601 8.70211 7.67946 12.3075L6.58239 10.4073L4.85034 11.4073L7.15034 15.3911C7.42648 15.8694 8.03807 16.0332 8.51637 15.7571L12.5001 13.4571L11.5001 11.725L9.61772 12.8118Z" />
  243. </Button>
  244. <Button
  245. Margin="5"
  246. Command="{Binding RightRotateCommand}"
  247. ToolTip="{Binding T_RotateRightToolTip}">
  248. <Path
  249. Width="29"
  250. Height="28"
  251. Data="M19.4129 12.9758C18.9269 10.15 16.4645 8 13.5 8C10.1863 8 7.5 10.6863 7.5 14C7.5 17.3137 10.1863 20 13.5 20C14.5945 20 15.6178 19.7078 16.4993 19.1979L17.5007 20.9291C16.323 21.6104 14.9555 22 13.5 22C9.08172 22 5.5 18.4183 5.5 14C5.5 9.58172 9.08172 6 13.5 6C17.1531 6 20.2343 8.44856 21.192 11.794L21.7091 9.86404L23.641 10.3817L22.4504 14.8249C22.3075 15.3584 21.7591 15.675 21.2257 15.532L16.7824 14.3415L17.3 12.4096L19.4129 12.9758Z" />
  252. </Button>
  253. <Separator
  254. Name="Separator"
  255. Width="1"
  256. Height="24"
  257. Margin="5,0"
  258. BorderBrush="#33000000"
  259. BorderThickness="5"
  260. Style="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}" />
  261. <!--<Menu
  262. Width="65"
  263. Height="20"
  264. Margin="5"
  265. Visibility="Visible">
  266. <MenuItem
  267. Width="65"
  268. Height="20"
  269. Header="插入">
  270. <MenuItem
  271. Command="{Binding InsertCommand}"
  272. CommandParameter="{x:Static model:ParameterNames.InsertType_File}"
  273. Header="插入文件" />
  274. <MenuItem
  275. Command="{Binding InsertCommand}"
  276. CommandParameter="{x:Static model:ParameterNames.InsertType_Blank}"
  277. Header="插入空白页" />
  278. <MenuItem
  279. Command="{Binding InsertCommand}"
  280. CommandParameter="{x:Static model:ParameterNames.InsertType_Custom}"
  281. Header="插入自定义页面" />
  282. </MenuItem>
  283. </Menu>-->
  284. <Button
  285. Name="BtnInsert"
  286. Click="BtnInsert_Click"
  287. Initialized="BtnInsert_Initialized"
  288. Style="{StaticResource InsideBarBtnStyle}"
  289. Visibility="Visible">
  290. <StackPanel Margin="4,0,4,0" Orientation="Horizontal">
  291. <Grid Margin="0,0,6,0">
  292. <Path Data="M10.5 18H4.5V2H12.3671L16.5 6.74847V10H18.5V6.74847C18.5 6.26584 18.3255 5.79948 18.0086 5.43542L13.8757 0.686951C13.4958 0.250541 12.9456 0 12.3671 0H4.5C3.39543 0 2.5 0.895431 2.5 2V18C2.5 19.1046 3.39543 20 4.5 20H10.5V18Z " Fill="#273C62" />
  293. <Path Data="M16.5 14V11H14.5V14H11.5V16H14.5V19H16.5V16H19.5V14H16.5Z " Fill="#94989C" />
  294. </Grid>
  295. <TextBlock VerticalAlignment="Center" Text="{Binding T_InsertFile}" />
  296. <Path
  297. Width="12"
  298. Height="12"
  299. Margin="3,0,0,0"
  300. Data="M6.5 10L11.5 4H1.5L6.5 10Z"
  301. Fill="{StaticResource color.icon.base.neutral.norm.lv1}" />
  302. </StackPanel>
  303. <Button.ContextMenu>
  304. <ContextMenu Name="MenuInsert" Placement="Bottom">
  305. <MenuItem
  306. Command="{Binding InsertCommand}"
  307. CommandParameter="{x:Static model:ParameterNames.InsertType_File}"
  308. Header="{Binding T_Insert}" />
  309. <MenuItem
  310. Command="{Binding InsertCommand}"
  311. CommandParameter="{x:Static model:ParameterNames.InsertType_Blank}"
  312. Header="{Binding T_InsertaBlankPage}" />
  313. <MenuItem
  314. Command="{Binding InsertCommand}"
  315. CommandParameter="{x:Static model:ParameterNames.InsertType_Custom}"
  316. Header="{Binding T_InsertaCustomPage}" />
  317. </ContextMenu>
  318. </Button.ContextMenu>
  319. </Button>
  320. <!--<Button
  321. Margin="5"
  322. Command="{Binding ExtractCommand}"
  323. Content="提取"
  324. Visibility="Visible" />-->
  325. <Button
  326. Width="75"
  327. Margin="5"
  328. HorizontalContentAlignment="Left"
  329. Command="{Binding ExtractCommand}"
  330. Visibility="Visible">
  331. <StackPanel Margin="4,0" Orientation="Horizontal">
  332. <Grid Margin="0,0,8,0">
  333. <Path Data="M10.5 18H4.5V2H12.3671L16.5 6.74847V10H18.5V6.74847C18.5 6.26584 18.3255 5.79948 18.0086 5.43542L13.8757 0.686951C13.4958 0.250541 12.9456 0 12.3671 0H4.5C3.39543 0 2.5 0.895431 2.5 2V18C2.5 19.1046 3.39543 20 4.5 20H10.5V18Z" Fill="#273C62" />
  334. <Path Data="M15.5087 15.6569H10.5V13.681H15.8487L14.5753 12.4112L15.9915 10.999L18.7937 13.7933L19.5018 14.4995L18.7937 15.2056L18.4258 15.5725V15.6569H18.3411L15.9915 17.9999L14.5753 16.5877L15.5087 15.6569Z" Fill="#94989C" />
  335. </Grid>
  336. <TextBlock VerticalAlignment="Center" Text="{Binding T_Extract}" />
  337. </StackPanel>
  338. </Button>
  339. <!--<Button
  340. Margin="5"
  341. Command="{Binding ReplaceCommand}"
  342. Content="替换"
  343. Visibility="Visible" />-->
  344. <Button
  345. Width="80"
  346. Margin="5"
  347. HorizontalContentAlignment="Left"
  348. Command="{Binding ReplaceCommand}"
  349. Visibility="Visible">
  350. <StackPanel Margin="4,0" Orientation="Horizontal">
  351. <Grid Margin="0,0,8,0">
  352. <Path Data="M10.5 18H4.5V2H12.3671L16.5 6.74847V10H18.5V6.74847C18.5 6.26584 18.3255 5.79948 18.0086 5.43542L13.8757 0.686951C13.4958 0.250541 12.9456 0 12.3671 0H4.5C3.39543 0 2.5 0.895431 2.5 2V18C2.5 19.1046 3.39543 20 4.5 20H10.5V18Z" Fill="#273C62" />
  353. <Path Data="M18.207 12.793L15.707 10.293L14.2928 11.7072L15.0857 12.5001H11.4999V14.5001H17.4999H19.9141L18.207 12.793ZM12.7928 17.2072L15.2928 19.7072L16.707 18.293L15.9141 17.5001H19.4999V15.5001H13.4999H11.0857L12.7928 17.2072Z" Fill="#94989C" />
  354. </Grid>
  355. <TextBlock VerticalAlignment="Center" Text="{Binding T_Replace}" />
  356. </StackPanel>
  357. </Button>
  358. <!--<Button
  359. Margin="5"
  360. Command="{Binding SplitCommand}"
  361. Content="拆分"
  362. Visibility="Visible" />-->
  363. <Button
  364. Width="68"
  365. Margin="5"
  366. HorizontalContentAlignment="Left"
  367. Command="{Binding SplitCommand}"
  368. Visibility="Visible">
  369. <StackPanel Margin="4,0" Orientation="Horizontal">
  370. <Grid Margin="0,0,8,0">
  371. <Path Data="M16.5 18H4.5V12H2.5V18C2.5 19.1046 3.39543 20 4.5 20H16.5C17.6046 20 18.5 19.1046 18.5 18V12H16.5V18ZM4.5 8V2H12.3671L16.5 6.74847V8H18.5V6.74847C18.5 6.26584 18.3255 5.79948 18.0086 5.43542L13.8757 0.686951C13.4958 0.250541 12.9456 0 12.3671 0H4.5C3.39543 0 2.5 0.895431 2.5 2V8H4.5Z" Fill="#273C62" />
  372. <Path Data="M1 9H4V11H1V9ZM5 9H8V11H5V9ZM12 9H9V11H12V9ZM13 9H16V11H13V9ZM20 9H17V11H20V9Z" Fill="#94989C" />
  373. </Grid>
  374. <TextBlock VerticalAlignment="Center" Text="{Binding T_Split}" />
  375. </StackPanel>
  376. </Button>
  377. <!--<Button
  378. Margin="5"
  379. Command="{Binding ReverseCommand}"
  380. Content="倒序"
  381. Visibility="Visible" />-->
  382. <Button
  383. Width="80"
  384. Margin="5"
  385. HorizontalContentAlignment="Left"
  386. Command="{Binding ReverseCommand}"
  387. Visibility="Visible">
  388. <StackPanel Margin="4,0" Orientation="Horizontal">
  389. <Grid Margin="0,0,8,0">
  390. <Path Data="M2.5 18H13V6.74847L8.86707 2H2.5L2.5 18ZM2.5 0C1.39543 0 0.5 0.895431 0.5 2V18C0.5 19.1046 1.39543 20 2.5 20H13C14.1046 20 15 19.1046 15 18V6.74847C15 6.26584 14.8255 5.79948 14.5086 5.43542L10.3757 0.686951C9.99584 0.250541 9.44563 0 8.86707 0H2.5Z" Fill="#273C62" />
  391. <Path Data="M16 0.379883L17.8137 2.9191L20.3137 6.41909L18.6863 7.58157L18 6.6208V20.0003H16V3.50034V0.379883Z" Fill="#94989C" />
  392. </Grid>
  393. <TextBlock VerticalAlignment="Center" Text="{Binding T_Reverse}" />
  394. </StackPanel>
  395. </Button>
  396. <Separator
  397. Width="1"
  398. Height="24"
  399. Margin="5,0"
  400. BorderBrush="#33000000"
  401. BorderThickness="5"
  402. Style="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}"
  403. Visibility="Visible" />
  404. <Button
  405. Margin="5"
  406. Command="{Binding DeleteCommand}"
  407. ToolTip="{Binding T_DeleteToolTip}">
  408. <Path
  409. Width="29"
  410. Height="28"
  411. Data="M12.5 6H16.5V4H12.5V6ZM21.5 9H23.5V7H19.5H9.5H5.5V9H7.5V22C7.5 23.1046 8.39543 24 9.5 24H19.5C20.6046 24 21.5 23.1046 21.5 22V9ZM19.5 9H9.5V22H19.5V9ZM13.5 19L13.5 12H15.5V19H13.5Z" />
  412. </Button>
  413. </StackPanel>
  414. <StackPanel
  415. Name="StkpnlRight"
  416. HorizontalAlignment="Right"
  417. Orientation="Horizontal">
  418. <Button Margin="4" Command="{Binding ZoomOutCommand}">
  419. <Path
  420. Width="28"
  421. Height="28"
  422. Data="M20 12.5C20 16.0899 17.0899 19 13.5 19C9.91015 19 7 16.0899 7 12.5C7 8.91015 9.91015 6 13.5 6C17.0899 6 20 8.91015 20 12.5ZM18.2928 19.5209C16.9284 20.4541 15.2779 21 13.5 21C8.80558 21 5 17.1944 5 12.5C5 7.80558 8.80558 4 13.5 4C18.1944 4 22 7.80558 22 12.5C22 14.6954 21.1677 16.6965 19.8013 18.2048L23.4741 22.0603L22.026 23.4397L18.2928 19.5209ZM10 11.5H17V13.5H10V11.5Z" />
  423. </Button>
  424. <Button Margin="4" Command="{Binding ZoomInCommand}">
  425. <Path
  426. Width="28"
  427. Height="28"
  428. Data="M20 12.5C20 16.0899 17.0899 19 13.5 19C9.91015 19 7 16.0899 7 12.5C7 8.91015 9.91015 6 13.5 6C17.0899 6 20 8.91015 20 12.5ZM18.2928 19.5209C16.9284 20.4541 15.2779 21 13.5 21C8.80558 21 5 17.1944 5 12.5C5 7.80558 8.80558 4 13.5 4C18.1944 4 22 7.80558 22 12.5C22 14.6954 21.1677 16.6965 19.8013 18.2048L23.4741 22.0603L22.026 23.4397L18.2928 19.5209ZM12.5 9V11.5H10V13.5H12.5V16H14.5V13.5H17V11.5H14.5V9H12.5Z" />
  429. </Button>
  430. </StackPanel>
  431. </Grid>
  432. <Border
  433. Name="GridBOTAHeader"
  434. BorderBrush="{StaticResource color.field.border.norm}"
  435. BorderThickness="0,0,0,1"
  436. Visibility="{Binding IsBOTAThumb}">
  437. <Grid
  438. Height="52"
  439. VerticalAlignment="Center"
  440. Background="{StaticResource color.sys.layout.mg}">
  441. <TextBlock
  442. Margin="16,0"
  443. VerticalAlignment="Center"
  444. FontFamily="Segoe UI"
  445. FontSize="14"
  446. FontWeight="SemiBold"
  447. LineHeight="20"
  448. Text="{Binding T_Title}" />
  449. <ToggleButton
  450. Name="TbnTwoLine"
  451. Width="32"
  452. Height="32"
  453. Margin="16,0"
  454. HorizontalAlignment="Right"
  455. Click="TbnTwoLine_Click"
  456. Style="{StaticResource SubToolbarTgb}">
  457. <Path
  458. Width="32"
  459. Height="32"
  460. Data="M18.2998 21.6998V10.2998H21.6998V21.6998H18.2998ZM16.7998 9.59981C16.7998 9.15798 17.1579 8.7998 17.5998 8.7998H22.3998C22.8416 8.7998 23.1998 9.15798 23.1998 9.5998V22.3998C23.1998 22.8416 22.8416 23.1998 22.3998 23.1998H17.5998C17.1579 23.1998 16.7998 22.8416 16.7998 22.3998V9.59981ZM10.2998 21.6998V10.2998H13.6998V21.6998H10.2998ZM8.7998 9.59981C8.7998 9.15798 9.15798 8.79981 9.5998 8.79981H14.3998C14.8416 8.79981 15.1998 9.15798 15.1998 9.59981V22.3998C15.1998 22.8416 14.8416 23.1998 14.3998 23.1998H9.59981C9.15798 23.1998 8.7998 22.8416 8.7998 22.3998V9.59981Z"
  461. Fill="{Binding ElementName=TbnTwoLine, Path=Foreground}" />
  462. </ToggleButton>
  463. </Grid>
  464. </Border>
  465. <ListBox
  466. Name="ListPageEdit"
  467. Grid.Row="1"
  468. Padding="0"
  469. AllowDrop="True"
  470. BorderThickness="0"
  471. Drop="ListPageEdit_Drop"
  472. FocusVisualStyle="{x:Null}"
  473. ItemTemplate="{StaticResource PageEditListBoxItemTemplate}"
  474. ItemsSource="{Binding PageEditItems}"
  475. PreviewMouseLeftButtonDown="ListPageEdit_PreviewMouseLeftButtonDown"
  476. PreviewMouseLeftButtonUp="ListPageEdit_PreviewMouseLeftButtonUp"
  477. PreviewMouseMove="ListPageEdit_PreviewMouseMove"
  478. ScrollBar.Scroll="ListPageEdit_Scroll"
  479. ScrollViewer.ScrollChanged="ListPageEdit_ScrollChanged"
  480. SelectedIndex="{Binding ListSelectedIndex, Mode=TwoWay}"
  481. SelectionMode="Extended"
  482. VirtualizingPanel.CacheLength="1"
  483. VirtualizingPanel.CacheLengthUnit="Page"
  484. VirtualizingPanel.IsVirtualizing="False"
  485. VirtualizingPanel.ScrollUnit="Pixel"
  486. VirtualizingPanel.VirtualizationMode="Standard">
  487. <!--
  488. VirtualizingPanel.IsVirtualizing="true"会加快item加载速度,但是会导致大量绑定失败,Debug时会比较卡顿。
  489. 需要综合情况来看是否要启用虚拟化
  490. -->
  491. <!--
  492. 此处要用循环模式,否则滚动时容易误触发EndSscroll 从而频繁拿图导致卡顿
  493. VirtualizingPanel.ScrollUnit="Pixel" 设置鼠标每次滚动的步进值
  494. VirtualizingPanel.VirtualizationMode="Standard" ‚
  495. 如果设置成循环模式,回导致偶现选中一页无法取消的情况
  496. -->
  497. <ListBox.ItemContainerStyle>
  498. <Style TargetType="{x:Type ListBoxItem}">
  499. <Setter Property="Template" Value="{StaticResource ListBoxItemControlTemplate}" />
  500. <Setter Property="Margin" Value="0,10" />
  501. <Setter Property="FocusVisualStyle" Value="{x:Null}" />
  502. <Setter Property="Visibility" Value="{Binding Visible}" />
  503. <Setter Property="IsSelected" Value="{Binding Selected, Mode=OneWayToSource}" />
  504. <Setter Property="HorizontalAlignment" Value="Center" />
  505. <Setter Property="VerticalAlignment" Value="Center" />
  506. <Setter Property="HorizontalContentAlignment" Value="Center" />
  507. <Setter Property="VerticalContentAlignment" Value="Center" />
  508. <!--<Setter Property="IsHitTestVisible" Value="False" />-->
  509. <Setter Property="ContextMenu" Value="{StaticResource ListBoxItemMenu}" />
  510. <EventSetter Event="DragLeave" Handler="ListBoxItem_DragLeave" />
  511. <EventSetter Event="PreviewMouseRightButtonDown" Handler="ListBoxItem_PreviewMouseRightButtonDown" />
  512. <EventSetter Event="PreviewMouseLeftButtonDown" Handler="ListBoxItem_PreviewMouseLeftButtonDown" />
  513. <EventSetter Event="PreviewMouseDoubleClick" Handler="ListBoxItem_PreviewMouseDoubleClick" />
  514. <Style.Triggers>
  515. <DataTrigger Binding="{Binding ElementName=GridBOTAHeader, Path=Visibility}" Value="Visible">
  516. <Setter Property="Template" Value="{StaticResource BOTAListBoxItemTemplate}" />
  517. </DataTrigger>
  518. </Style.Triggers>
  519. </Style>
  520. </ListBox.ItemContainerStyle>
  521. <ListBox.ItemsPanel>
  522. <ItemsPanelTemplate>
  523. <!-- item间距自适应 -->
  524. <wpftk:VirtualizingWrapPanel />
  525. </ItemsPanelTemplate>
  526. </ListBox.ItemsPanel>
  527. <i:Interaction.Triggers>
  528. <i:EventTrigger EventName="SelectionChanged">
  529. <i:InvokeCommandAction Command="{Binding SelectionChangedCommand}" PassEventArgsToCommand="True" />
  530. </i:EventTrigger>
  531. </i:Interaction.Triggers>
  532. <ListBox.Style>
  533. <Style TargetType="{x:Type ListBox}">
  534. <Style.Triggers>
  535. <DataTrigger Binding="{Binding ElementName=GridBOTAHeader, Path=Visibility}" Value="Visible">
  536. <Setter Property="Background" Value="{StaticResource color.sys.layout.mg}" />
  537. </DataTrigger>
  538. <DataTrigger Binding="{Binding ElementName=GridBOTAHeader, Path=Visibility}" Value="Collapsed">
  539. <Setter Property="Background" Value="{StaticResource color.sys.layout.bg.view}" />
  540. </DataTrigger>
  541. </Style.Triggers>
  542. </Style>
  543. </ListBox.Style>
  544. </ListBox>
  545. <!-- 框选的矩形框 -->
  546. <Rectangle
  547. Name="RectChoose"
  548. Grid.Row="1"
  549. HorizontalAlignment="Left"
  550. VerticalAlignment="Top"
  551. Fill="#AACCEE"
  552. Opacity="0.3"
  553. Stroke="#AACCEE"
  554. StrokeThickness="2" />
  555. <!-- 插入标记 -->
  556. <Line
  557. Name="LineInset"
  558. Grid.Row="1"
  559. AllowDrop="True"
  560. Drop="MidLane_Drop"
  561. IsHitTestVisible="False"
  562. Stroke="#FF477EDE"
  563. StrokeEndLineCap="Triangle"
  564. StrokeStartLineCap="Triangle"
  565. StrokeThickness="5"
  566. Visibility="Collapsed"
  567. X1="20"
  568. X2="20"
  569. Y1="0"
  570. Y2="150" />
  571. <!-- 拖拽虚影 -->
  572. <Image
  573. Name="ImgPicture"
  574. Grid.Row="1"
  575. HorizontalAlignment="Left"
  576. VerticalAlignment="Top"
  577. AllowDrop="True"
  578. Drop="ImgPicture_Drop"
  579. Opacity="0.8"
  580. RenderOptions.BitmapScalingMode="HighQuality"
  581. UseLayoutRounding="True"
  582. Visibility="{Binding ElementName=LineInset, Path=Visibility}" />
  583. <cus:ToastControl
  584. Grid.Row="1"
  585. Width="auto"
  586. Height="auto"
  587. Margin="0,0,0,100"
  588. VerticalAlignment="Bottom"
  589. Background="#89000000"
  590. BeginTime="0:0:0:3"
  591. CornerRadius="4"
  592. FontSize="14"
  593. Foreground="White"
  594. StringContent="{Binding ToastText}"
  595. Visibility="{Binding ShowTip, Mode=TwoWay}"
  596. Duration="0:0:0:3" />
  597. <!--<ProgressBar
  598. Grid.Row="1"
  599. Width="400"
  600. Height="10"
  601. Foreground="Blue"
  602. IsIndeterminate="True"
  603. Visibility="{Binding IsLoading}" />-->
  604. </Grid>
  605. </Border>
  606. </UserControl>