SearchContent.xaml 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532
  1. <UserControl
  2. x:Class="PDF_Office.Views.BOTA.SearchContent"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:bota="clr-namespace:PDF_Office.ViewModels.BOTA"
  6. xmlns:convert="clr-namespace:PDF_Office.DataConvert"
  7. xmlns:customControl="clr-namespace:PDF_Office.CustomControl"
  8. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  9. xmlns:helper="clr-namespace:PDF_Office.Helper"
  10. xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
  11. xmlns:local="clr-namespace:PDF_Office.Views.BOTA"
  12. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  13. xmlns:prism="http://prismlibrary.com/"
  14. d:DataContext="{d:DesignInstance Type=bota:SearchContentViewModel}"
  15. d:DesignHeight="450"
  16. d:DesignWidth="800"
  17. prism:ViewModelLocator.AutoWireViewModel="True"
  18. KeyDown="UserControl_KeyDown"
  19. Loaded="UserControl_Loaded"
  20. mc:Ignorable="d">
  21. <UserControl.Resources>
  22. <convert:WidthConvert x:Key="WidthConvert" />
  23. <convert:BoolToVisible x:Key="BoolToVisible" />
  24. <convert:InvertBoolToVisibleConvert x:Key="InvertBoolToVisibleConvert" />
  25. <convert:ListCountToVisible x:Key="ListCountToVisible" />
  26. <convert:UnVisivleConvert x:Key="UnVisivleConvert" />
  27. <Style x:Key="ListViewItemGraySelectStyle" TargetType="{x:Type ListViewItem}">
  28. <Setter Property="Visibility" Value="{Binding TextProperty.ItemVisibility}" />
  29. <Setter Property="UIElement.SnapsToDevicePixels" Value="True" />
  30. <Setter Property="Control.Padding" Value="0" />
  31. <Setter Property="Control.HorizontalContentAlignment">
  32. <Setter.Value>
  33. <Binding Path="HorizontalContentAlignment" RelativeSource="{RelativeSource Mode=FindAncestor, AncestorType=ItemsControl, AncestorLevel=1}" />
  34. </Setter.Value>
  35. </Setter>
  36. <Setter Property="Control.VerticalContentAlignment">
  37. <Setter.Value>
  38. <Binding Path="VerticalContentAlignment" RelativeSource="{RelativeSource Mode=FindAncestor, AncestorType=ItemsControl, AncestorLevel=1}" />
  39. </Setter.Value>
  40. </Setter>
  41. <Setter Property="Panel.Background" Value="#00FFFFFF" />
  42. <Setter Property="Border.BorderBrush" Value="#00FFFFFF" />
  43. <Setter Property="Border.BorderThickness" Value="1" />
  44. <Setter Property="FrameworkElement.FocusVisualStyle">
  45. <Setter.Value>
  46. <Style TargetType="{x:Type IFrameworkInputElement}">
  47. <Setter Property="Control.Template">
  48. <Setter.Value>
  49. <ControlTemplate>
  50. <Rectangle
  51. Margin="2"
  52. SnapsToDevicePixels="True"
  53. Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"
  54. StrokeDashArray="1 2"
  55. StrokeThickness="1" />
  56. </ControlTemplate>
  57. </Setter.Value>
  58. </Setter>
  59. </Style>
  60. </Setter.Value>
  61. </Setter>
  62. <Setter Property="Control.Template">
  63. <Setter.Value>
  64. <ControlTemplate TargetType="{x:Type ListViewItem}">
  65. <Border
  66. Name="Bd"
  67. Padding="{TemplateBinding Control.Padding}"
  68. Background="{TemplateBinding Panel.Background}"
  69. BorderBrush="{TemplateBinding Border.BorderBrush}"
  70. BorderThickness="{TemplateBinding Border.BorderThickness}"
  71. CornerRadius="4"
  72. SnapsToDevicePixels="True">
  73. <Border.ContextMenu>
  74. <ContextMenu>
  75. <MenuItem
  76. Click="Create_Click"
  77. Header="加入新圆形"
  78. Tag="Round" />
  79. <MenuItem
  80. Click="Create_Click"
  81. Header="加入新四边形"
  82. Tag="Rectangle" />
  83. <MenuItem
  84. Click="Create_Click"
  85. Header="加入新高亮"
  86. Tag="Highlight" />
  87. <MenuItem
  88. Click="Create_Click"
  89. Header="加入新下划线"
  90. Tag="Underline" />
  91. <MenuItem
  92. Click="Create_Click"
  93. Header="加入新删除线"
  94. Tag="Strikethrough" />
  95. </ContextMenu>
  96. </Border.ContextMenu>
  97. <ContentPresenter
  98. HorizontalAlignment="{TemplateBinding Control.HorizontalContentAlignment}"
  99. VerticalAlignment="{TemplateBinding Control.VerticalContentAlignment}"
  100. Content="{TemplateBinding ContentControl.Content}"
  101. ContentStringFormat="{TemplateBinding ContentControl.ContentStringFormat}"
  102. ContentTemplate="{TemplateBinding ContentControl.ContentTemplate}"
  103. SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" />
  104. </Border>
  105. <ControlTemplate.Triggers>
  106. <MultiTrigger>
  107. <MultiTrigger.Conditions>
  108. <Condition Property="UIElement.IsMouseOver" Value="True" />
  109. </MultiTrigger.Conditions>
  110. <Setter TargetName="Bd" Property="Panel.Background" Value="{StaticResource color.item-state.sel.bg.lv3}" />
  111. <Setter TargetName="Bd" Property="Border.BorderBrush" Value="{StaticResource color.item-state.sel.border.lv3}" />
  112. </MultiTrigger>
  113. <MultiTrigger>
  114. <MultiTrigger.Conditions>
  115. <Condition Property="Selector.IsSelectionActive" Value="False" />
  116. <Condition Property="Selector.IsSelected" Value="True" />
  117. </MultiTrigger.Conditions>
  118. <Setter TargetName="Bd" Property="Panel.Background" Value="#1A477EDE" />
  119. <Setter TargetName="Bd" Property="Border.BorderBrush" Value="#1A477EDE" />
  120. </MultiTrigger>
  121. <MultiTrigger>
  122. <MultiTrigger.Conditions>
  123. <Condition Property="Selector.IsSelectionActive" Value="True" />
  124. <Condition Property="Selector.IsSelected" Value="True" />
  125. </MultiTrigger.Conditions>
  126. <Setter TargetName="Bd" Property="Panel.Background" Value="{StaticResource color.item-state.sel.bg.lv3}" />
  127. <Setter TargetName="Bd" Property="Border.BorderBrush" Value="{StaticResource color.item-state.sel.border.lv3}" />
  128. </MultiTrigger>
  129. <Trigger Property="UIElement.IsEnabled" Value="False">
  130. <Setter TargetName="Bd" Property="TextElement.Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
  131. </Trigger>
  132. </ControlTemplate.Triggers>
  133. </ControlTemplate>
  134. </Setter.Value>
  135. </Setter>
  136. </Style>
  137. <Style x:Key="CustomizeMenuItem" TargetType="{x:Type MenuItem}">
  138. <Setter Property="Foreground" Value="{StaticResource color.sys.text.neutral.lv1}" />
  139. <Setter Property="Background" Value="Transparent" />
  140. <Setter Property="Height" Value="32" />
  141. <Setter Property="Margin" Value="8,0" />
  142. <Setter Property="Template">
  143. <Setter.Value>
  144. <ControlTemplate TargetType="{x:Type MenuItem}">
  145. <Border
  146. x:Name="Border"
  147. Background="{TemplateBinding Background}"
  148. BorderBrush="{TemplateBinding BorderBrush}"
  149. BorderThickness="0"
  150. CornerRadius="7">
  151. <Grid>
  152. <Grid.ColumnDefinitions>
  153. <ColumnDefinition
  154. x:Name="ColIcon"
  155. Width="Auto"
  156. SharedSizeGroup="MenuItemIconColumnGroup" />
  157. <ColumnDefinition Width="Auto" SharedSizeGroup="MenuTextColumnGroup" />
  158. <ColumnDefinition Width="Auto" SharedSizeGroup="MenuItemIGTColumnGroup" />
  159. <ColumnDefinition x:Name="ColNext" Width="auto" />
  160. </Grid.ColumnDefinitions>
  161. <ContentPresenter
  162. x:Name="Icon"
  163. Grid.Column="0"
  164. Margin="5,0"
  165. VerticalAlignment="Center"
  166. ContentSource="Icon" />
  167. <Grid
  168. x:Name="GlyphPanel"
  169. Grid.Column="0"
  170. Margin="5,0"
  171. VerticalAlignment="Center"
  172. Visibility="Hidden">
  173. <Viewbox
  174. Width="18"
  175. Height="18"
  176. VerticalAlignment="Center"
  177. FlowDirection="LeftToRight">
  178. <Path Data="M422.36247 839.786465c-13.320377 13.421684-34.909068 13.421684-48.126091 0l-10.69355-10.800997 0 0-11.398608-11.502985-50.145074-50.544163c-0.097214-0.201591 0-0.500397-0.201591-0.604774L72.380494 533.085224c-13.320377-13.421684-13.320377-35.218106 0-48.535413l72.132854-72.842005c13.319353-13.408381 34.907021-13.408381 48.224328 0l205.814506 209.252815L831.363631 184.208419c13.218046-13.414521 34.806737-13.414521 48.124044 0l72.134901 72.842005c13.317307 13.408381 13.317307 35.113729 0 48.52211L422.36247 839.786465 422.36247 839.786465z" Fill="{TemplateBinding Foreground}" />
  179. </Viewbox>
  180. </Grid>
  181. <ContentPresenter
  182. x:Name="HeaderHost"
  183. Grid.Column="1"
  184. Margin="{TemplateBinding Padding}"
  185. VerticalAlignment="Center"
  186. ContentSource="Header"
  187. RecognizesAccessKey="True" />
  188. <ContentPresenter
  189. x:Name="IGTHost"
  190. Grid.Column="2"
  191. Margin="8,0"
  192. VerticalAlignment="Center"
  193. ContentSource="InputGestureText" />
  194. <Grid
  195. x:Name="ArrowPanel"
  196. Grid.Column="3"
  197. Margin="10,0"
  198. HorizontalAlignment="Right"
  199. VerticalAlignment="Center">
  200. <Path
  201. x:Name="ArrowPanelPath"
  202. HorizontalAlignment="Right"
  203. VerticalAlignment="Center"
  204. Data="M0,0 L0,8 L4,4 z"
  205. Fill="{TemplateBinding Foreground}" />
  206. </Grid>
  207. <Popup
  208. x:Name="SubMenuPopup"
  209. AllowsTransparency="True"
  210. Focusable="false"
  211. IsOpen="{Binding Path=IsSubmenuOpen, RelativeSource={RelativeSource TemplatedParent}}"
  212. Placement="Right">
  213. <Border
  214. x:Name="SubMenuBorder"
  215. Padding="2,2,2,2"
  216. Background="{StaticResource color.sys.layout.mg}"
  217. BorderBrush="#999999"
  218. BorderThickness="0"
  219. CornerRadius="7">
  220. <Grid x:Name="SubMenu" Grid.IsSharedSizeScope="True">
  221. <StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Cycle" />
  222. </Grid>
  223. </Border>
  224. </Popup>
  225. </Grid>
  226. </Border>
  227. <ControlTemplate.Triggers>
  228. <Trigger Property="Role" Value="TopLevelHeader">
  229. <Setter Property="Padding" Value="6,1" />
  230. <Setter Property="Background" Value="Transparent" />
  231. <Setter TargetName="SubMenuPopup" Property="Placement" Value="Bottom" />
  232. <Setter TargetName="ColIcon" Property="MinWidth" Value="0" />
  233. <Setter TargetName="ColNext" Property="Width" Value="Auto" />
  234. <Setter TargetName="Icon" Property="Visibility" Value="Collapsed" />
  235. <Setter TargetName="GlyphPanel" Property="Visibility" Value="Collapsed" />
  236. <Setter TargetName="IGTHost" Property="Visibility" Value="Collapsed" />
  237. <Setter TargetName="ArrowPanel" Property="Visibility" Value="Collapsed" />
  238. </Trigger>
  239. <Trigger Property="IsHighlighted" Value="true">
  240. <Setter TargetName="Border" Property="Background" Value="{StaticResource color.item-state.sel.bg.lv1}" />
  241. <Setter Property="Foreground" Value="{StaticResource color.sys.text.accent.norm}" />
  242. </Trigger>
  243. <MultiTrigger>
  244. <MultiTrigger.Conditions>
  245. <Condition Property="IsHighlighted" Value="True" />
  246. <Condition Property="Role" Value="TopLevelHeader" />
  247. </MultiTrigger.Conditions>
  248. <MultiTrigger.Setters>
  249. <Setter TargetName="Border" Property="Background" Value="#0cffffff" />
  250. </MultiTrigger.Setters>
  251. </MultiTrigger>
  252. <Trigger Property="Role" Value="TopLevelItem">
  253. <Setter Property="Padding" Value="6,1" />
  254. <Setter TargetName="ArrowPanel" Property="Visibility" Value="Collapsed" />
  255. </Trigger>
  256. <Trigger Property="Role" Value="SubmenuHeader">
  257. <Setter Property="Padding" Value="5,2" />
  258. </Trigger>
  259. <Trigger Property="Role" Value="SubmenuItem">
  260. <Setter Property="Padding" Value="5,2" />
  261. <Setter TargetName="ArrowPanel" Property="Visibility" Value="Collapsed" />
  262. </Trigger>
  263. <Trigger Property="Icon" Value="{x:Null}">
  264. <Setter TargetName="Icon" Property="Visibility" Value="Collapsed" />
  265. </Trigger>
  266. <Trigger Property="IsChecked" Value="true">
  267. <Setter TargetName="GlyphPanel" Property="Visibility" Value="Visible" />
  268. <Setter TargetName="Icon" Property="Visibility" Value="Collapsed" />
  269. </Trigger>
  270. <Trigger Property="IsEnabled" Value="false">
  271. <Setter Property="Foreground" Value="{StaticResource color.sys.text.neutral.dis}" />
  272. </Trigger>
  273. </ControlTemplate.Triggers>
  274. </ControlTemplate>
  275. </Setter.Value>
  276. </Setter>
  277. </Style>
  278. <PathGeometry x:Key="Ic_MoreButtonPath" Figures="M5.83333 12.5C8.13452 12.5 10 10.6345 10 8.33333C10 6.03215 8.13452 4.16667 5.83333 4.16667C3.53215 4.16667 1.66667 6.03215 1.66667 8.33333C1.66667 10.6345 3.53215 12.5 5.83333 12.5ZM5.83333 14.1667C6.8191 14.1667 7.74775 13.9222 8.56195 13.4905L12.4581 17.3866L13.6366 16.2081L9.92222 12.4937C10.9989 11.4354 11.6667 9.96235 11.6667 8.33333C11.6667 5.11167 9.05499 2.5 5.83333 2.5C2.61167 2.5 0 5.11167 0 8.33333C0 11.555 2.61167 14.1667 5.83333 14.1667ZM13.5059 7.65166L16.1576 10.3033L18.8092 7.65166L19.9877 8.83017L16.7468 12.0711C16.4214 12.3965 15.8938 12.3965 15.5683 12.0711L12.3274 8.83017L13.5059 7.65166Z" />
  279. <PathGeometry x:Key="Ic_ExpandButtonPath" Figures="M5.99993 7.56427L2.03033 3.59467L0.969666 4.65533L5.4696 9.15526C5.7625 9.44816 6.23737 9.44816 6.53026 9.15526L11.0302 4.65533L9.96954 3.59467L5.99993 7.56427Z" />
  280. <PathGeometry x:Key="Ic_ShrinkButtonPath" Figures="M7.56432 5.99996L3.59467 9.96961L4.65533 11.0303L9.15531 6.53029C9.4482 6.2374 9.4482 5.76252 9.15531 5.46963L4.65533 0.969645L3.59467 2.0303L7.56432 5.99996Z" />
  281. </UserControl.Resources>
  282. <Grid Background="#F3F3F3">
  283. <Grid.RowDefinitions>
  284. <RowDefinition Height="auto" />
  285. <RowDefinition Height="auto" />
  286. <RowDefinition />
  287. </Grid.RowDefinitions>
  288. <Grid>
  289. <Grid.ColumnDefinitions>
  290. <ColumnDefinition Width="16" />
  291. <ColumnDefinition Width="*" />
  292. <ColumnDefinition Width="16" />
  293. </Grid.ColumnDefinitions>
  294. <Grid.RowDefinitions>
  295. <RowDefinition Height="13" />
  296. <RowDefinition Height="auto" />
  297. <RowDefinition Height="8" />
  298. <RowDefinition Height="auto" />
  299. <RowDefinition Height="18" />
  300. </Grid.RowDefinitions>
  301. <Grid Grid.Row="1" Grid.Column="1">
  302. <TextBlock
  303. HorizontalAlignment="Left"
  304. VerticalAlignment="Center"
  305. FontSize="14"
  306. Text="Search" />
  307. <Button
  308. Width="45"
  309. Height="24"
  310. HorizontalAlignment="Right"
  311. VerticalAlignment="Center"
  312. Command="{Binding CleanCommand}"
  313. Content="完成"
  314. Style="{StaticResource Btn.cta}"
  315. Visibility="{Binding Completed}" />
  316. </Grid>
  317. <customControl:TextBoxEx
  318. x:Name="SearchText"
  319. Grid.Row="3"
  320. Grid.Column="1"
  321. Height="32"
  322. Padding="14,0,0,0"
  323. HorizontalAlignment="Stretch"
  324. Text="{Binding SearchTextContext,Mode=TwoWay}"
  325. Initialized="TextBoxEx_Initialized"
  326. KeyDown="TextBox_KeyDown">
  327. <customControl:TextBoxEx.ContextMenu>
  328. <ContextMenu Name="ContextSearchText" Width="180">
  329. <MenuItem
  330. x:Name="IgnoreItem"
  331. Header="Ignore Case"
  332. IsCheckable="True"
  333. IsChecked="{Binding CaseInsensitive, Mode=TwoWay}"
  334. Style="{StaticResource CustomizeMenuItem}" />
  335. <Separator x:Name="IgnoreSeparator" Style="{StaticResource HorizontalSeparatorStyle}" />
  336. <Separator x:Name="ClearSeparator" Style="{StaticResource HorizontalSeparatorStyle}" />
  337. <MenuItem
  338. x:Name="ClearItem"
  339. Click="ClearItem_Click"
  340. Header="Clear Search History"
  341. Style="{StaticResource CustomizeMenuItem}" />
  342. </ContextMenu>
  343. </customControl:TextBoxEx.ContextMenu>
  344. </customControl:TextBoxEx>
  345. <customControl:PathButton
  346. Grid.Row="3"
  347. Grid.Column="1"
  348. Width="20"
  349. Height="20"
  350. Margin="8,0,0,0"
  351. HorizontalAlignment="Left"
  352. Click="PathButton_Click"
  353. CornerRadius="4"
  354. Icon="{StaticResource Ic_MoreButtonPath}"
  355. IconFill="#616469"
  356. IconHeight="20"
  357. IconMouseOver="{StaticResource Ic_MoreButtonPath}"
  358. IconMouseOverFill="#616469"
  359. IconPress="{StaticResource Ic_MoreButtonPath}"
  360. IconPressFill="#616469"
  361. IconWidth="20"
  362. MouseDownBackground="{StaticResource color.item-state.sel.bg.lv3}"
  363. MouseDownBorderBrush="{StaticResource color.item-state.sel.border.lv3}"
  364. MouseOverBackground="{StaticResource color.item-state.hov.bg}" />
  365. </Grid>
  366. <Grid
  367. Grid.Row="1"
  368. Margin="10,0,10,0"
  369. Visibility="{Binding ElementName=NoSearch, Path=Visibility, Converter={StaticResource UnVisivleConvert}}">
  370. <TextBlock
  371. Margin="0,0,0,10"
  372. HorizontalAlignment="Left"
  373. VerticalAlignment="Center"
  374. Text="All Result" />
  375. <StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
  376. <TextBlock
  377. Margin="0,0,0,10"
  378. HorizontalAlignment="Right"
  379. VerticalAlignment="Center"
  380. Text="Results:" />
  381. <TextBlock
  382. x:Name="TbCount"
  383. Margin="0,0,0,10"
  384. HorizontalAlignment="Right"
  385. VerticalAlignment="Center"
  386. Text="{Binding SearchCount}" />
  387. </StackPanel>
  388. </Grid>
  389. <Grid Grid.Row="2">
  390. <ListView
  391. Name="SearchResultList"
  392. BorderThickness="0"
  393. ItemContainerStyle="{StaticResource ListViewItemGraySelectStyle}"
  394. ItemsSource="{Binding SearchItemList}"
  395. ScrollViewer.HorizontalScrollBarVisibility="Hidden"
  396. VirtualizingPanel.IsVirtualizingWhenGrouping="True">
  397. <ListView.GroupStyle>
  398. <GroupStyle>
  399. <GroupStyle.HeaderTemplate>
  400. <DataTemplate>
  401. <Border
  402. Height="32"
  403. Padding="16,5,5,5"
  404. VerticalAlignment="Center"
  405. Background="{StaticResource color.sys.layout.fg.light}">
  406. <Grid VerticalAlignment="Center">
  407. <TextBlock
  408. HorizontalAlignment="Left"
  409. VerticalAlignment="Stretch"
  410. FontFamily="SF Pro Text"
  411. FontSize="14"
  412. FontWeight="Regular"
  413. Foreground="{StaticResource color.sys.text.neutral.lv1}"
  414. Text="{Binding Name}"
  415. TextAlignment="Center" />
  416. <StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
  417. <TextBlock
  418. HorizontalAlignment="Center"
  419. VerticalAlignment="Center"
  420. FontFamily="SF Pro Text"
  421. FontSize="14"
  422. FontWeight="Regular"
  423. Foreground="{StaticResource color.sys.text.neutral.lv3}"
  424. Text="{Binding Items.Count}"
  425. TextAlignment="Center" />
  426. <customControl:PathButton
  427. Width="24"
  428. Height="24"
  429. HorizontalAlignment="Center"
  430. VerticalAlignment="Center"
  431. HorizontalContentAlignment="Center"
  432. VerticalContentAlignment="Center"
  433. Click="BtnExptend_Click"
  434. Icon="{StaticResource Ic_ExpandButtonPath}"
  435. IconChecked="{StaticResource Ic_ShrinkButtonPath}"
  436. IconCheckedFill="#616469"
  437. IconFill="#616469"
  438. IconHeight="12"
  439. IconMouseOver="{StaticResource Ic_ExpandButtonPath}"
  440. IconMouseOverFill="#616469"
  441. IconPress="{StaticResource Ic_ExpandButtonPath}"
  442. IconPressFill="#616469"
  443. IconWidth="12" />
  444. </StackPanel>
  445. </Grid>
  446. </Border>
  447. </DataTemplate>
  448. </GroupStyle.HeaderTemplate>
  449. <GroupStyle.Panel>
  450. <ItemsPanelTemplate>
  451. <VirtualizingStackPanel Visibility="Visible" />
  452. </ItemsPanelTemplate>
  453. </GroupStyle.Panel>
  454. </GroupStyle>
  455. </ListView.GroupStyle>
  456. <ListView.ItemsPanel>
  457. <ItemsPanelTemplate>
  458. <VirtualizingStackPanel Margin="-5,0,0,0" Background="{StaticResource color.sys.layout.mg}" />
  459. </ItemsPanelTemplate>
  460. </ListView.ItemsPanel>
  461. <ListView.ItemTemplate>
  462. <ItemContainerTemplate>
  463. <StackPanel>
  464. <RichTextBox
  465. Width="{Binding ElementName=SearchResultList, Path=ActualWidth, Converter={StaticResource WidthConvert}}"
  466. Padding="12,6,10,6"
  467. VerticalAlignment="Center"
  468. VerticalContentAlignment="Center"
  469. helper:RichTextBoxHelper.DocumentBind="{Binding TextProperty}"
  470. Background="Transparent"
  471. BorderThickness="0"
  472. Cursor="Arrow"
  473. FontFamily="Segoe UI"
  474. FontSize="14"
  475. FontWeight="Regular"
  476. Foreground="{StaticResource color.sys.text.neutral.lv1}"
  477. IsHitTestVisible="False"
  478. IsReadOnly="True" />
  479. </StackPanel>
  480. </ItemContainerTemplate>
  481. </ListView.ItemTemplate>
  482. <i:Interaction.Triggers>
  483. <i:EventTrigger EventName="SelectionChanged">
  484. <i:InvokeCommandAction Command="{Binding SearchChangedCommand}" CommandParameter="{Binding ElementName=SearchResultList, Path=SelectedItem}" />
  485. </i:EventTrigger>
  486. </i:Interaction.Triggers>
  487. </ListView>
  488. </Grid>
  489. <Grid
  490. x:Name="NoSearch"
  491. Grid.Row="0"
  492. Grid.RowSpan="3"
  493. Visibility="{Binding SearchItemList.Count, Converter={StaticResource ListCountToVisible}}">
  494. <StackPanel VerticalAlignment="Center">
  495. <Image
  496. Width="128"
  497. Height="128"
  498. Source="pack://application:,,,/PDF Office;component/Resources/BOTA/no search.png" />
  499. <TextBlock
  500. Height="22"
  501. HorizontalAlignment="Center"
  502. FontFamily="Segoe UI"
  503. FontSize="14"
  504. Text="No search results" />
  505. <TextBlock
  506. Width="168"
  507. HorizontalAlignment="Center"
  508. FontFamily="Segoe UI"
  509. FontSize="12"
  510. Foreground="#94989C"
  511. Text="Search requests can be entered above."
  512. TextAlignment="Center"
  513. TextWrapping="Wrap" />
  514. </StackPanel>
  515. </Grid>
  516. </Grid>
  517. </UserControl>