CPDFSearchInputUI.xaml 6.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <UserControl x:Class="ComPDFKit.Controls.PDFControlUI.CPDFSearchInputUI"
  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:ComPDFKit.Controls.PDFControlUI"
  7. xmlns:common="clr-namespace:ComPDFKit.Controls.Common"
  8. d:DesignWidth="300" d:DesignHeight="100"
  9. mc:Ignorable="d">
  10. <UserControl.Resources>
  11. <ResourceDictionary>
  12. <common:TextLengthToVisibilityConverter x:Key="TextLengthToVisibilityConverter"/>
  13. <common:InvertTextLengthToVisibilityConverter x:Key="InvertTextLengthToVisibilityConverter"/>
  14. <common:TextLengthToBoolConverter x:Key="TextLengthToBoolConverter"/>
  15. <common:BotaResourceConverter x:Key="BotaResourceConverter"></common:BotaResourceConverter>
  16. <ResourceDictionary.MergedDictionaries>
  17. <ResourceDictionary Source="../../../Asset/Styles/ButtonStyle.xaml"></ResourceDictionary>
  18. </ResourceDictionary.MergedDictionaries>
  19. </ResourceDictionary>
  20. </UserControl.Resources>
  21. <Grid x:Name="InputGrid">
  22. <Grid.ColumnDefinitions>
  23. <ColumnDefinition Width="*"></ColumnDefinition>
  24. <ColumnDefinition Width="auto"></ColumnDefinition>
  25. </Grid.ColumnDefinitions>
  26. <Grid.RowDefinitions>
  27. <RowDefinition Height="*"></RowDefinition>
  28. <RowDefinition Height="*"></RowDefinition>
  29. </Grid.RowDefinitions>
  30. <Grid Margin="0,0,8,0">
  31. <TextBox Name="SearchTextBox" VerticalContentAlignment="Center" Height="30" KeyDown="SearchTextBox_KeyDown" Padding="5,0,30,0"></TextBox>
  32. <TextBlock VerticalAlignment="Center" IsHitTestVisible="False" Margin="10,0,0,0" Foreground="#999999"
  33. Visibility="{Binding ElementName=SearchTextBox,Path=Text,Converter={StaticResource TextLengthToVisibilityConverter}}"
  34. Text="{Binding Converter={StaticResource BotaResourceConverter},ConverterParameter=Holder_Search}"></TextBlock>
  35. <Border Visibility="{Binding ElementName=SearchTextBox,Path=Text,Converter={StaticResource InvertTextLengthToVisibilityConverter}}"
  36. HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,10,0"
  37. Background="#01000000" MouseLeftButtonDown="TextClear_MouseLeftButtonDown">
  38. <Path Fill="Black" IsHitTestVisible="False">
  39. <Path.Data>
  40. M12.5762 3.95117L8.5332 8L12.5762 12.0488L12.0488 12.5762L8 8.5332L3.95117 12.5762L3.42383 12.0488L7.4668 8L3.42383 3.95117L3.95117 3.42383L8 7.4668L12.0488 3.42383L12.5762 3.95117Z
  41. </Path.Data>
  42. </Path>
  43. </Border>
  44. </Grid>
  45. <Grid Grid.Column="1">
  46. <Button Name="SearchBtn" Style="{StaticResource ButtonStyle}" Width="56" Height="30" FontSize="14" Click="SearchBtn_Click"
  47. IsEnabled="{Binding ElementName=SearchTextBox,Path=Text,Converter={StaticResource TextLengthToBoolConverter}}"
  48. Content="{Binding Converter={StaticResource BotaResourceConverter},ConverterParameter=Button_Done}">
  49. </Button>
  50. </Grid>
  51. <Grid Grid.Row="1" Margin="0,0,8,0">
  52. <TextBox Name="ReplaceTextBox" VerticalContentAlignment="Center" Height="30" KeyDown="SearchTextBox_KeyDown" Padding="5,0,30,0"></TextBox>
  53. <TextBlock VerticalAlignment="Center" IsHitTestVisible="False" Margin="10,0,0,0" Foreground="#999999"
  54. Visibility="{Binding ElementName=ReplaceTextBox,Path=Text,Converter={StaticResource TextLengthToVisibilityConverter}}"
  55. Text="{Binding Converter={StaticResource BotaResourceConverter},ConverterParameter=Holder_Replace}"></TextBlock>
  56. <Border Visibility="{Binding ElementName=ReplaceTextBox,Path=Text,Converter={StaticResource InvertTextLengthToVisibilityConverter}}"
  57. HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,10,0"
  58. Background="#01000000" MouseLeftButtonDown="ReplaceTextClear_MouseLeftButtonDown">
  59. <Path Fill="Black" IsHitTestVisible="False">
  60. <Path.Data>
  61. M12.5762 3.95117L8.5332 8L12.5762 12.0488L12.0488 12.5762L8 8.5332L3.95117 12.5762L3.42383 12.0488L7.4668 8L3.42383 3.95117L3.95117 3.42383L8 7.4668L12.0488 3.42383L12.5762 3.95117Z
  62. </Path.Data>
  63. </Path>
  64. </Border>
  65. </Grid>
  66. <Grid Grid.Row="1" Grid.Column="1">
  67. <DockPanel>
  68. <Button Background="Transparent" BorderThickness="0" Width="20" Height="20" FontSize="14" HorizontalAlignment="Left" Click="Previous_Click"
  69. ToolTip="{Binding Converter={StaticResource BotaResourceConverter},ConverterParameter=Button_Prev}">
  70. <Viewbox>
  71. <Path StrokeThickness="1.5" Stroke="#999999">
  72. <Path.Data>
  73. M8 1.07129L2 7.07111L8 13.0709
  74. </Path.Data>
  75. </Path>
  76. </Viewbox>
  77. </Button>
  78. <Button Background="Transparent" BorderThickness="0" Width="20" Height="20" FontSize="14" HorizontalAlignment="Right" Click="Next_Click"
  79. ToolTip="{Binding Converter={StaticResource BotaResourceConverter},ConverterParameter=Button_Next}">
  80. <Viewbox>
  81. <Path StrokeThickness="1.5" Stroke="#999999">
  82. <Path.Data>
  83. M2 1.07129L8 7.07111L2 13.0709
  84. </Path.Data>
  85. </Path>
  86. </Viewbox>
  87. </Button>
  88. </DockPanel>
  89. </Grid>
  90. </Grid>
  91. </UserControl>