using PDF_Master.CustomControl; using PDF_Master.ViewModels.PropertyPanel.AnnotPanel; 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 PDF_Master.Views.PropertyPanel.AnnotPanel { /// /// SignatureCreateDialog.xaml 的交互逻辑 /// public partial class SignatureCreateDialog : UserControl { public SignatureCreateDialog() { InitializeComponent(); InPutTextBox.Focus(); } private void TextRadioButton_Checked(object sender, RoutedEventArgs e) { (DataContext as SignatureCreateDialogViewModel).UpDataRadioButtonIndex(Convert.ToInt32((sender as RadioButton).Tag)); } private void ImageRadioButton_Checked(object sender, RoutedEventArgs e) { (DataContext as SignatureCreateDialogViewModel).UpDataImageRadioButtonIndex(Convert.ToInt32((sender as RadioButton).Tag)); } private void TextBoxEx_TextChanged(object sender, TextChangedEventArgs e) { if (sender is TextBoxEx) { if (string.IsNullOrEmpty((sender as TextBoxEx).Text)) { (DataContext as SignatureCreateDialogViewModel).ShowTextButton = Visibility.Collapsed; } else { (DataContext as SignatureCreateDialogViewModel).ShowTextButton = Visibility.Visible; } } } private void inkCanvas_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { (DataContext as SignatureCreateDialogViewModel).IsMouseDown = true; if ((DataContext as SignatureCreateDialogViewModel).UpdataDrawingStrokesCommnad.CanExecute()) { (DataContext as SignatureCreateDialogViewModel).UpdataDrawingStrokesCommnad.Execute(); } } private void inkCanvas_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { (DataContext as SignatureCreateDialogViewModel).IsMouseDown = false; } private void UserControl_Loaded(object sender, RoutedEventArgs e) { DialogHeader.Header = App.MainPageLoader.GetString("Signatur_DialogTitle"); BtnOK.Content = App.MainPageLoader.GetString("Signatur_DialogYes"); BtnNo.Content = App.MainPageLoader.GetString("Signatur_DialogNo"); InputItem.Header = App.MainPageLoader.GetString("Signatur_DialogText"); InPutTextBox.PlaceholderText = App.MainPageLoader.GetString("Signatur_DialogTextHint"); BtnTextClear.Content = App.MainPageLoader.GetString("Signatur_DialogClear"); DrawItem.Header = App.MainPageLoader.GetString("Signatur_DialogDraw"); DrawHint.Text = App.MainPageLoader.GetString("Signatur_DialogDrawHint"); BtnDrawClear.Content = App.MainPageLoader.GetString("Signatur_DialogClear"); PictureItem.Header = App.MainPageLoader.GetString("Signatur_DialogPicture"); BtnPictureReselect.Content= App.MainPageLoader.GetString("Signatur_DialogPictureReselect"); ImageHint.Text = App.MainPageLoader.GetString("Signatur_DialogPictureHint"); BtnReBkg.Text = App.MainPageLoader.GetString("Signatur_DialogPictureReBkg"); BtnReBkgHint.Content = App.MainPageLoader.GetString("Signatur_DialogPictureReBkgHint"); } } }