WholeDocumentSearchControl.xaml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <UserControl x:Class="ComPDFKitDemo.BOTA.WholeDocumentSearchControl"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:local="clr-namespace:ComPDFKitDemo.BOTA"
  7. mc:Ignorable="d"
  8. d:DesignHeight="450" d:DesignWidth="800">
  9. <UserControl.Resources>
  10. <ResourceDictionary>
  11. <ResourceDictionary.MergedDictionaries>
  12. <ResourceDictionary Source="../Resources/StyleResource.xaml"/>
  13. </ResourceDictionary.MergedDictionaries>
  14. </ResourceDictionary>
  15. </UserControl.Resources>
  16. <Grid Name="LayoutRoot" Background="White">
  17. <Grid Name="WholeDocumentSearchGrid">
  18. <Grid.RowDefinitions>
  19. <RowDefinition Height="Auto" />
  20. <RowDefinition Height="Auto" />
  21. <RowDefinition Height="Auto" />
  22. <RowDefinition Height="Auto" />
  23. <RowDefinition/>
  24. </Grid.RowDefinitions>
  25. <Grid.ColumnDefinitions>
  26. <ColumnDefinition Width="*" />
  27. <ColumnDefinition Width="Auto" />
  28. </Grid.ColumnDefinitions>
  29. <Grid Grid.Column="0" Grid.Row="0">
  30. <TextBox Margin="5,5,0,5" Name="SearchTextBox" KeyDown="SearchTextBox_KeyDown"></TextBox>
  31. </Grid>
  32. <Grid Grid.Column="1" Grid.Row="0">
  33. <Button Margin="5,5,2,5" Name="SearchButton" Width="Auto" Click="SearchButton_Click">
  34. <Image Source="../Resources/bullet_magnify.png" Height="16"/>
  35. <ToolTipService.ToolTip>
  36. <ToolTip Placement="Bottom">
  37. <TextBlock Text="Search"/>
  38. </ToolTip>
  39. </ToolTipService.ToolTip>
  40. </Button>
  41. </Grid>
  42. <!--Search Options-->
  43. <Grid Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2">
  44. <StackPanel Orientation="Vertical">
  45. <CheckBox Name="WholeWordCheckBox" Content="Whole Word Only" Margin="4"/>
  46. <CheckBox Name="CaseSensitiveCheckBox" Content="Case Sensitive" Margin="4" />
  47. </StackPanel>
  48. </Grid>
  49. <!--Searching Status-->
  50. <Grid Grid.Row="2" Grid.Column="0">
  51. <ProgressBar Grid.Column="0" Name="_progressBar" Height="20" Margin="5,0,0,0"/>
  52. </Grid>
  53. <Grid Grid.Row="2" Grid.Column="1">
  54. <Button Margin="5,5,2,5" Name="CancelSearch" Width="Auto" IsEnabled="False" Click="CancelSearch_Click">
  55. <Image Source="../Resources/cross.png" Height="16"/>
  56. <ToolTipService.ToolTip>
  57. <ToolTip Placement="Bottom">
  58. <TextBlock Text="Stop"/>
  59. </ToolTip>
  60. </ToolTipService.ToolTip>
  61. </Button>
  62. </Grid>
  63. <Grid Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2">
  64. <TextBlock Name="_summary" Margin="4" TextWrapping="Wrap" FontWeight="Bold"/>
  65. </Grid>
  66. <Grid Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2">
  67. <ListBox Name="ListSearchResults" SelectionMode="Single" SelectionChanged="ListSearchResults_SelectionChanged">
  68. <ListBox.ItemContainerStyle>
  69. <Style TargetType="{x:Type ListBoxItem}">
  70. <Setter Property="HorizontalContentAlignment" Value="Left"/>
  71. <Setter Property="VerticalContentAlignment" Value="Center"/>
  72. </Style>
  73. </ListBox.ItemContainerStyle>
  74. <ListBox.ContextMenu>
  75. <ContextMenu>
  76. <MenuItem Header="Highlight" Click="CommandBind_Executed" Tag="Highlight"></MenuItem>
  77. <MenuItem Header="Underline" Click="CommandBind_Executed" Tag="Underline"></MenuItem>
  78. <MenuItem Header="Strikeout" Click="CommandBind_Executed" Tag="Strikeout"></MenuItem>
  79. <MenuItem Header="Squiggly" Click="CommandBind_Executed" Tag="Squiggly"></MenuItem>
  80. </ContextMenu>
  81. </ListBox.ContextMenu>
  82. </ListBox>
  83. </Grid>
  84. </Grid>
  85. </Grid>
  86. </UserControl>