using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Text.RegularExpressions; 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 PDF_Master.Views { /// /// BottomToolContent.xaml 的交互逻辑 /// public partial class BottomToolContent : UserControl { public BottomToolContent() { InitializeComponent(); } private void SetSinglePageCommand_Executed(object sender, ExecutedRoutedEventArgs e) { this.SinglePage_Btn.IsChecked = true; this.DoublePage_Btn.IsChecked = false; } private void SetDoublePageCommand_Executed(object sender, ExecutedRoutedEventArgs e) { this.SinglePage_Btn.IsChecked = false; this.DoublePage_Btn.IsChecked = true; } private void TextBoxEx_PreviewTextInput(object sender, TextCompositionEventArgs e) { Regex regex = new Regex("[^0-9^%]+"); // 限制仅允许数字和百分号 e.Handled = regex.IsMatch(e.Text); } } }