using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace compdfkit_tools.PDFControlUI
{
///
/// 搜索输入控件
///
public partial class CPDFSearchInputUI : UserControl
{
///
/// 搜索事件
///
public event EventHandler SearchEvent;
///
/// 搜索查找下一个事件
///
public event EventHandler FindNextEvent;
///
/// 搜索查找上一个事件
///
public event EventHandler FindPreviousEvent;
///
/// 搜索关键词
///
public string SearchKeyWord
{
get
{
return SearchTextBox.Text;
}
set
{
SearchTextBox.Text = value;
}
}
///
/// 搜索输入文本框宽度
///
public double InputTextBoxWidth
{
get
{
return SearchTextBox.Width;
}
set
{
SearchTextBox.Width = value;
}
}
///
/// 搜索输入文本框高度
///
public double InputTextBoxHeight
{
get
{
return SearchTextBox.Height;
}
set
{
SearchTextBox.Height = value;
}
}
///
/// 查找上一个按钮宽度
///
public double PrevButtonWidth
{
get
{
return PrevButton.Width;
}
set
{
PrevButton.Width = value;
}
}
///
/// 查找上一个按钮高度
///
public double PrevButtonHeight
{
get
{
return PrevButton.Height;
}
set
{
PrevButton.Height = value;
}
}
///
/// 查找下一个按钮宽度
///
public double NextButtonWidth
{
get
{
return NextButton.Width;
}
set
{
NextButton.Width = value;
}
}
///
/// 查找下一个按钮高度
///
public double NextButtonHeight
{
get
{
return NextButton.Height;
}
set
{
NextButton.Height = value;
}
}
public CPDFSearchInputUI()
{
InitializeComponent();
}
///
/// 输入框回车搜索
///
private void SearchTextBox_KeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Enter)
{
SearchEvent?.Invoke(this, SearchKeyWord);
}
}
///
/// 查找上一个按钮点击事件
///
private void PrevButton_Click(object sender, RoutedEventArgs e)
{
FindPreviousEvent?.Invoke(this, EventArgs.Empty);
}
///
/// 查找下一个按钮点击事件
///
private void NextButton_Click(object sender, RoutedEventArgs e)
{
FindNextEvent?.Invoke(this, EventArgs.Empty);
}
}
}