1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- 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.Common
- {
- /// <summary>
- /// PasswordDialog.xaml 的交互逻辑
- /// </summary>
- public partial class PasswordDialog : UserControl
- {
- public event EventHandler Closed;
- public event EventHandler Canceled;
- public event EventHandler<string> Confirmed;
- public PasswordDialog()
- {
- InitializeComponent();
- }
- public void SetShowText(string newText)
- {
- FileEncryptText.Text = newText;
- }
- private void PasswordDialogClose_Click(object sender, RoutedEventArgs e)
- {
- Closed?.Invoke(this, EventArgs.Empty);
- }
- private void PasswordDialogCancel_Click(object sender, RoutedEventArgs e)
- {
- Canceled?.Invoke(this, EventArgs.Empty);
- }
- private void PasswordDialogConfirm_Click(object sender, RoutedEventArgs e)
- {
- Confirmed?.Invoke(this, PasswordBoxText.Password);
- }
- public void SetShowError(string errorText,Visibility visible)
- {
- ErrorTipsText.Text = errorText;
- ErrorTipsText.Visibility = visible;
- }
- public void ClearPassword()
- {
- PasswordBoxText.Password = string.Empty;
- SetShowError(string.Empty, Visibility.Collapsed);
- }
- }
- }
|