123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- using PDF_Master.CustomControl;
- using PDF_Master.Helper;
- using PDF_Master.Model.AnnotPanel;
- 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
- {
- /// <summary>
- /// SignatureAnnotProperty.xaml 的交互逻辑
- /// </summary>
- public partial class SignatureAnnotProperty : UserControl
- {
- public SignatureAnnotProperty()
- {
- InitializeComponent();
- //KeyEventsHelper.KeyDown -= ShortCut_KeyDown;
- //KeyEventsHelper.KeyDown += ShortCut_KeyDown;
- }
- private void ShortCut_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.Key == Key.Escape)
- {
- (DataContext as SignatureAnnotPropertyViewModel).Close();
- e.Handled = true;
- }
- }
- private void ListBoxItem_PreviewMouseDown(object sender, MouseButtonEventArgs e)
- {
- (DataContext as SignatureAnnotPropertyViewModel).SetSignature((sender as ListBoxItem).DataContext as Signature);
- }
- private void Save_Click(object sender, RoutedEventArgs e)
- {
- MenuItem item = sender as MenuItem;
- (DataContext as SignatureAnnotPropertyViewModel).SaveToPath(item.Tag.ToString(), item.DataContext as Signature);
- }
- private void Delete_Click(object sender, RoutedEventArgs e)
- {
- MenuItem item = sender as MenuItem;
- (DataContext as SignatureAnnotPropertyViewModel).DeleteSignature(item.DataContext as Signature);
- }
- private void DeleteAll_Click(object sender, RoutedEventArgs e)
- {
- AlertsMessage alertsMessage = new AlertsMessage();
- alertsMessage.ShowDialog("", App.MainPageLoader.GetString("Signature_deleteAllWarning"), App.ServiceLoader.GetString("Text_cancel"), App.ServiceLoader.GetString("Text_ok"));
- if (alertsMessage.result == ContentResult.Ok)
- {
- (DataContext as SignatureAnnotPropertyViewModel).DeleteAll();
- }
- }
- private void UserControl_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.Key == Key.Escape)
- {
- (DataContext as SignatureAnnotPropertyViewModel).Close();
- e.Handled = true;
- }
- }
- private void UserControl_Loaded(object sender, RoutedEventArgs e)
- {
- TxtTitle.Text = App.MainPageLoader.GetString("Signatur_Title");
- }
- }
- }
|